System i Blogger

Jan 9 2009   5:14PM GMT

CL – To get record count for all the Physical Files (PF) in a library

David Vasta David Vasta Profile: David Vasta

CLLE – To get record count for all the PF’s in library
Posted By: Nanda Kishore Perisetla Contact

  START:      PGM        PARM(&LIB)
             DCL        VAR(&LIB) TYPE(*CHAR) LEN(10)
             DCL        VAR(&PGM) TYPE(*CHAR) LEN(10)
             DCL        VAR(&CNT) TYPE(*DEC) LEN(10)
             DCLF       FILE(CNTFILE)
             DLTF       FILE(QTEMP/COUNTF)
             MONMSG     MSGID(CPF0000)
             DLTF       FILE(QTEMP/RECCNT)
             MONMSG     MSGID(CPF0000)
             CRTPF      FILE(QTEMP/COUNTF) LVLCHK(*NO)
             MONMSG     MSGID(CPF7302)
             DSPOBJD    OBJ(&LIB/*ALL) OBJTYPE(*FILE) DETAIL(*FULL) +
                          OUTPUT(*OUTFILE) OUTFILE(QTEMP/CNTFILE)
             MONMSG     MSGID(CPF0000) EXEC(GOTO CMDLBL(EOF))
 LOOP:       RCVF
             MONMSG     MSGID(CPF0864) EXEC(GOTO CMDLBL(EOF))
             OVRDBF     FILE(RECCNT) SHARE(*YES)
             IF         COND((&ODOBAT *EQ 'PF') *OR (&ODOBAT *EQ +
                          'PF38')) THEN(DO)
             DSPFD      FILE(&LIB/&ODOBNM) TYPE(*MBR) +
                          OUTPUT(*OUTFILE) FILEATR(*ALL) +
                          OUTFILE(QTEMP/RECCNT) OUTMBR(*FIRST *ADD)
             MONMSG     MSGID(CPF9999) EXEC(GOTO CMDLBL(EOF))
             ENDDO
             GOTO LOOP
 EOF:        DLTOVR     FILE(RECCNT)
             CALL       PGM(*LIBL/RCDCNTRPG)
 END:        ENDPGM
 

This bit of CL s very useful and is a good example.

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: