Appendix F. Batch Application Program Interface (API) 637
1st ed., 6/30/04 - 312579601
MVC WKFLATDD(KFLATDDL),KFLATDD Initialize the working
LA R4,WKFLATDD storage version of the DCB from the
OPEN ((R4),(OUTPUT)) copy in the constants area.
*
* Use QCDS OPEN to automatically allocate the current primary CDS
* and open the VTV record area:
*
OPENVOL DS 0H Open CDS VTV record area:
SLSUREQ QCDS, +
REQUEST=OPEN, +
DDNAME==CL8'CDS1', +
TYPE=VTV, +
TOKEN=WKTOK, +
UCALADR=WKUCAL, +
MF=(E,WKQCDS)
C R15,=A(SLUROPOK) Check for OPEN failure
BNE OPENERR Handle OPEN error
*
* Allocate response area buffer and map the response area:
*
L R0,QCDSBLEN Load response area buffer length
GETMAIN R,LV=(0) Request storage
ST R1,WKBUFP Store pointer to response area
LR R10,R1 Load pointer to response area
USING SLUR,R10 Map QCDS READ response area
*
* Outer loop - read CDS VTV record area in blocks:
*
READVOL DS 0H Read block of VTV records:
SLSUREQ QCDS, +
REQUEST=READ, +
DDNAME==CL8'CDS1', +
TYPE=VTV, +
BUFFER=WKBUFP, +
BUFLEN=QCDSBLEN, +
TOKEN=WKTOK, +
UCALADR=WKUCAL, +
MF=(E,WKQCDS)
ST R15,WKRDRC Save READ return code
C R15,=A(SLURRDEA) Check for READ failure
BH READERR Handle READ error
L R9,SLURQCDN Get number of VTV records
* present in this reply
L R7,SLURQCDO Offset to first VTV record
LA R8,SLURRPLY(R7) Pointer to first VTV record
USING SLUVTDAT,R8 Map VTV record
*
Figure 33. Sample 1 - Automatic CDS Allocation
(2 of 4)