SERIAL

<< Click to Display Table of Contents >>

Navigation:  Reference > Commands >

SERIAL

The SERIAL command is as follows:

SERIAL NUMBER,

SERIAL NUMBER IN field,

SERIAL NUMBER IN COLUMNS col - col,

SERIAL IDENTIFIER IN field,

SERIAL IDENTIFIER IN COLUMNS col - col,

The first one above is only used with RCP CSVDATA to tell the program that the CSV data file has a serial number column headed SERIAL or IOBS that contains the serial numbers.

Note that a $ is optional before the column numbers in a serial command.

The SERIAL command may appear only once, in the Data Stage, after START DATA and before the first executable command. It is non-executable and serves to inform CL where the serial number is located on the input data records. Defining a serial field is optional, unless a CARD NUMBERS command is present or the EREC parameter is used on a READ command.

IMPORTANT: if the serial number is above 80 the CARD CHARACTERS command must appear before the SERIAL command.

There may be up to 15 data locations specified in a SERIAL NUMBER and up to 25 in a SERIAL IDENTIFIER.

Using a serial number defines a logical record for the purposes of automatic data reading or for use with the parameter EREC on the READ command. A logical record is taken to be a sequence of records all having the same serial number.

Note that serial numbers containing V and X punches,  or any multi-punches are regarded in CL as serial identifiers, and the SERIAL IDENTIFIER command must be used. SERIAL NUMBER and SERIAL IDENTIFIER commands cannot appear in the same CL script.

TIP: Serial numbers may contain leading or trailing blanks.

If the SERIAL NUMBER command is present, the ivar $IOBS is set automatically to the number found in the specified data locations. If the SERIAL NUMBER command is not present, $IOBS is not available. $IOBS behaves in all ways as a normal ivar, and is saved and can be referenced in the Tables Stage.

When using the SERIAL NUMBER command, if a card is read that does not contain a valid integer number in the specified data locations (if it contains V or X codes, or multi-codes) then the card is rejected. The message FAULTY SERIAL NUMBER together with a representation of the record (invalid multi-codes interpreted as the character "?") are written to the Report file.

Examples of SERIAL commands:

serial number in $5-7,

serial identifier in $1-5,