PriorEffDt function
Syntax
PriorEffDt(field)
Description
Use the PriorEffDt function to return the value of the specified field from the record with the prior effective date. This function is valid only for effective-dated records.
If the record contains an effective sequence number field, the value of this field is compared along with the effective-date field when the prior effective date/effective record sequence is determined. Therefore, if there is an effective-sequence number, it's possible that the effective-date field will be the same as the current record, but the sequence number would be earlier.
If a prior record does not exist, the statement is skipped. If the PriorEffDt function is not a top-level statement, that is, if it's contained with a compound statement or a loop, the statement is skipped and execution begins with the next top-level statement.
In the following example, execution skips to the top If statement:
If ACTION <> "REH" Then /* skip to here if PriorEffdt fails to find prior record⇒
*/
If STD_HOURS <> PriorEffdt(STD_HOURS) And
Day(EFFDT) <> 1 Then
Error MsgGet(30000, 8, "Meldung nicht vorhanden - WAZ bzw.⇒
Beschäftigungsgradänderungen sind nur zum ersten eines Monats zulässig.")
End-If;
End-If;
/* if PriorEffdt fails, run to here directly */
Example
If CURRENCY_CD = PriorEffdt(CURRENCY_CD) Then
Evaluate ACTION
When = "PAY"
If ANNUAL_RT = PriorEffdt(ANNUAL_RT) Then
Warning MsgGet(1000, 27, "Pay Rate Change action is chosen and Pay⇒
Rate has not been changed.");
End-if;
Break;
When = "DEM"
If ANNUAL_RT >= PriorEffdt(ANNUAL_RT) Then
Warning MsgGet(1000, 29, "Demotion Action is chosen and Pay Rate has⇒
not been decreased.");
end-if;
When-other
End-evaluate;
WinMessage("This message appears after executing either of the BREAK⇒
statements or after all WHEN statements are false");
End-if;
Related Topics