Applying Conversion Codes

A conversion code specified in parentheses is applied to the top element in the stack. For example, the F correlative in the next command line divides data values stored in Attribute 6 by the constant 2, then applies an MR conversion code to format the result:

F ; 6 ; C2 ; / ; (MR2)

The next example uses date conversions to return the number of years’ difference between today’s date and dates on file (in other words, each date on file is subtracted from today’s date):

F ; D ; (DY) ; 3 ; (DY) ; –

The system variable D provides today’s date in internal format; the date conversion DY is applied to it, pushing the current year onto the stack. Next, a date stored in Attribute 3 is pushed onto the stack and the DY conversion is applied to it. The subtraction operator is then applied, subtracting the referenced year (the top element) from the current year (the second element).

See Also

F Code

Referencing Attributes

Numeric Constants

Arithmetic Operators

Relational Operators

Special Function Codes