Example 1—Moving Data from a Field to a Buffer
Moving data from a work field to a dummy input buffer:
The following code:
INPUT 200 F 200 REC NAME 5 25 INPUT 20 F 20 MB=D REC RECEIVE 1 20 09OUT 60 093CULLUS45 090 SEND 'WORK FIELD DATA' 0951*010 NAME 0951*020 RECEIVE 097030 CALL US45 (SEND RECEIVE 15 20 ' ')
REPORT NO. 09 CULLUS45 mm/dd/yy PAGE 1 TERRY JANENS WORK FIELD DATA JOE NGUYA WORK FIELD DATA MARK TIME WORK FIELD DATA ROGER WILCO WORK FIELD DATA ALBERT BREEZE WORK FIELD DATA CAROLYN CROW WORK FIELD DATA BURT LANCHESTER WORK FIELD DATA
Example 2—Multiple Moves with Trailers
This example moves a variable portion of an input record into a series of work fields and a dummy input buffer area.
The following code:
Trailers following the names and addresses are identified by one of ten possible 1-byte codes located in the first byte of the trailer.
INPUT 400 F 800 REC TLEN 10 2 1 $Trailer length REC L1 12 1 1 $Length of name and address trailer 1 REC L2 13 1 1 $Length of name and address trailer 2 REC L3 14 1 1 $Length of name and address trailer 3 REC TSTART 100 1 $Trailers start here INPUT 100 MB=D REC TRAILER 1 100 $Trailers are deblocked to this location REC TRAILER-ID 1 1 $Reference for trailer-id GW0 NULL '¢¢¢¢' $Tells CULLUS 45 to use saved internal value GW0 IX $Used as the index for the table search GW0 IXLIM 10 $10 table entries GW0 BYTES-MVD 0 $Keeps track of the number of bytes moved GW0 WORK 0 $Sending length GW0 NAWORK1 ' ' $5 GW0 NAWORK2 ' ' $ work areas GW0 NAWORK3 ' ' $ for GW0 KEY.10 '0' '1' '2' '3' '4' '5' '6' '7' '8' '9' $Trailer-ids GW0 VAL.10 23 20 28 19 32 99 17 6 12 14 $Trailer lengths 017002 M O BYTES-MVD $Initialize 017030 M L1 WORK $Amount to send 017050 CALL US45 (TSTART NAWORK1 WORK 25 ' ') $Move 017070 M L2 WORK $Amount to send 017090 CALL US45 (NULL NULL WORK 25 ' ') $Move 017100 M L3 WORK $Amount to send 017130 CALL US45 (NULL NULL WORK 25 ' ') $Move 017220 COMPUTE L1 + L2 + L3 BYTES-MVD $ Set 'BYTES-MVD' 017325 CALL US45 (NULL TRAILER 1 1) $Move 017333 COMPUTE BYTES-MVD + 1 BYTES-MVD $ Adjust 'BYTES-MVD' 017345 M 1 IX $Initialize 'IX' 017350 IF KEY.IX = TRAILER-ID 375 $Branch on a hit 017355 IF IX = IXLIM 901 $Go abend 017360 COMPUTE IX + 1 IX $Increment 'IX' 017365 B 350 $Loop 017375 COMPUTE BYTES-MVD + VAL.IX BYTES-MVD $Set post-move value 017380 IF BYTES-MVD GT TLEN 901 $Error 017400 CALL US45 (NULL NULL VAL.IX 99 ' ') $Move 017412 $PROCESSING FOR THIS DEBLOCKED TRAILER GOES HERE 017415 IF BYTES-MVD LT TLEN 325 $Loop if not done 017420 IF BYTES-MVD = TLEN DROP $Drop if done 017901 CALL US99 $Abend
Copyright © 2014 CA.
All rights reserved.
|
|