以下是DISPLAY FILE 代码:
A*%%TS SD 20090521 122245 ITJLLI REL-V5R3M0 5722-WDS
A*%%EC
A DSPSIZ(24 80 *DS3)
A PRINT
A CF03(03 'EXIT')
A******************************************************************
A R DSPR1
A*%%TS SD 20090521 122245 ITJLLI REL-V5R3M0 5722-WDS
A OVERLAY
A PUTOVR
A BLINK
A TEXT('Single Screen')
A 1 2'FIND'
A MSGFLD0001 40A O 1 20MSGID(L01 9301 SSAZ03)
A COLOR(WHT)
A WSID 10A O 1 62
A 1 73DATE
A EDTCDE(Y)
A 2 2'SCRN-1'
A 2 21'Find File Or Program Which Program-
A Use'
A COLOR(BLU)
A 2 62USER
A 2 73TIME
A 8 8'Find Strings :'
A FINDF 10A B 8 26
A 10 8'Find Library :'
A FINDL 10A B 10 26
A 23 2'F3=Exit'
A COLOR(BLU)
A 23 12'Enter =Process'
A COLOR(BLU)
以下是CLP 代码:
/*********************************************************************/
/* COPYRIGHT SYSTEM SOFTWARE ASSOCIATES,INC. CHICAGO,ILL. 1993 */
/*********************************************************************/
/* */
/* Program Id - Find */
/* Program Name - Find File Or Program Which Program Use In The Input*/
/* Library */
/* Author - MarkLi */
/* */
/* Bmr Date Description */
/* ---- ------- ----------------------------------------------- */
/*********************************************************************/
PGM
DCLF FILE(FINDFM)
DCLF FILE(ITJLLI/PGMOBJ) OPNID(A)
DCL VAR(&WSID) TYPE(*CHAR) LEN(10)
DCL VAR(&USER) TYPE(*CHAR) LEN(10)
DCL VAR(&JBNR) TYPE(*CHAR) LEN(10)
DCL VAR(&PGMNAME) TYPE(*CHAR) LEN(10) /*OBJ NAME*/
DCL VAR(&PGMLIB) TYPE(*CHAR) LEN(10) /*OBJ LIBL*/
DCL VAR(&FINDF) TYPE(*CHAR) LEN(10) /*FIND FILE*/
DCL VAR(&FINDL) TYPE(*CHAR) LEN(10) /*FIND LIB*/
RTVJOBA JOB(&WSID) USER(&USER) NBR(&JBNR)
DISPLAY:
SNDRCVF RCDFMT(DSPR1)
RMVMSG PGMQ(*SAME) CLEAR(*ALL)
/* Cmd-3 pressed = end program */
/* Find file eq *blanks = end program */
/* Find library eq *blanks = end program */
IF COND(&IN03 *EQ '1') THEN(DO)
SNDPGMMSG MSG('Program End')
GOTO EPGM
ENDDO
IF COND(&FINDF *EQ ' ') THEN(DO)
SNDPGMMSG MSG('The Find File Can''t Be Blanks!')
GOTO EPGM
ENDDO
IF COND(&FINDL *EQ ' ') THEN(DO)
SNDPGMMSG MSG('The Find Library Can''t Be Blanks!')
GOTO EPGM
ENDDO
IF COND(&FINDL *NE ' ') THEN(DO)
CHKOBJ OBJ(&FINDL) OBJTYPE(*LIB)
MONMSG MSGID(CPF9801) EXEC(GOTO EPGM)
ENDDO
/* Process Program */
CLRPFM FILE(ITJLLI/PGMOBJ)
DSPOBJD OBJ(&FINDL/*ALL) OBJTYPE(*PGM) +
OUTPUT(*OUTFILE) OUTFILE(ITJLLI/PGMOBJ)
MONMSG MSGID(CPF2123) EXEC(GOTO EPGM)
CLRPFM FILE(ITJLLI/PGMOBJD)
LOOPREAD: RCVF OPNID(A)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(EOF))
CHGVAR VAR(&PGMNAME) VALUE(&A_ODOBNM)
CHGVAR VAR(&PGMLIB) VALUE(&A_ODLBNM)
DSPPGMREF PGM(&PGMLIB/&PGMNAME) OUTPUT(*OUTFILE) +
OUTFILE(ITJLLI/PGMOBJD) OUTMBR(*FIRST *ADD)
GOTO CMDLBL(LOOPREAD)
EOF: CALL PGM(FIND01) PARM(&FINDF)
EPGM: ENDPGM
以下是一个子过程文件代码:
F***************************************************************
F* PROGRAM I.D. : FIND01
F* PROGRAM DESCRIPTION : FIND FILE OR PROGRAM WHICH PROGRAM USE
F* WRITED BY : MARK LI
F* DATE :
F*
F* MOD# Date Description
F* ------- --------- ------------------------------------------
F***************************************************************
FPGMOBJD UF E K DISK
F***************************************************************
I*
I*
C*****************************************************************
C*
C *ENTRY PLIST
C PARM FILEN 10
C*****************************************************************
C*
C READ PGMOBJD 51
C *IN51 DOWEQ*OFF
C*
C WHFNAM IFNE FILEN
C DELETQWHDRPPR
C CLEARQWHDRPPR
C ENDIF
C*
C READ PGMOBJD 51
C ENDDO
C*
C SETON LR
C*
通过运行以上的程式FIND之后,可以到ITJLLI/PGMOBJD这个表里查找即可得到想要的程式名称。
阅读(1087) | 评论(2) | 转发(0) |