Problem solve Get help with specific problems with your technologies, process and projects.

A new and improved find command

I have developed over the years a scan command that scans source files. Not only does this command give what I believe is a better and more readable printout than the FNDSTRPDM command because it highlights the found scan strings, but it also has other very unique features. With this scan you can not only find one string, but you can find two strings on the same line of code. An example might be to search for a particular filename AND a "F" in position 6. This would give me all the RPG programs with the filename in file specifications. But it doesn't stop there. I can scan all programs for a particular filename AND NOT having the string "F" in position 6. This would give all programs with my filename string in it, but it will NOT include file specifications. Pretty slick! It can also search for one string OR another. An example of this would be to scan for programs with either of two fields on the same line, two filename search at the same time!. Check it out, I think you'll like it.


000100              CMD        PROMPT('SCAN SOURCE FILES')
000200 /************************      SCAN        ***************************/
000300 /*  SCAN SOURCE FILES                                                */
000400 /*  COMMAND PROCESSING PROGRAM IS SCANCL                             */
000500 /*  WRITTEN      - 06/09/93                                          */
000600 /*  AUTHOR       - LARRY B. PEPIN                                    */
000700 /*                                                                   */
000800 /*----------------------- MODIFICATIONS -----------------------------*/
000900 /*  BY-------   DATE----   DESCRIPTION-------------------------------*/
001000 /*  XXXXXXXXX   XX/XX/XX   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
001100 /*                                                                   */
001200 /*********************************************************************/
001300
001400              PARM       KWD(SCAN1) TYPE(*CHAR) LEN(20) MIN(1) +
001500                           PROMPT('SCAN FOR . . . . . . . . . . ')
001600
001700              PARM       KWD(SRCFILE) TYPE(SRCFILE) +
001800                           PROMPT('SOURCE FILE NAME . . . . . . .')
001900
002000              PARM       KWD(UPPERCASE) TYPE(*CHAR) LEN(1) RSTD(*YES) +
002100                           DFT(Y) VALUES(Y N) PROMPT('IGNORE CASE +
002200                           (Y,N) . . . . . .')
002300
002400              PARM       KWD(FROMCOL1) TYPE(*DEC) LEN(2) DFT(01) +
002500                           RANGE(01 &TOCOL1) PROMPT('FROM COLUMN. . +
002600                           .  . . . . . .')
002700
002800              PARM       KWD(TOCOL1) TYPE(*DEC) LEN(2) DFT(92) +
002900                           RANGE(01 92) PROMPT('TO COLUMN . . +
003000                           . . . . . . . .')
003100
003200              PARM       KWD(ANDOR) TYPE(*CHAR) LEN(5) RSTD(*YES) +
003300                           DFT(*NONE) VALUES(*NONE *AND *OR) +
003400                           PROMPT('AND/OR . . . . . . . . . . . ')
003500
003600              PARM       KWD(CONDITION) TYPE(*CHAR) LEN(3) RSTD(*YES) +
003700                           DFT(*EQ) PMTCTL(PC1) VALUES(*EQ *NE) +
003800                           PROMPT('CONDITION . . . . . . . . . .')
003900
004000              PARM       KWD(SCAN2) TYPE(*CHAR) LEN(20) PMTCTL(PC1) +
004100                           PROMPT('SCAN FOR . . . . . . . . . . ')
004200
004300              PARM       KWD(FROMCOL2) TYPE(*DEC) LEN(2) DFT(01) +
004400                           RANGE(01 &TOCOL2) PMTCTL(PC1) +
004500                           PROMPT('FROM COLUMN. . .  . . . . . .')
004600
004700              PARM       KWD(TOCOL2) TYPE(*DEC) LEN(2) DFT(92) +
004800                           RANGE(01 92) PMTCTL(PC1) PROMPT('TO +
004900                           COLUMN . . . . . . . . . .')
005000
005100  SRCFILE:    QUAL       TYPE(*NAME) DFT(QRPGSRC) MIN(0) EXPR(*YES)
005200              QUAL       TYPE(*NAME) DFT(yourlib) SPCVAL((*LIBL) +
005300                           (*CURLIB)) EXPR(*YES) PROMPT('LIBRARY +
005400                           NAME . . . . . . . . .')
005500
005600  PC1:        PMTCTL     CTL(ANDOR) COND((*NE '*NONE'))

********************************************************************************
********************************************************************************

000100              PGM        PARM(&FIND1 &FILIBR &UPPERCASE &FPOSITION1 +
000200                           &TPOSITION1 &ANDOR &CONDITION &FIND2 +
000300                           &FPOSITION2 &TPOSITION2)
000400 /************************     SCANCL       ***************************/
000500 /*  DISPLAY FILE SPECIFICATIONS                                      */
000600 /*                                                                   */
000700 /*  WRITTEN      - 06/09/93                                          */
000800 /*  AUTHOR       - LARRY B. PEPIN                                    */
000900 /*                                                                   */
001000 /*  PARMS RECEIVED                                                   */
001100 /*  &FILBR     - FILE NAME AND LIBRARY                               */
001200 /*  &FIND1     - SCAN FOR INFORMATION                                */
001300 /*  &UPPERCASE - UPPER CASE ONLY PROMPT                              */
001400 /*  &FPOSITION1- SEARCH FROM POSITION                                */
001500 /*  &TPOSITION1- SEARCH TO POSITION                                  */
001600 /*  &ANDOR     - AND / OR EXPRESSION                                 */
001700 /*  &CONDITION - CONDITION (*EQ *NE)                                 */
001800 /*  &FIND2     - SCAN FOR INFORMATION                                */
001900 /*  &FPOSITION2- SEARCH FROM COLUMN                                  */
002000 /*  &TPOSITION2- SEARCH TO COLUMN                                    */
002100 /*----------------------- MODIFICATIONS -----------------------------*/
002200 /*  BY-------   DATE----   DESCRIPTION-------------------------------*/
002300 /*  XXXXXXXXX   XX/XX/XX   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
002400 /*********************************************************************/
002500
002600              DCL        VAR(&ANDOR)      TYPE(*CHAR) LEN(5)
002700              DCL        VAR(&CONDITION)  TYPE(*CHAR) LEN(3)
002800              DCL        VAR(&FILE)       TYPE(*CHAR) LEN(10)
002900              DCL        VAR(&FILIBR)     TYPE(*CHAR) LEN(20)
003000              DCL        VAR(&FPOS1)      TYPE(*CHAR) LEN(2)
003100              DCL        VAR(&FPOS2)      TYPE(*CHAR) LEN(2)
003200              DCL        VAR(&FPOSITION2) TYPE(*DEC)  LEN(2 0)
003300              DCL        VAR(&FPOSITION1) TYPE(*DEC)  LEN(2 0)
003400              DCL        VAR(&JOBQ)       TYPE(*CHAR) LEN(1)
003500              DCL        VAR(&LIBR)       TYPE(*CHAR) LEN(10)
003600              DCL        VAR(&MSGDTA)     TYPE(*CHAR) LEN(46)
003700              DCL        VAR(&FIND1)      TYPE(*CHAR) LEN(20)
003800              DCL        VAR(&FIND2)      TYPE(*CHAR) LEN(20)
003900              DCL        VAR(&SRCFILE)    TYPE(*CHAR) LEN(10)
004000              DCL        VAR(&TPOS1)      TYPE(*CHAR) LEN(2)
004100              DCL        VAR(&TPOS2)      TYPE(*CHAR) LEN(2)
004200              DCL        VAR(&TPOSITION2) TYPE(*DEC)  LEN(2 0)
004300              DCL        VAR(&TPOSITION1) TYPE(*DEC)  LEN(2 0)
004400              DCL        VAR(&UPPERCASE)  TYPE(*CHAR) LEN(1)
004500
004600              IF         COND(&FIND1 *EQ ' ') THEN(RETURN)
004700
004800              CHGVAR     VAR(&SRCFILE)       VALUE(%SST(&FILIBR 01 10))
004900              CHGVAR     VAR(&LIBR)          VALUE(%SST(&FILIBR 11 10))
005000
005100              CHKOBJ     OBJ(&LIBR/&SRCFILE) OBJTYPE(*FILE)
005200              MONMSG     MSGID(CPF0000)      EXEC(DO)    /* ERROR */
005300              SNDPGMMSG  MSG('- Library and/or Source file ERROR -') +
005400                           MSGTYPE(*COMP)
005500              RETURN
005600              ENDDO
005700
005800              RTVJOBA    TYPE(&JOBQ)
005900              IF         COND(&JOBQ *EQ '0') THEN(GOTO CMDLBL(PROCESS))
006000
006100              CHGVAR     VAR(&FPOS1)        VALUE(&FPOSITION1)
006200              CHGVAR     VAR(&TPOS1)        VALUE(&TPOSITION1)
006300              CHGVAR     VAR(&FPOS2)        VALUE(&FPOSITION2)
006400              CHGVAR     VAR(&TPOS2)        VALUE(&TPOSITION2)
006500              CHGDTAARA  DTAARA(*LDA (1 2)) VALUE(&FPOS1)
006600              CHGDTAARA  DTAARA(*LDA (3 2)) VALUE(&TPOS1)
006700              CHGDTAARA  DTAARA(*LDA (5 2)) VALUE(&FPOS2)
006800              CHGDTAARA  DTAARA(*LDA (7 2)) VALUE(&TPOS2)
006900
007000              SBMJOB     CMD(CALL PGM(*LIBL/SCANCL) PARM(&FIND1 +
007100                           &FILIBR &UPPERCASE &FPOSITION1 +
007200                           &TPOSITION1 &ANDOR &CONDITION &FIND2 +
007300                           &FPOSITION2 &TPOSITION2)) JOB(SCANCL) +
007400                           JOBQ(QPGMR)
007500              RCVMSG     MSGDTA(&MSGDTA)
007600              SNDPGMMSG  MSGID(CPC1221) MSGF(QCPFMSG) MSGDTA(&MSGDTA)
007700              RETURN
007800
007900 PROCESS:     RTVDTAARA  DTAARA(*LDA (1 2)) RTNVAR(&FPOS1)
008000              RTVDTAARA  DTAARA(*LDA (3 2)) RTNVAR(&TPOS1)
008100              RTVDTAARA  DTAARA(*LDA (5 2)) RTNVAR(&FPOS2)
008200              RTVDTAARA  DTAARA(*LDA (7 2)) RTNVAR(&TPOS2)
008300
008400              OVRDBF     FILE(QTXTSRC)  TOFILE(&LIBR/&SRCFILE) MBR(*ALL)
008500              OVRPRTF    FILE(SCANPRTF) TOFILE(SCANPRTF) DEV(*JOB)
008600              CALL       PGM(SCANRPG) PARM(&FILIBR &FIND1 &UPPERCASE +
008700                           &FPOS1 &TPOS1 &ANDOR &CONDITION +
008800                           &FIND2 &FPOS2 &TPOS2)
008900
009000              RETURN
009100
009200              ENDPGM

******************************************************************************
******************************************************************************

000100              PGM        PARM(&OBJECT &LIBRARY &TEXT)
000200 /************************     SCANNCL      ***************************/
000300 /*  SCAN SOURCE FILES - GET OBJECT TEXT                              */
000400 /*                                                                   */
000500 /*  WRITTEN      - 06/09/93                                          */
000600 /*  AUTHOR       - LARRY B. PEPIN                                    */
000700 /*                                                                   */
000800 /*  PARMS RECEIVED                                                   */
000900 /*  &OBJECT    -  OBJECT NAME                                        */
001000 /*  &LIBRARY   -  LIBRARY NAME                                       */
001100 /*  &TEXT      -  TEXT DESCRIPTION                                   */
001200 /*----------------------- MODIFICATIONS -----------------------------*/
001300 /*  BY-------   DATE----   DESCRIPTION-------------------------------*/
001400 /*  XXXXXXXXX   XX/XX/XX   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
001500 /*********************************************************************/
001600
001700              DCL        VAR(&BLANKS)    TYPE(*CHAR) LEN(50)
001800              DCL        VAR(&OBJECT)    TYPE(*CHAR) LEN(10)
001900              DCL        VAR(&LIBRARY)   TYPE(*CHAR) LEN(10)
002000              DCL        VAR(&TEXT)      TYPE(*CHAR) LEN(50)
002100
002200              RTVOBJD    OBJ(&LIBRARY/&OBJECT) OBJTYPE(*PGM) +
002300                           TEXT(&TEXT)
002400              MONMSG     MSGID(CPF0000) EXEC(GOTO CMDLBL(MENU))
002500              GOTO       CMDLBL(CHECKTEXT)
002600              RETURN
002700
002800  MENU:       RTVOBJD    OBJ(&LIBRARY/&OBJECT) OBJTYPE(*MENU) +
002900                           TEXT(&TEXT)
003000              MONMSG     MSGID(CPF0000) EXEC(GOTO CMDLBL(FILE))
003100              GOTO       CMDLBL(CHECKTEXT)
003200              RETURN
003300
003400  FILE:       RTVOBJD    OBJ(&LIBRARY/&OBJECT) OBJTYPE(*FILE) +
003500                           TEXT(&TEXT)
003600              MONMSG     MSGID(CPF0000) EXEC(GOTO CMDLBL(MSGF))
003700              GOTO       CMDLBL(CHECKTEXT)
003800              RETURN
003900
004000  MSGF:       RTVOBJD    OBJ(&LIBRARY/&OBJECT) OBJTYPE(*MSGF) +
004100                           TEXT(&TEXT)
004200              MONMSG     MSGID(CPF0000) EXEC(GOTO CMDLBL(RETRN))
004300
004400  CHECKTEXT:
004500              IF         COND(&TEXT *EQ &BLANKS) THEN(CHGVAR +
004600                           VAR(&TEXT) VALUE('NO TEXT GIVEN FOR +
004700                           OBJECT                          '))
004800
004900  RETRN:      RETURN
005000
005100              ENDPGM

***************************************************************************
***************************************************************************

000100      A**************************************************************
000200      A*         SCANPRNT - SCAN SOURCE PRINT FILE
000300      A**************************************************************
000400      A          R HEAD01                    SKIPB(1)
000500      A                                     1'SCANRPG'
000600      A                                    18DATE EDTCDE(Y)
000700      A                                    54'SCAN SOURCE FILES'
000800      A                                   122'PAGE:'
000900      A                                   127PAGNBR EDTCDE(J)
001000      A                                      SPACEA(1)
001100      A*
001200      A                                    51'SOURCE FILE AND LIBRARY'
001300      A                                      SPACEA(1)
001400      A*
001500      A            FILIBR        20        53
001600      A                                      SPACEA(1)
001700      A*
001800      A                                    55'SEARCH FIELD'
001900      A                                      SPACEA(1)
002000      A*
002100      A            PRTFD1        20        56
002200      A                                      HIGHLIGHT
002300      A                                    78'FROM-'
002400      A            FPOS1          2        83
002500      A                                      HIGHLIGHT
002600      A                                    86'TO-'
002700      A            TPOS1          2        89
002800      A                                      HIGHLIGHT
002900      A                                      SPACEA(1)
003000      A*
003100      A          R HEAD02
003200      A            ANDOR          5        45
003300      A                                      HIGHLIGHT
003400      A            COND           3        51
003500      A                                      HIGHLIGHT
003600      A            PRTFD2        20        56
003700      A                                      HIGHLIGHT
003800      A                                    78'FROM-'
003900      A            FPOS2          2        83
004000      A                                      HIGHLIGHT
004100      A                                    86'TO-'
004200      A            TPOS2          2        89
004300      A                                      HIGHLIGHT
004400      A                                      SPACEA(1)
004500       *
004600      A          R SPACE
004700      A                                     1' '
004800      A                                      SPACEA(1)
004900      A*
005000      A          R HEAD03
005100      A                                     1'MEMBER'
005200      A                                    12'TEXT'
005300      A                                    46'RECNBR'
005400      A                                    82'DATA'
005500      A                                      SPACEA(1)
005600       *
005700      A          R DETAIL
005800      A                                      SPACEB(0)
005900      A            PRTMBR        10         1
006000      A            PRTDTA        80        53
006100      A            RECNBR         5  0     47
006200      A            PRTTXT        34        12
006300      A                                      SPACEA(0)
006400       *
006500      A          R HILITE
006600      A                                      SPACEB(0)
006700      A            DB1HLT        80        53
006800      A                                      HIGHLIGHT
006900      A            DB2HLT        80        53
007000      A                                      HIGHLIGHT
007100      A                                      SPACEA(1)
007200       *
007300      A          R LRPRT
007400      A                                      SPACEB(2)
007500      A                                     1'MEMBER COUNT - '
007600      A            MBRCNT         4  0     16
007700      A                                    25'LINE COUNT - '
007800      A            LINCNT         4  0     38
007900      A                                      SPACEA(0)
008000       *

********************************************************************************
********************************************************************************

000100      H
000200       *******************************************************************
000300       *                                                                 *
000400       *               SCAN SOURCE FILES  -  SCANRPG                     *
000500       *                                                                 *
000600       *   06/09/93                     LARRY B. PEPIN                   *
000700       *                                                                 *
000800       *******************************************************************
000900      FQTXTSRC IP  F      92            DISK         KINFDS INFDS
001000      FSCANPRTFO   E             90     PRINTER
001100      E                    REC        80  1
001200      E                    DB1        80  1
001300      E                    DB2        80  1
001400      E                    FL1        20  1
001500      E                    FL2        20  1
001600      IQTXTSRC NS  01
001700      I                                        1   62SRCSEQ
001800      I                                        7  120SRCDAT
001900      I                                       13  92 SRCDTA
002000      IINFDS       DS
002100      I                                      129 138 MBR
002200      I            DS
002300      I                                        1  80 SRCDTA
002400      I                                        1  80 REC
002500      I              'ABCDEFGHIJKLMNOPQRS- C         UP
002600      I              'TUVWXYZ'
002700      I              'abcdefghijklmnopqrs- C         LO
002800      I              'tuvwxyz'
002900      C**
003000      C           *ENTRY    PLIST                           PARM
003100      C                     PARM           FILIBR 20        LIST
003200      C                     PARM           FIND1  20
003300      C                     PARM           UPPER   1
003400      C                     PARM           FPOS1   2
003500      C                     PARM           TPOS1   2
003600      C                     PARM           ANDOR   5
003700      C                     PARM           COND    3
003800      C                     PARM           FIND2  20
003900      C                     PARM           FPOS2   2
004000      C                     PARM           TPOS2   2
004100      C**
004200      C                     MOVEAFIND1     FL1              SETUP
004300      C                     MOVEAFIND2     FL2              FIND ARRAY
004400      C**
004500      C                     EXSR MAINT
004600      C                     EXSR GETREC
004700      C                     EXSR FNDLST
004800      C                     EXSR SEARCH
004900      C                     EXSR PRINT
005000      C**
005100      CLR                   WRITELRPRT
005200      C*****************************************************************
005300      CSR         MAINT     BEGSR
005400      C*****************************************************************
005500      C**                                                 MAINTAIN INPUT
005600      C           FL1,1     IFEQ '"'                        STRIP
005700      C                     MOVEAFL1,2     FIND1            OFF
005800      C                     MOVEAFIND1     FL1              FIRST
005900      C                     END                             QUOTE
006000      C**
006100      C           FL2,1     IFEQ '"'                        STRIP
006200      C                     MOVEAFL2,2     FIND2            OFF
006300      C                     MOVEAFIND2     FL2              FIRST
006400      C                     END                             QUOTE
006500      C**
006600      C           UPPER     IFEQ 'Y'                        CHANGE TO
006700      C           LO:UP     XLATEFIND1     FIND1            UPPERCASE
006800      C                     END
006900      C**
007000      C           UPPER     IFEQ 'Y'                        CHANGE TO
007100      C           LO:UP     XLATEFIND2     FIND2            UPPERCASE
007200      C                     END
007300      C**
007400      C                     ENDSR
007500      C*****************************************************************
007600      CSR         GETREC    BEGSR
007700      C*****************************************************************
007800      C*
007900      C                     MOVE FILIBR    LIBR   10
008000      C                     MOVELMBR       CURMBR 10
008100      C*
008200      C           CURMBR    IFNE SAVMBR                     GET RECORD
008300      C                     Z-ADD0         RECNBR           NUMBER AND
008400      C                     MOVE CURMBR    PRTMBR 10        MEMBER
008500      C                     ENDIF                           INFORMATION
008600      C*
008700      C                     MOVE CURMBR    SAVMBR 10
008800      C                     MOVE SRCDTA    PRTDTA
008900      C                     ADD  1         RECNBR  50
009000      C*
009100      C                     ENDSR
009200      C*****************************************************************
009300      CSR         FNDLST    BEGSR
009400      C*****************************************************************
009500      C*  FIRST FIND FIELD
009600      C                     MOVE *BLANKS   LOOP    4        FIND LAST
009700      C                     Z-ADD21        L1      20       POSITION
009800      C*
009900      C           LOOP      DOUEQ'EXIT'
010000      C                     SUB  1         L1               DECREASE X 1
010100      C*
010200      C           FL1,L1    IFEQ '"'                        STRIP OFF
010300      C                     MOVE *BLANKS   FL1,L1           ENDING QUOTE
010400      C                     SUB  1         L1               DECREASE X 1
010500      C                     LEAVE
010600      C                     ENDIF
010700      C*
010800      C           FL1,L1    IFNE ' '                        FOUND
010900      C                     LEAVE
011000      C                     ENDIF
011100      C*
011200      C                     ENDDO
011300      C*  SECOND FIND FIELD
011400      C                     MOVE *BLANKS   LOOP    4        FIND LAST
011500      C                     Z-ADD21        L2      20       POSITION
011600      C*
011700      C           LOOP      DOUEQ'EXIT'
011800      C                     SUB  1         L2               DECREASE X 1
011900      C*
012000      C           L2        IFEQ 0                          SECOND
012100      C                     MOVE '*NONE'   ANDOR            STRING WAS
012200      C                     LEAVE                           BLANKS
012300      C                     ENDIF
012400      C*
012500      C           FL2,L2    IFEQ '"'                        STRIP OFF
012600      C                     MOVE *BLANKS   FL2,L2           ENDING QUOTE
012700      C                     SUB  1         L2               DECREASE X 1
012800      C                     LEAVE
012900      C                     ENDIF
013000      C*
013100      C           FL2,L2    IFNE ' '                        FOUND
013200      C                     LEAVE
013300      C                     ENDIF
013400      C*
013500      C                     ENDDO
013600      C*
013700      C                     ENDSR
013800      C*****************************************************************
013900      CSR         SEARCH    BEGSR
014000      C*****************************************************************
014100      C**
014200      C           UPPER     IFEQ 'Y'                        CHANGE TO
014300      C           LO:UP     XLATESRCDTA    SRCDTA           UPPERCASE
014400      C                     ENDIF
014500      C**
014600      C                     MOVE FPOS1     F1      20       SCAN DATA
014700      C                     MOVE TPOS1     T1      20       WITH STRING
014800      C           FIND1:L1  SCAN SRCDTA:F1 B1      30     50
014900      C           B1        ADD  L1        WORK    30
015000      C                     SUB  1         WORK
015100      C*
015200      C           *IN50     IFEQ *ON
015300      C           WORK      ANDGTT1                         NOT
015400      C                     SETOF                         50IN SEARCH
015500      C                     ENDIF                           RANGE
015600      C*
015700      C                     SETOF                         51
015800      C           ANDOR     IFEQ '*AND '
015900      C           ANDOR     OREQ '*OR  '
016000      C**
016100      C                     MOVE FPOS2     F2      20       SCAN DATA
016200      C                     MOVE TPOS2     T2      20       WITH STRING
016300      C           FIND2:L2  SCAN SRCDTA:F2 B2      30     51
016400      C           B2        ADD  L2        WORK    30
016500      C                     SUB  1         WORK
016600      C*
016700      C           *IN51     IFEQ *ON
016800      C           WORK      ANDGTT2                         NOT
016900      C                     SETOF                         51IN SEARCH
017000      C                     ENDIF                           RANGE
017100      C*
017200      C           COND      IFEQ '*NE'
017300      C           *IN51     IFEQ *ON                        FOUND ONLY
017400      C                     SETOF                     51    WANT NOT
017500      C                     ELSE                            EQUAL
017600      C                     SETON                     51    NOT EQUAL
017700      C                     ENDIF                           THEN PRINT
017800      C                     ENDIF
017900      C*
018000      C                     ENDIF
018100      C*
018200      C                     ENDSR
018300      C*****************************************************************
018400      CSR         PRINT     BEGSR
018500      C*****************************************************************
018600      C*
018700      C           ANDOR     IFEQ '*NONE'                    ONE STRING
018800      C           *IN50     ANDEQ*ON                        SEARCH FND
018900      C*
019000      C           ANDOR     OREQ '*AND '                    TWO STRING
019100      C           *IN50     ANDEQ*ON                        SEARCH FND
019200      C           *IN51     ANDEQ*ON
019300      C*
019400      C           ANDOR     OREQ '*OR  '                    EITHER
019500      C           *IN50     ANDEQ*ON                        STRING
019600      C           ANDOR     OREQ '*OR  '                    SEARCH
019700      C           *IN51     ANDEQ*ON                        FOUND
019800      C*
019900      C                     MOVE *BLANKS   TEXT
020000      C           CURMBR    IFNE TXTMBR
020100      C*
020200      C                     CALL 'SCANNCL'                  GET
020300      C                     PARM           CURMBR           FOUND
020400      C                     PARM           LIBR             MEMBERS
020500      C                     PARM           TEXT   50        TEXT
020600      C                     MOVELTEXT      PRTTXT 34
020700      C                     ADD  1         MBRCNT
020800      C*
020900      C                     ENDIF
021000      C* FIRST FIND
021100      C                     MOVE CURMBR    TXTMBR 10        SETUP
021200      C           *IN50     IFEQ *ON
021300      C           B1        ADD  L1        E1      30       PRINT
021400      C                     MOVE PRTDTA    SRCDTA           RECORDS
021500      C                     MOVEAREC,B1    DB1,B1           FOUND
021600      C*
021700      C           E1        IFLE 80
021800      C                     MOVEA*BLANKS   DB1,E1
021900      C                     ENDIF
022000      C                     ENDIF
022100      C* SECOND FIND
022200      C           *IN51     IFEQ *ON
022300      C*
022400      C           B2        IFEQ 0
022500      C                     Z-ADD1         B2
022600      C                     ENDIF
022700      C*
022800      C           B2        ADD  L2        E2      30       PRINT
022900      C                     MOVEAREC,B2    DB2,B2           FOUND
023000      C*
023100      C           E2        IFLE 80
023200      C                     MOVEA*BLANKS   DB2,E2
023300      C                     ENDIF
023400      C                     ENDIF
023500      C*
023600      C   90                EXSR *INZSR                     PRINT OVERFL
023700      C                     WRITEDETAIL                     PRINT DETAIL
023800      C                     ADD  1         LINCNT
023900      C                     MOVEADB1       DB1HLT 80
024000      C                     MOVEADB2       DB2HLT 80
024100      C                     WRITEHILITE                     HIGHLITE
024200      C*
024300      C                     MOVE *BLANKS   PRTMBR           BLANK
024400      C                     MOVE *BLANKS   PRTTXT           PRINT
024500      C                     MOVE *BLANKS   DB1              FIELDS
024600      C                     MOVE *BLANKS   DB2
024700      C                     MOVE *BLANKS   DB1HLT
024800      C                     MOVE *BLANKS   DB2HLT
024900      C*
025000      C                     ENDIF
025100      C*
025200      C                     ENDSR
025300      C*****************************************************************
025400      CSR         *INZSR    BEGSR
025500      C*****************************************************************
025600      C**
025700      C           FIRST     IFEQ *BLANKS
025800      C                     MOVE FIND1     PRTFD1 20        SETUP HEADER
025900      C                     MOVE FIND2     PRTFD2 20        INFORMATION
026000      C                     MOVE 'FIRST'   FIRST   5
026100      C                     ENDIF
026200      C**
026300      C                     WRITEHEAD01
026400      C           ANDOR     IFNE '*NONE'
026500      C                     WRITEHEAD02                     PRINT SECOND
026600      C                     ENDIF                           FIND INFO
026700      C                     WRITESPACE
026800      C                     WRITEHEAD03
026900      C                     SETOF                     90
027000      C**
027100      C                     ENDSR

Dig Deeper on RPG iSeries programming

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close