<< Click to Display Table of Contents >> Navigation: User guide > Data > Unusual card identifiers |
If the card identifier is not numeric, or not in a fixed field, or there are more than 999 card types, you can inhibit the action of START DATA and read individual cards one at a time using the READ command, either directly into the required buffer, or into buffer 0. From there they can be moved to the appropriate buffer as required. The CARD NUMBERS command is used to define which data locations will be used, and a SERIAL command appears as before.
Note that you have the ability to trap the end of each questionnaire, to carry out end of record processing (using EREC). The flow of execution should take the program through FINISH DATA (and back to START DATA) at the end of each questionnaire. Execution terminates when a READ command is executed and there are no more cards to be read.
If we have a data file where each questionnaire uses two cards which have been coded as A and B in data location 80 and the sequence number is in data locations 4-10 and the sequence number contains leading blanks the following CL script could be used:
start control,
c=unusual.cba,
finish control,
start data,
serial identifier in 4-10,
card numbers /1/,/2/,
@cardin,
read $1-80 erec=@endrec,
if $80/'A', then,
d $101-180=$1-80,
goto @again,
endif,
if $80/'B', then,
d $201-280=$1-80,
goto @again,
endif,
l 'faulty record',
goto @again,
@endrec,
! card A is now in $101-180
! and card B is in $201-280
...
finish data,