Friday, November 27, 2015

Condition display fields without indicators


Program To System Fields

Program to system fields (referenced from here out as P fields) can be used to emphasize field data on display files.

These can be used as an alternative to using indicator controlled display attributes.

P fields are one-byte codes passed to the display file at run-time.

Indicator controlled attributes must be determined at compile time.

In order to utilize the P field attributes the display file must contain a field that is one byte character for the field you wish to alter attributes for.

A            myfield       20A  B 10  6DSPATR(&fldattr)
A            fldattr        1A  P

So if you wished to display the contents of myfield in Red with underlines, you could do so by using the following code in your RPG program.

/free

   fldattr=x'2C';

/end-free

No comments:

Post a Comment