CARD NUMBERS

<< Click to Display Table of Contents >>

Navigation:  Reference > Commands >

CARD NUMBERS

The form of the CARD NUMBERS command is:

CARD NUMBERS n[, ... n] IN COLUMNS col[, col],

CARD NUMBERS /n/[, ... /n/],

The second form is used to allocate buffers when using READ commands.

Each number n may be surrounded with parentheses (n) or slashes /n/.

The CARD NUMBERS command may only appear once, in the Data Stage after START DATA and before the first executable command. It is non-executable and is used to define the structure of the input data record to CL. It also invokes the automatic unloading feature unless READ is used.

The numbers define the valid card types. They may be between 1 and 999. The column numbers specify where on each card the card type identifier is to be found.

If n is enclosed in parentheses, it indicates that a card with that number may or may not be present in each record (optional).

If n is enclosed in slashes, it indicates that a card with that number may not be present in the (input) record, but may be used in the CL script.

If there are no parentheses or slashes, it indicates that there must be one (and only one) card with that number in each record.

If a number is not in the list, it indicates that there must not be a card of that number in the set, and that this buffer may not be referred to.

If two data locations are used, they need not occur sequentially on the card.

If the CARD NUMBERS command is used, there must also be a SERIAL NUMBER or SERIAL IDENTIFIER command. If there are READ commands in the CL script, all the card numbers should be enclosed in slashes.

On executing the START DATA command, the program reads cards from the data input file until a new serial number or identifier is encountered. For each card read, the program scans the data locations identified in the CARD NUMBERS command and checks the number coded there against the list of valid numbers. If it is one of the set, the card is automatically unloaded into the appropriate buffer.

If it is not one of the set (or if the codes do not make up a valid number - contain V or X punches, multi-punches or blank), then the message INVALID CARD NUMBER is written to the Report file, and the variable $XIERR is stepped up by one (as if EL (edit and list) had been executed).

If two cards of the same type are found within a record, the message DUPLICATE CARD TYPE occurs and $XIERR is incremented.

When a new record (change of serial number) is found, the program stops reading cards and checks that all the fixed (not optional) cards are present in the record just read. For any that are missing, it puts out the message MISSING CARD TYPE and increments $XIERR.

For all error messages, the card number, serial number and position on the file are printed.

If cards have non-numeric identifiers, or there may be more than one card of a given type in a record (trailer cards), then the buffers to be used should be specified in slashes, and READ commands should be used.

If the input data is not punched-card images, then the CARD CHARACTERS BINARY command should be used. You may not have CARD NUMBERS and CARD CHARACTERS commands in the same CL script

Examples of CARD NUMBER commands:

card numbers 1,2 in column 1,

card numbers 1, 2, (3), (4), (5) in column 80,

card numbers 3,(7),(17),/35/ in columns 41,45,

card numbers /1/,/2/,/3/,/4/,/11/,