How do I print a conditional field using PPFA code. When a value is an 'X' then I'd like to print it. However, if the 'X' is not present then I'd like to print an image. Here is my code:
LAYOUT C'mylayout' BODY
POSITION .25 in ABSOLUTE .25 in
FONT TIMES
OVERLAY MYTEMPOVER 8.5 in 11.0 in;
FIELD START 1 LENGTH 60
POSITION 2.0 in 1.6 in;
Where it has FIELD START 1 LENGTH 60 that will print the given text at that location. But based on the value I want to print either the given text or an image. How would I do that?
Here is an answer from the AFP-L list:
I would create two
PAGEFORMATS, one with LAYOUT for TEXT and one with LAYOUT for IMAGE. WithCONDITIONyou can jump between the Pageformats (where Copygroup is always 'NULL')If you work in a z/OS environment, be careful of 'JES Blanc Truncation'. That means in one sentence:
PPFA sample syntax:
You must copy this
CONDITIONinto bothPAGEFORMATSafterLAYOUTcommand. Blanc truncation is a difficult problem on z/OS.In this sample, the
PAGEFORMATnamedPRTTXTcontains all the formatting and printing directives when the condition is true, and the other calledPRTIMAGEcontains every directive needed to print the image.HTH