Retrieve Subsystem Information
PGM PARM(&SBS &LIB)
DCL &NBR *CHAR 4
DCL &TOT *CHAR 4
DCL &SBS *CHAR 10
DCL &LIB *CHAR 10
DCL &LEN *CHAR 4
DCL &ACT *CHAR 10
DCL &SPACE *CHAR 100
DCL &SBSLIB *CHAR 20
DCL &ERROR *CHAR 8 (X'0000000000000000')
CHGVAR %SST(&SBSLIB 1 10) &SBS
CHGVAR %SST(&SBSLIB 11 10) &LIB
CHGVAR VAR(%BIN(&LEN)) VALUE('100')
CALL PGM(QWDRSBSD) PARM(&SPACE &LEN SBSI0100 +
&SBSLIB &ERROR)
CHGVAR VAR(&NBR) VALUE(%SST(&SPACE 73 4))
CHGVAR VAR(&TOT) VALUE(%BIN(&NBR))
CHGVAR VAR(&ACT) VALUE(%SST(&SPACE 29 10))
SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('The +
number of jobs active in ' || &SBS *BCAT +
'is ' || &TOT || ' & the sbs is ' || &ACT)
END: ENDPGM
CMD PROMPT('Number of Jobs in Subsystem')
PARM KWD(SBSNAME) TYPE(*CHAR) LEN(10) MIN(1) +
PROMPT('Subsystem Name')
PARM KWD(LIBRARY) TYPE(*CHAR) LEN(10) DFT(*LIBL) +
PROMPT('Library Name')
Another example
DCL VAR(&RCVDTA) TYPE(*CHAR) LEN(360)
DCL VAR(&RCVLEN) TYPE(*DEC) LEN(3 0) VALUE(360)
DCL VAR(&RCVLENB) TYPE(*CHAR) LEN(4)
DCL VAR(&FMTNAM) TYPE(*CHAR) LEN(8) VALUE('SBSI0100')
DCL VAR(&JOBCNT#) TYPE(*DEC) LEN(3 0)
DCL VAR(&RTVSBS) TYPE(*CHAR) LEN(20) +
VALUE('SBSNAME SBSLIB')
DCL VAR(&ERRCOD) TYPE(*CHAR)
CHGVAR VAR(%BIN(&RCVLENB)) VALUE(&RCVLEN)
/* Retrieve subsystem information */
CALL PGM(QWDRSBSD) PARM( &RCVDTA +
&RCVLENB +
&FMTNAM +
&RTVSBS +
&ERRCOD )
IF COND(%SST(&RCVDTA 29 10) = '*ACTIVE ') THEN(DO)
CHGVAR VAR(&JOBCNT#) VALUE(%BIN(&RCVDTA 73 4))
ENDDO
Thanks to Jon Erickson
阅读(1529) | 评论(0) | 转发(0) |