Interaction Between the CONDITION Command and the CHANNEL Subcommand

Rule

A condition is checked if its associated PRINTLINE command is processed.

Note: ANSI carriage controls and machine (EBCDIC) carriage controls are processed differently. See the SPACE_THEN_PRINT subcommand in Long Form Subcommands for more information.
ANSI
A skip or space occurs before the line is printed.
Machine
The line is printed and then skipping or spacing is done.
For a CONDITION to be checked, it must be associated with the PRINTLINE command that is used for printing.

ANSI Skipping Consideration

The PRINTLINE command is not processed if a skip-to-channel-n character in the carriage control field causes the specified PRINTLINE command not to be processed.

If a data record contains a character, such as 1, in the carriage control field, and a PRINTLINE command is specified with CHANNEL 1 subcommand, the data record is processed under the new PRINTLINE command (the one that specified CHANNEL 1). Any CONDITION associated with the old PRINTLINE command is ignored (never even checked). See the following diagram for an example.

The character 1 in the carriage-control field of the fifth input record causes a page end before condition cond1 is ever checked. Thus, the fifth input record is processed by using the first PRINTLINE command of the current page format.

PPFA Commands Input Records
   PAGEFORMAT PFMTA ;
 
     PRINTLINE CHANNEL 1 ;
     PRINTLINE ;
     PRINTLINE ;
     PRINTLINE ;
     PRINTLINE ;
       CONDITION cond1
         START 6 LENGTH 1
         WHEN EQ ’5‘
         AFTER SUBPAGE
         CURRENT NULL;
 
Input Records

Considerations

The PRINTLINE command is not processed if the PRINTLINE command is spaced over; for example, when multiple line spacing causes certain PRINTLINE commands to be bypassed.

If the input-record carriage-control field specifies a double space before print (for example), and a CONDITION command is specified for the spaced line, the CONDITION is ignored (never checked). Because the OTHERWISE subcommand is part of a CONDITION command, the OTHERWISE subcommand is also ignored.

You might expect an OTHERWISE condition to be true if all other conditions failed. In fact, the OTHERWISE condition can be true if it is associated with a PRINTLINE command that is processed. See the following diagram for an example. This situation assumes that ANSI carriage controls are specified for this print file. ANSI carriage control 0 means space two lines before printing.

The fifth input record contains data (character 5 in the sixth position) that would normally satisfy the condition that is specified on the fifth PRINTLINE command. However, the character 0 in the carriage control field of input record 4 causes the fifth PRINTLINE command to be ignored. The fifth input record is processed by the sixth PRINTLINE command; therefore, the condition is not satisfied.

PPFA Commands Input Records
   PAGEFORMAT PFMTA ;
 
     PRINTLINE CHANNEL 1 ;
     PRINTLINE ;
     PRINTLINE ;
     PRINTLINE ;
     PRINTLINE ;
       CONDITION cond1
         START 6 LENGTH 1
         WHEN EQ ’5‘
         AFTER SUBPAGE
         CURRENT NULL;
     PRINTLINE ;
 
Input Records