Mainframe Utility: SIDBYSID

Return to Mainframe Utilities Page

Module


ISREDIT MACRO
ISPEXEC CONTROL ERRORS RETURN
/**** LAST UPDATED: NOV 22, 1999, BARBARA DIUBALDO P@UBLD  ***/
/**** THIS IS A CLIST MACRO.                               ***/
/**** IT BRINGS IN THE WHOLE FILE AND LETS US CHANGE VARIOUS */
/**** THINGS.  PROCESS IS TO DO A 3.14 WITH AN OUTPUT FILE ***/
/**** THEN DO THIS MACRO IN AN EDIT MODE THUS PUTTING EVERY***/
/**** FOUND MEMBER ON LINE THAT IT FOUND.  IT ALSO USES    ***/
/**** THE CLIST NOBLANK.                                   ***/
/**** SET MESSAGE DISPLAY ON/OFF BASED ON THE DEBUG SWITCH ***/
ISPEXEC VGET (DBGSWTCH) PROFILE
IF &DBGSWTCH = &STR(ON) THEN CONTROL MSG LIST CONLIST SYMLIST NOFLUSH
ELSE CONTROL NOMSG NOLIST NOFLUSH NOPROMPT
/**** CALL TO DO NOBLANK CLIST                              **/
ISREDIT %NOBLANK

/**** GET RID OF LINE AND REMAINING LINES AFTER             **/
SET TARGET = &NRSTR(ND  LINES-PROC  MEMBERS-W/LNS  MEMBERS-WO/LNS)
ISREDIT FIND FIRST '&NRSTR(&TARGET)'
ISREDIT DELETE .ZCSR .ZLAST

/**** BEGIN AT TOP AND IDENTIFY LINE THAT WOULD HAVE MEMBER NAMES**/
SET TARGET = &NRSTR(--------- STRING(S) FOUND --------------)
ISREDIT FIND FIRST '&NRSTR(&TARGET)'
SET SAVECC = &LASTCC

DO WHILE &SAVECC = 0
    ISREDIT (DLINE) = LINE .ZCSR
    SET NAME = &SUBSTR(3:8,&NRSTR(&DLINE))
/**** PROCESS GOES TO NEXT LINE                   **/
    ISREDIT FIND NEXT P'=' 1
    SET SAVECC2 = &LASTCC
    DO WHILE &SAVECC2 = 0
        ISREDIT (DLINE) = LINE .ZCSR
        IF &SYSINDEX(&NRSTR(&TARGET),&NRSTR(&DLINE)) = 0 THEN +
            DO
                SET DLEN = &LENGTH(&NRSTR(&DLINE))
                SET DLINE = &NRSTR( )&NRSTR(&NAME)+
                            &SUBSTR(11:&DLEN,&NRSTR(&DLINE))
                IF &SYSINDEX(&STR('),&NRSTR(&DLINE)) > 0 THEN +
                    ISREDIT LINE .ZCSR = "&NRSTR(&DLINE)"
                ELSE +
                    ISREDIT LINE .ZCSR = '&NRSTR(&DLINE)'
                ISREDIT FIND NEXT P'=' 1
                SET SAVECC2 = &LASTCC
            END
        ELSE +
            SET SAVECC2 = 100
    END
    ISREDIT FIND NEXT '&NRSTR(&TARGET)'
    SET SAVECC = &LASTCC
END

/**** EXCLUDES THESE LINES FROM THE PROCESS       **/
ISREDIT EXCLUDE ALL '&NRSTR(&TARGET)'
ISREDIT EXCLUDE ALL 'MVS/PDF FILE/LINE/WORD/BYTE/SFOR COMPARE '
ISREDIT EXCLUDE ALL 'SOURCE SECTION                    SRCH DSN:'
ISREDIT EXCLUDE ALL 'SUMMARY SECTION            SRCH DSN: '
/**** DELETES ALL EXCLUDED LINES                  **/
ISREDIT DELETE ALL X

EXIT

HELPSEC: +                                                              02480000
ISPEXEC SELECT PGM(ISPTUTOR) PARM(HELPSHEL)                             02490000
SET ZEDLMSG = &NRSTR(*** HELP DISPLAYED FOR SIDBYSID UTILITY +          02490000
                   *** NO PROCESSING PERFORMED ***)                     02490000
ISPEXEC SETMSG MSG(UTLZ000)                                             02490000
EXIT
            


Documentation


 ISPF option 3.14 allows you to search for strings in a sequential dataset or a
 PDS.  If the dataset is a PDS, the output is in the format :

 mbmrname            -------------- STRING(S) FOUND ---------------------
 000001  data from the line
 000002  data from the next line
 "SIDBYSID" changes the format to :
 mbmrname data from the line
 mbmrname data from the next line
            


Leave a Reply

Your email address will not be published. Required fields are marked *