Chinaunix首页 | 论坛 | 博客
  • 博客访问: 65570
  • 博文数量: 11
  • 博客积分: 1455
  • 博客等级: 上尉
  • 技术积分: 225
  • 用 户 组: 普通用户
  • 注册时间: 2008-01-10 12:28
文章分类

全部博文(11)

文章存档

2018年(1)

2012年(1)

2011年(5)

2009年(1)

2008年(3)

我的朋友
最近访客

分类:

2009-05-22 13:50:54

以下是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这个表里查找即可得到想要的程式名称。
 
 
 
 
 
 
 
阅读(1023) | 评论(2) | 转发(0) |
0

上一篇:IBM AS/400技术手册目录

下一篇:SQL

给主人留下些什么吧!~~

goodbilly2009-12-13 23:26:23

你要修改自己的LIBL和表名呀.这里的LIBL和表是我自己的..

chinaunix网友2009-10-15 16:58:52

DCLF FILE(ITJLLI/PGMOBJ) OPNID(A) RCVF OPNID(A) Those two will cause errors