Subcommands (Long Form)
- START Subcommand (Traditional)
-
START n LENGTH n [SPACE_THEN_PRINT {YES | NO}]
- START Subcommand (Record Format and XML)
-
{{START n LENGTH n} | {FLDNUM n [START { 1 | n}] [LENGTH {longest | n}]}
- Specifies the starting byte of the comparison field within the data record where the
comparison is to be done.
- n
- Specifies the number of bytes from the first data byte in the record as the starting
point of the comparison field. The first data byte position of an input record is
1.
Note: The carriage-control character and the table-reference character are not considered data.
- LENGTH
- Specifies the length of the comparison field.
- n
- Specifies the number of bytes in the data record to be compared, beginning with the
position specified in START. Valid values are numbers from 1 to 8000. The length of the constant text must be
the same as defined in this parameter or the results are invalid.
Comparisons are done on a byte-by-byte basis. Because the comparison field and the constant text must have the same lengths, padding is not necessary.
Note: If any part of the comparison field specified by the combination of START and LENGTH is outside the boundaries of the data record, no conditional processing is performed. No WHEN is executed. If an OTHERWISE is present, it is not executed either. - SPACE_THEN_PRINT
- Specifies whether ANSI carriage controls for spacing are enabled for the first record
on the new logical page following the execution of the CONDITION command. The abbreviation of this parameter is SPACE.
Note: This parameter is effective for print files that contain ANSI carriage controls. It is not used for data files containing machine carriage controls, or a mixture of ANSI and machine carriage controls.
- YES
- Specifies that the ANSI carriage-control character in the first print record of the new page is enabled for spacing. The spacing action specified in the carriage control is performed after the eject to the new page. For example, if the carriage-control byte in the first record of the new page is a blank (skip one line before printing), then the first record skips the first line of the new page and prints at the second printline position.
- NO
- Specifies the ANSI carriage-control character spacing action is suppressed for the
first print record of the new page. If this record contains a carriage-control spacing
value, such as
blank
,0
, or–
, the spacing is ignored and the record prints at the first printline position on the new page. Channel code values are not ignored. If the first print record contains a valid channel code value of 1–9, or A–C, then the first record on the new page prints at the printline defined with that channel code.
- FLDNUM
-
[START { 1 | n}] [LENGTH {longest | n}]
Specifies the field number to be used in comparison. This keyword should only be used if the DELIMITER field was used in the LAYOUT command. Fields cannot be counted without delimiters being specified in the database.- n
- Specifies the number of the field. The first field after the record ID is FLDNUM 1.
- START
- Identifies the position in the numbered field where comparison starts.
- LENGTH
- Specifies the length of the field to be used in the WHEN condition.
- longest
- The length of the longest condition. When no specific condition is specified, the length from the starting position to the end of the field
- WHEN Subcommand
-
{WHEN {CHANGE | [{EQ | NE | GT | GE | LT | LE} 'text']} {BEFORE | AFTER} {SUBPAGE (Traditional) | PAGE (Record Format and XML) | LINE} {NEWFORM | NEWSIDE {{CURRENT |=} | FIRST | {NULL | ⁄} | NEXT | COPYGROUP cgname} {{CURRENT | =} | FIRST | {NULL | ⁄} | NEXT | PAGEFORMAT pfname}}}…
- Marks the start of the conditional comparison parameters. At least one WHEN subcommand is required.
- CHANGE
- Specifies that the contents of the comparison field in this record are to be compared
with the field in the record last processed by the same CONDITION command.
This parameter can be specified only once in a CONDITION command.
If the comparison field lies outside the boundary of the current record, which may occur with variable-length records or with truncated trailing blanks, the current record is not used in future comparisons
The results of the comparison is either TRUE or FALSE:
- TRUE
- The contents of the comparison field have changed from one record to the next.
- FALSE
- The contents of the comparison field have changed from one record to the next.
CHANGE is always false if used with the first WHEN subcommand of a series (no previous record to compare against). Whenever a new data map (one with a different name) is invoked, all the CHANGE comparisons are reset. Field values in the previous data map are not retained.
- { EQ | NE | GT | GE | LT | LE }
- Specifies the type of comparison that is to be performed between the data in the comparison
field (the portion of the record specified by START and LENGTH) and the constant text defined in the text parameter.
The choices are:
- EQ
- Equal to
- NE
- Not equal to
- GT
- Greater than
- GE
- Greater than or equal to
- LT
- Less than
- LE
- Less than or equal to
- text
- Specifies constant text for comparison with the comparison field text. The constant
text length must be the same as the value on the LENGTH subcommand, with a maximum length of 8000 bytes. Examples of valid text are:
2C(3)'AB' K'321,400' X'41FE7799' 2 'CHARS'
Any values or parameters that are valid for the TEXT subcommand within the FIELD command may be used as text.
- BEFORE
- Specifies that the conditional action takes place before the current line or subpage is processed. This is the default.
- AFTER
- Specifies that the conditional action takes place after the current line or subpage is processed.
- SUBPAGE (Traditional)
- Specifies that the conditional action takes place either before or after the current
subpage. This is the default for traditional page definitions.
For a description of subpages, see Logical Page.
Note: For CONDITION commands in a record format or XML page definition, the keyword SUBPAGE is acceptable but obsolete. Record format and XML page definitions do not have subpages. - PAGE (Record Format and XML)
- Specifies that the conditional action takes place either before or after the current page. This is the default for record format and XML page definitions.
- LINE
- Specifies that the conditional action takes place either before or after the current line.
- NEWFORM
- Specifies that the only action to be taken is skipping to the front of a new form
(sheet) and restarting the page format.
Note: This parameter is an alternative to using the copygroup and pageformat parameters, and is equivalent to specifying CURRENT for the copygroup parameter and NULL for the pageformat parameter. CURRENT and NULL are the respective defaults for copygroup and pageformat parameters; therefore, NEWFORM is the default action.
- NEWSIDE
- Specifies that the only action to be taken is skipping to a new side (either the back
of the current sheet or the front of a new sheet) and restarting the page format.
- Note:
- This parameter is an alternative to using the copygroup and pageformat parameters, and is equivalent to specifying NULL for thecopygroup parameter and CURRENT for thepageformat parameter.
- Conditional processing does not result in unnecessary blank pages.
If the line currently being processed is the first line on a side, then:
- A COPYGROUP or NEWFORM action taking effect BEFORE LINE does not force an additional new form.
- A PAGEFORMAT or NEWSIDE action taking effect BEFORE LINE does not force an additional new side.
Similarly, additional sides or forms are not forced by BEFORE SUBPAGE if the line currently being processed is in the first subpage on a side or a form.
- copygroup
- Specifies a copy group to be invoked if the condition is true.
Note: Any copy group action (except NULL) restarts the page format.
- CURRENT or =
- Invoke the current copy group again. This ends printing on the current sheet and resumes
it on the front side of a new sheet.
The page format is restarted. This means that the first input record to go on the new page is printed using the first PRINTLINE command of the current page format, and so on. For example, data that was to be printed as subpage 4 on the sheet might be printed on subpage 1 on the new sheet.
- FIRST
- Invokes the first copy group in the current form definition.
- NULL or /
- Retains the current copy group, taking no action.
- NEXT
- Invokes the next copy group in the current form definition.
Note: If NEXT is specified from the last copy group in the form definition, the first copy group in the form definition is used.
- COPYGROUPcgname
- Uses the named copy group defined in the current form definition. The name must contain 1 to 8 alphanumeric characters.
- pageformat
- Specifies a page format to be invoked if the condition is true.
- CURRENT or =
- Invokes the current page format again. This results in ending printing on the current
sheet and resuming on the front side of a new sheet.
The page format is restarted. This means that the first input record to go on the new page is printed using the first PRINTLINE command of the current page format, and so on.
- FIRST
- Invokes the first page format in the current page definition.
- NULL or /
- Retains the current page format, taking no action.
- NEXT
- Invokes the next page format in the current page definition.
Note: If NEXT is specified from the last page format in the page definition, the first page format in the page definition is used.
- PAGEFORMATpfname
- Uses the named page format defined in the current page definition. The name must contain 1 to 8 alphanumeric characters.
- OTHERWISE Subcommand
-
OTHERWISE {BEFORE | AFTER} {SUBPAGE (Traditional) | PAGE (Record Format and XML) | LINE} {NEWFORM | NEWSIDE | {{CURRENT | =} | FIRST | {NULL | ⁄} | NEXT | COPYGROUP cgname} {{CURRENT | =} | FIRST | {NULL | ⁄} | NEXT | PAGEFORMAT pfname}}
- Marks the start of a conditional action to be taken if all preceding WHEN comparisons have proved false. The syntax is the same as the WHEN subcommand, except that the comparison parameters (comparisontypetext or CHANGE) are not used. See the WHEN parameters starting with BEFORE for a description of the parameters.
If the OTHERWISE subcommand is not used within the sequence, no action is taken. This is the same as if an OTHERWISE NULL NULL had been entered.
Note: OTHERWISE is not executed if any part of the comparison field specified by the combination of START and LENGTH is outside the boundaries of the data record.