In this example, a PUT macro is used to store twenty 100-byte records
in slots 5, 10, 15,...,100 of the data set. MODCB is used to switch
to direct processing, and PUT is used to store records in slots 26
and 51 of the data set.
OUTACB ACB MACRF=(SKP,OUT, x
. DIR,KEY)
.
GENCB BLK=RPL, Generate a request parameter list x
ACB=OUTACB, at execution time. x
AREA=WORK, x
AREALEN=100, x
ARG=RCDNO, x
OPTCD=(KEY,SKP)
LTR 15,15
BNZ GENFAIL
LR 5,0 Save length of RPL.
LR 6,1 Save address of RPL.
LA 7,5 Initialize increment value.
ST 7,RCDNO Initialize argument to slot 5.
LA 10,20 Initialize loop counter.
LOOP ... Move new record into work.
PUT RPL=(6) Store record.
LTR 15,15
BNZ PUTERR Request was not accepted, or failed.
L 1,RCDNO
AR 1,7
ST 1,RCDNO Increment argument by 5.
BCT 10,LOOP
MODCB RPL=(6), Switch to direct processing to store x
OPTCD=(DIR,KEY) records in slots 51 and 26.
LTR 15,15
BNZ GENFAIL
LA 7,51
ST 7,RCDNO Initialize argument to slot 51.
... Move new record into WORK.
PUT RPL=(6) Store record in slot 51.
LTR 15,15
BNZ PUTERR Request was not accepted, or failed.
LA 7,26
ST 7,RCDNO Initialize argument to slot 26.
... Move new record into WORK.
...
PUT RPL=(6) Store record in slot 26.
LTR 15,15
BNZ PUTERR Request was not accepted, or failed.
B RETURN
GENFAIL ... Generation or modification failed.
PUTERR ... PUT request was not accepted, or failed.
RETURN ... Terminate program.
WORK DS CL100 100-byte work area that contains x
record to be stored by PUT macro.
RCDNO DS CL4 4-byte relative record number.
Both skip-sequential and direct processing can be used to allocate
a fixed-length RRDS. The ACB is opened for output. The 4-byte search argument
(RCDNO) indicates the slot number where the record is to be stored.