DCL SPCPTR NUMOPTS@ INIT(NUMOPTS);

DCL OL QPRCRTPGOL (USRSPC, BINOFFSET@, PGM@, PGMTXT@, PGMSRCF@,￿

PGMSRCM@, PGMSRCCHG@, PRTFNAM@, PRTSTRPAG@,

PGMPUBAUT@, PGMOPTS@, NUMOPTS@) ARG;

DCL SYSPTR QPRCRTPG INIT("QPRCRTPG", CTX("QSYS"), TYPE(PGM))￿;

/\ Start of instruction stream

\/

STPLLEN NUM_PARMS;

CMPNV(B) NUM_PARMS, 2 / EQ(PARM2);

CPYBLAP FILNAM, 'MISRC', ' ';

B PARM1;

PARM2: CPYBLA FILNAM, FIL;

PARM1: CPYBLA MBRNAM,MBR;

CMPBLA(B) READY, '1' / EQ(SKIP);

CPYBWP CONTEXT, QTEMP@;

CRTS USRSPC@, CRTSTMPLT@;

SETSPPFP USRSPC,USRSPC@;

CPYBLA READY, '1';

SKIP: CPYNV RECNUM, 1;

MORE: CALLX QCMDEXC, QCMDOVROL, \;

CPYNV OFFSET,1;

CALLX CLð6, CLð6OL, \;

SUBN(S) OFFSET, 1;

ADDN(S) BINOFFSET, OFFSET;

SETSPPO USRSPC, BINOFFSET;

ADDN(S) RECNUM, 2ð;

CALLX QCMDEXC, QCMDDLTOL, \;

CMPNV(B) OFFSET, 16ðð /EQ(MORE);

CPYBLA PGMNAM, MBR;

SETSPPO USRSPC, ð;

CALLX QPRCRTPG, QPRCRTPGOL, \;

RTX \;

PEND;

Updated CL06 Program

Following is the updated CL06 program:

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\

 

\/

/\

Program Name: CLð6

\/

/\

 

\/

/\

Programming Language: CL

\/

/\

 

\/

/\

Description: Load a source physical file member into the

\/

/\

\USRSPC addressed by &BUFFER.

\/

/\

 

\/

/\

 

\/

/\

Header Files Included: None

\/

/\

 

\/

/\

 

\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

 

PGM

PARM(&BUFFER &OFFSET)

 

DCLF

FILE(MISRC)

 

DCL

VAR(&BUFFER) TYPE(\CHAR) LEN(16ðð)

 

DCL

VAR(&OFFSET) TYPE(\DEC) LEN(15 5)

LOOP:

RCVF

 

7-26System API Programming V4R1

Page 166
Image 166
IBM Version 4 Updated CL06 Program, Following is the updated CL06 program, PGM PARM&BUFFER &OFFSET Dclf Filemisrc DCL