Mainframe Utility: JCLCLIST

Return to Mainframe Utilities Page

Module


ISREDIT MACRO (HELP)
ISPEXEC CONTROL ERRORS RETURN
/**** 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
/******************************************************************/
/* 'JCLCLIST' EDIT MACRO. TAKE A JCL JOB STEP AND CONVERT TO CLIST*/
/* FORMAT.                                                        */
/* AUTHOR : DAVID LEIGH    DATE : 5-25-89                         */
/******************************************************************/

SET PLUS = &STR(+)
IF &STR(&HELP) = &STR(HELP) THEN GOTO HELPSEC

ISREDIT (CURRDSN) = DATASET
LISTDSI '&CURRDSN'
DELETE '&CURRDSN($&SYSUID)'
FREE DDNAME(TEMPFREE)
ALLOC DDNAME(TEMPFREE) +
      DSN('&CURRDSN($&SYSUID)') +
      SHR KEEP
OPENFILE TEMPFREE OUTPUT

ISREDIT (SLINE,SCOL) = CURSOR
SET PSWITCH = OFF
ISREDIT CURSOR = 1 1
SET SAVECC = 0
ISREDIT FIND FIRST P'=' 1 X
SET SAVECC = &LASTCC

IF &SAVECC = 0 THEN +
    DO
        ISREDIT (LN,CL) = CURSOR
        SET LN = &LN - 1
        IF &LN = 0 THEN +
            DO
                ISREDIT LINE_BEFORE .ZCSR = ' '
                SET LN = 1
            END
        ISREDIT CURSOR = &LN &CL
        ISREDIT LABEL .ZCSR = .LABELA
        SET LN = &LN + 1
        ISREDIT CURSOR = &LN &CL
        ISREDIT LABEL .ZCSR = .LABELB
        ISREDIT (DATA) = LINE .ZCSR
        IF &SYSINDEX(&STR( EXEC ),&STR(&DATA)) = 0 OR +
           &SYSINDEX(&STR(PGM=),&STR(&DATA)) = 0 THEN +
            DO
                SET ZEDLMSG = &STR(FIRST EXCLUDED LINE MUST BE AN )+
                              &STR("EXEC PGM=" JCL LINE)
                ISPEXEC SETMSG MSG(UTLZ001)
                CLOSFILE TEMPFREE
                FREE DDNAME(TEMPFREE)
                EXIT
            END
        ELSE +
            DO
                SET A = &SYSINDEX(&STR(PGM=),&STR(&DATA))
                SET A = &A + 4
                SET B = &LENGTH(&STR(&DATA))
                SET DATA = &SUBSTR(&A:&B,&STR(&DATA))
                SET A = &SYSINDEX(&STR(,),&STR(&DATA))
                IF &A > 1 THEN +
                    DO
                        SET A = &A - 1
                        SET PSWITCH = ON
                    END
                ELSE +
                    SET A = &SYSINDEX(&STR( ),&STR(&DATA))
                SET PGMNAME = &SUBSTR(1:&A,&STR(&DATA))
                DO WHILE &PSWITCH = ON
                    ISREDIT FIND NEXT P'¬' 3 80 X
                    SET SAVECC = &LASTCC
                    IF &SAVECC = 0 THEN +
                        DO
                            ISREDIT (LN,CL) = CURSOR
                            ISREDIT (DATA) = LINE .ZCSR
                            SET B = &LENGTH(&STR(&DATA))
                            SET X = &SUBSTR(&CL:&B,&STR(&DATA))
                            SET A = &SYSINDEX(&STR(,),&STR(&X))
                            IF &A > 1 THEN SET PSWITCH = ON
                            ELSE +
                                DO
                                    SET A = &SYSINDEX(&STR( ),+
                                            &STR(&X))
                                    SET A = &A - 1

                                    SET PSWITCH = OFF
                                END
                            SET X = &SUBSTR(1:&A,&STR(&X))
                            SET PARM = &STR(&PARM.&X)
                        END
                    ELSE SET PSWITCH = OFF
                END

            END
    END
ELSE +
    DO
        SET ZEDLMSG = &STR(SELECTED LINES TO CONVERT MUST BE EXCLUDED)
        ISPEXEC SETMSG MSG(UTLZ001)
        CLOSFILE TEMPFREE
        FREE DDNAME(TEMPFREE)
        EXIT
    END

ISREDIT FIND NEXT P'=' 1 X

IF &LASTCC > 0 THEN +
    DO
        SET ZEDLMSG = &STR(NO EXCLUDED LINES PAST THE "EXEC" STATEMENT)
        ISPEXEC SETMSG MSG(UTLZ001)
        CLOSFILE TEMPFREE
        FREE DDNAME(TEMPFREE)
        EXIT
    END

ISREDIT (LN,CL) = CURSOR
ISREDIT SEEK LAST P'=' 1 X
ISREDIT LINE_AFTER .ZCSR = ' '
ISREDIT CURSOR = &LN &CL
SET LPAREN = &STR((
SET RPAREN = &STR())
SET DDBEGIN = OFF
SET DDEND = ON
SET NUMDD = 0
SET NUMDCB = 0

LOOP: +
ISREDIT CHANGE '&&' '¦' .ZCSR .ZCSR ALL
ISREDIT (LN,CL) = CURSOR
SET LN = &LN + 1
ISREDIT CURSOR = &LN 1
IF &LASTCC = 0 THEN +
    ISREDIT FIND P'¬' PREV
ELSE +
    DO
        SET LN = &LN - 1
        SET CL = &SYSLRECL
        ISREDIT CURSOR = &LN &CL
        ISREDIT FIND P'¬' PREV
    END
ISREDIT (LN,CL) = CURSOR
ISREDIT (DATA) = LINE .ZCSR
SET CL = &CL + 2
IF &CL > &SYSLRECL THEN SET CL = &SYSLRECL
SET DATA = &SUBSTR(1:&CL,&STR(&DATA))
IF &SUBSTR(1:2,&STR(&DATA)) ¬= &STR(//) OR +
   &SYSINDEX(&STR(/)&STR(/)&STR(*),&STR(&DATA)) = 1 THEN +
    IF &SWITCHSYS = ON THEN +
        DO
            IF &SYSINDEX(&STR(&DLM ),&STR(&DATA)) = 1 THEN +
                DO
                    SET DDBEGIN = OFF
                    SET DDEND = ON
                END
            ELSE +
                DO
                    SET NUMLINE = &NUMLINE + 1
                    SET LINE&NUMLINE = &NRSTR(&DATA)
                END
        END
    ELSE GOTO CONTINUE

IF &SYSINDEX(&STR(DCB=),&STR(&DATA)) > 0 THEN +
    DO
        SET A = &SYSINDEX(&STR(DCB=),&STR(&DATA))
        SET A = &A + 4
        SET B = &LENGTH(&STR(&DATA))
        SET Q = &SUBSTR(&A:&B,&STR(&DATA))
        IF &SYSINDEX(&STR(&LPAREN),&STR(&Q)) ¬= 1 THEN +
            IF &SYSINDEX(&STR(SYS3.DSCB),&STR(&Q)) ¬= 1 THEN +
                DO
                    SET DDBEGIN = OFF
                    SET DDEND = ON
                END
            ELSE
        ELSE
    END

IF &DDBEGIN = OFF AND +
   &SYSINDEX(&STR( DD ),&STR(&DATA)) > 0 AND +
   &SYSINDEX(&STR( ),&STR(&DATA)) > 3 THEN +
    DO
        SET DDBEGIN = ON
        SET DDEND = OFF
        SET NUMDD = &NUMDD + 1
        SET NUMDSN = 0
        SET A = &SYSINDEX(&STR( ),&STR(&DATA))
        SET DDNAME = &SUBSTR(3:&A,&STR(&DATA))
        IF &DDNAME = STEPLIB THEN +
            DO
                SET TLIB = YES
                SET DDNAME = TASKLIB
            END
    END

IF &DDBEGIN = ON AND +
   &SYSINDEX(&STR( DD ),&STR(&DATA)) > 0 AND +
   &SYSINDEX(&STR( DSN=),&STR(&DATA)) = 0 AND +
   (&SYSINDEX(&STR( * ),&STR(&DATA)) > 0 OR +
   &SYSINDEX(&STR( DATA),&STR(&DATA)) > 0) THEN +
    DO
        SET NUMLINE = 0
        SET SWITCHSYS = ON
        SET A = &SYSINDEX(&STR(,DLM=),&STR(&DATA))
        IF A > 0 THEN +
            DO
                SET A = &A + 5
                SET B = &LENGTH(&STR(&DATA))
                SET DLM = &SUBSTR(&A:&B,&STR(&DATA))
                SET A = &SYSINDEX(&STR(, ),&STR(&DLM))
                IF &A = 0 THEN SET A = &SYSINDEX(&STR( ),&STR(&DLM))
                SET A = &A - 1
                SET DLM = &SUBSTR(1:&A,&STR(&DLM))
            END
        ELSE SET DLM = &STR(/*)
    END

IF &DDBEGIN = ON AND &SYSINDEX(&STR(DSN=),&STR(&DATA)) > 0 THEN +
    DO
        SET NUMDSN = &NUMDSN + 1
        SET A = &SYSINDEX(&STR(DSN=),&STR(&DATA))
        SET A = &A + 4
        SET B = &LENGTH(&STR(&DATA))
        SET DSN&NUMDSN = &SUBSTR(&A:&B,&STR(&DATA))
        SET X = &&DSN&NUMDSN
        SET A = &SYSINDEX(&STR(,),&STR(&X))
        IF &A = 0 THEN +
            DO
                SET A = &SYSINDEX(&STR( ),&STR(&X))
                ISREDIT (LX CX) = CURSOR
                ISREDIT SEEK P'=' NEXT 1 X
                ISREDIT (XDATA) = LINE .ZCSR
                IF &SUBSTR(1:3,&STR(&XDATA)) = &STR(// ) AND +
                   &SYSINDEX(&STR( DD ),&STR(&XDATA)) > 1 THEN +
                    ISREDIT CURSOR = &LX &CX
                ELSE +
                    DO
                        ISREDIT CURSOR = &LX &CX
                        SET DDBEGIN = OFF
                        SET DDEND = ON
                    END
            END
        SET A = &A - 1
        SET DSN&NUMDSN = &SUBSTR(1:&A,&STR(&X))
    END

IF &DDBEGIN = ON AND &SYSINDEX(&STR(DISP=),&STR(&DATA)) > 0 THEN +
    DO
        SET A = &SYSINDEX(&STR(DISP=),&STR(&DATA))
        SET A = &A + 5
        SET B = &LENGTH(&STR(&DATA))
        SET DISP = &SUBSTR(&A:&B,&STR(&DATA))
        IF &SYSINDEX(&STR(&LPAREN),&STR(&DISP)) ¬= 1 THEN +
            DO
                SET A = &SYSINDEX(&STR(,),&STR(&DISP))
                IF &A = 0 THEN +
                    DO
                        SET A = &SYSINDEX(&STR( ),+
                                &STR(&DISP))
                        ISREDIT (LX CX) = CURSOR
                        ISREDIT SEEK P'=' NEXT 1 X
                        ISREDIT (XDATA) = LINE .ZCSR
                        IF &SUBSTR(1:3,&STR(&XDATA)) = &STR(// ) AND +
                           &SYSINDEX(&STR( DD ),&STR(&XDATA)) > 1 THEN +
                            ISREDIT CURSOR = &LX &CX
                        ELSE +
                            DO
                                ISREDIT CURSOR = &LX &CX
                                SET DDBEGIN = OFF
                                SET DDEND = ON
                            END
                    END
                SET A = &A - 1
                SET DISP = &SUBSTR(1:&A,&STR(&DISP))
            END
        ELSE +
            DO
                SET A = &SYSINDEX(&STR(&RPAREN),&STR(&DISP))
                SET Q = &A + 1
                IF &SYSINDEX(&STR( ),&STR(&DISP)) = &Q THEN +
                    DO
                        ISREDIT (LX CX) = CURSOR
                        ISREDIT SEEK P'=' NEXT 1 X
                        ISREDIT (XDATA) = LINE .ZCSR
                        IF &SUBSTR(1:3,&STR(&XDATA)) = &STR(// ) AND +
                           &SYSINDEX(&STR( DD ),&STR(&XDATA)) > 1 THEN +
                            ISREDIT CURSOR = &LX &CX
                        ELSE +
                            DO
                                ISREDIT CURSOR = &LX &CX
                                SET DDBEGIN = OFF
                                SET DDEND = ON
                            END
                    END
                SET A = &A - 1
                SET DISP = &SUBSTR(2:&A,&STR(&DISP))
                SET A = &SYSINDEX(&STR(,),&STR(&DISP))
                IF &A = 0 THEN +
                    DO
                        SET A = &SYSINDEX(&STR(&LPAREN),+
                                &STR(&DISP))
                        ISREDIT (LX CX) = CURSOR
                        ISREDIT SEEK P'=' NEXT 1 X
                        ISREDIT (XDATA) = LINE .ZCSR
                        IF &SUBSTR(1:3,&STR(&XDATA)) = &STR(// ) AND +
                           &SYSINDEX(&STR( DD ),&STR(&XDATA)) > 1 THEN +
                            ISREDIT CURSOR = &LX &CX
                        ELSE +
                            DO
                                ISREDIT CURSOR = &LX &CX
                                SET DDBEGIN = OFF
                                SET DDEND = ON
                            END
                    END
                SET C = &A + 1
                SET A = &A - 1
                SET B = &LENGTH(&STR(&DISP))
                SET X = &SUBSTR(1:&A,&STR(&DISP))
                SET Y = &SUBSTR(&C:&B,&STR(&DISP))
                SET A = &SYSINDEX(&STR(,),&STR(&Y))
                SET A = &A - 1
                IF &A > 0 THEN +
                    DO
                        SET Y = &SUBSTR(1:&A,&STR(&Y))
                        SET DISP = &STR(&X &Y)
                    END
                ELSE +
                    SET DISP = &STR(&X)
            END
    END

IF &DDBEGIN = ON AND &SYSINDEX(&STR(UNIT=),&STR(&DATA)) > 0 THEN +
    DO
        SET A = &SYSINDEX(&STR(UNIT=),&STR(&DATA))
        SET A = &A + 5
        SET B = &LENGTH(&STR(&DATA))
        SET UNIT = &SUBSTR(&A:&B,&STR(&DATA))
        SET A = &SYSINDEX(&STR(,),&STR(&UNIT))
        IF &A = 0 THEN +
            DO
                SET A = &SYSINDEX(&STR( ),&STR(&UNIT))
                ISREDIT (LX CX) = CURSOR
                ISREDIT SEEK P'=' NEXT 1 X
                ISREDIT (XDATA) = LINE .ZCSR
                IF &SUBSTR(1:3,&STR(&XDATA)) = &STR(// ) AND +
                   &SYSINDEX(&STR( DD ),&STR(&XDATA)) > 1 THEN +
                    ISREDIT CURSOR = &LX &CX
                ELSE +
                    DO
                        ISREDIT CURSOR = &LX &CX
                        SET DDBEGIN = OFF
                        SET DDEND = ON
                    END
            END
        SET A = &A - 1
        SET UNIT = &SUBSTR(1:&A,&STR(&UNIT))
    END

IF &DDBEGIN = ON AND &SYSINDEX(&STR(SPACE=),&STR(&DATA)) > 0 THEN +
    DO
        SET A = &SYSINDEX(&STR(SPACE=),&STR(&DATA))
        SET A = &A + 7
        SET B = &LENGTH(&STR(&DATA))
        SET SPACE = &SUBSTR(&A:&B,&STR(&DATA))
        SET C = &SYSINDEX(&STR(&LPAREN),&STR(&SPACE))
        SET C = &C - 2
        SET Q = &SYSINDEX(&STR(&RPAREN ),&STR(&SPACE))
        IF &Q > 0 THEN +
            DO
                ISREDIT (LX CX) = CURSOR
                ISREDIT SEEK P'=' NEXT 1 X
                ISREDIT (XDATA) = LINE .ZCSR
                IF &SUBSTR(1:3,&STR(&XDATA)) = &STR(// ) AND +
                   &SYSINDEX(&STR( DD ),&STR(&XDATA)) > 1 THEN +
                    ISREDIT CURSOR = &LX &CX
                ELSE +
                    DO
                        ISREDIT CURSOR = &LX &CX
                        SET DDBEGIN = OFF
                        SET DDEND = ON
                    END
            END
        SET X = &SUBSTR(1:&C,&STR(&SPACE))
        IF &X = CYL THEN SET &X = CYLINDERS
        IF &X = TRK THEN SET &X = TRACKS
        IF &X = BLK THEN SET &X = BLOCKS
        SET C = &SYSINDEX(&STR(&LPAREN),&STR(&SPACE))
        SET C = &C + 1
        SET B = &SYSINDEX(&STR(&RPAREN),&STR(&SPACE))
        SET B = &B - 1
        SET Y = &SUBSTR(&C:&B,&STR(&SPACE))
        IF &SYSINDEX(&STR(,RLSE),&STR(&SPACE)) > 1 THEN +
            SET Z = RELEASE
        ELSE SET Z =
        SET SPACE = &STR(SPACE(&Y) &X &Z)
    END

IF &DDBEGIN = ON AND &SYSINDEX(&STR(RECFM=),&STR(&DATA)) > 0 THEN +
    DO
        SET A = &SYSINDEX(&STR(RECFM=),&STR(&DATA))
        SET A = &A + 5
        SET B = &LENGTH(&STR(&DATA))
        SET RECFM = &SUBSTR(&A:&B,&STR(&DATA))
        SET A = &SYSINDEX(&STR(,),&STR(&RECFM))
        IF &A = 0 THEN +
            DO
                SET A = &SYSINDEX(&STR(&RPAREN),&STR(&RECFM))
                SET Q = &A + 1
                IF &SYSINDEX(&STR( ),&STR(&RECFM)) = &Q THEN +
                    DO
                        ISREDIT (LX CX) = CURSOR
                        ISREDIT SEEK P'=' NEXT 1 X
                        ISREDIT (XDATA) = LINE .ZCSR
                        IF &SUBSTR(1:3,&STR(&XDATA)) = &STR(// ) AND +
                           &SYSINDEX(&STR( DD ),&STR(&XDATA)) > 1 THEN +
                            ISREDIT CURSOR = &LX &CX
                        ELSE +
                            DO
                                ISREDIT CURSOR = &LX &CX
                                SET DDBEGIN = OFF
                                SET DDEND = ON
                            END
                    END
            END
        SET A = &A - 1
        SET RECFM = &SUBSTR(1:&A,&STR(&RECFM))
        SET F =
        SET B =
        SET V =
        SET M =
        SET A =
        IF &SYSINDEX(&STR(F),&STR(&RECFM)) > 0 THEN +
            SET F = &STR(F )
        IF &SYSINDEX(&STR(B),&STR(&RECFM)) > 0 THEN +
            SET B = &STR(B )
        IF &SYSINDEX(&STR(V),&STR(&RECFM)) > 0 THEN +
            SET V = &STR(V )
        IF &SYSINDEX(&STR(M),&STR(&RECFM)) > 0 THEN +
            SET M = &STR(M )
        IF &SYSINDEX(&STR(A),&STR(&RECFM)) > 0 THEN +
            SET A = &STR(A )
        SET RECFM = &STR(&F&V&B&M&A)
    END

IF &DDBEGIN = ON AND &SYSINDEX(&STR(LRECL=),&STR(&DATA)) > 0 THEN +
    DO
        SET A = &SYSINDEX(&STR(LRECL=),&STR(&DATA))
        SET A = &A + 6
        SET B = &LENGTH(&STR(&DATA))
        SET LRECL = &SUBSTR(&A:&B,&STR(&DATA))
        SET A = &SYSINDEX(&STR(,),&STR(&LRECL))
        IF &A = 0 THEN +
            DO
                SET A = &SYSINDEX(&STR(&RPAREN),&STR(&LRECL))
                SET Q = &A + 1
                IF &SYSINDEX(&STR( ),&STR(&LRECL)) = &Q THEN +
                    DO
                        ISREDIT (LX CX) = CURSOR
                        ISREDIT SEEK P'=' NEXT 1 X
                        ISREDIT (XDATA) = LINE .ZCSR
                        IF &SUBSTR(1:3,&STR(&XDATA)) = &STR(// ) AND +
                           &SYSINDEX(&STR( DD ),&STR(&XDATA)) > 1 THEN +
                            ISREDIT CURSOR = &LX &CX
                        ELSE +
                            DO
                                ISREDIT CURSOR = &LX &CX
                                SET DDBEGIN = OFF
                                SET DDEND = ON
                            END
                    END
            END
        SET A = &A - 1
        SET LRECL = &SUBSTR(1:&A,&STR(&LRECL))
    END

IF &DDBEGIN = ON AND &SYSINDEX(&STR(BLKSIZE=),&STR(&DATA)) > 0 THEN +
    DO
        SET A = &SYSINDEX(&STR(BLKSIZE=),&STR(&DATA))
        SET A = &A + 8
        SET B = &LENGTH(&STR(&DATA))
        SET BLKSIZE = &SUBSTR(&A:&B,&STR(&DATA))
        SET A = &SYSINDEX(&STR(,),&STR(&BLKSIZE))
        IF &A = 0 THEN +
            DO
                SET A = &SYSINDEX(&STR(&RPAREN),&STR(&BLKSIZE))
                SET Q = &A + 1
                IF &SYSINDEX(&STR( ),&STR(&BLKSIZE)) = &Q THEN +
                    DO
                        ISREDIT (LX CX) = CURSOR
                        ISREDIT SEEK P'=' NEXT 1 X
                        ISREDIT (XDATA) = LINE .ZCSR
                        IF &SUBSTR(1:3,&STR(&XDATA)) = &STR(// ) AND +
                           &SYSINDEX(&STR( DD ),&STR(&XDATA)) > 1 THEN +
                            ISREDIT CURSOR = &LX &CX
                        ELSE +
                            DO
                                ISREDIT CURSOR = &LX &CX
                                SET DDBEGIN = OFF
                                SET DDEND = ON
                            END
                    END
            END
        SET A = &A - 1
        SET BLKSIZE = &SUBSTR(1:&A,&STR(&BLKSIZE))
    END

IF &DDBEGIN = ON AND &SYSINDEX(&STR(SYSOUT=),&STR(&DATA)) > 0 THEN +
    DO
        SET DISP = &STR(DUMMY)
        SET DDBEGIN = OFF
        SET DDEND = ON
    END

IF &DDEND = ON THEN +
    DO
        IF &LENGTH(&STR(&PARM)) > 0 THEN +
            IF &TLIB = YES THEN +
                SET CALL = &STR(TSOPTSKL &PGMNAME &PARM)
            ELSE +
                SET CALL = &STR(CALL 'SYS2A.LINKLIB(&PGMNAME)' '&PARM')
        ELSE +
            IF &TLIB = YES THEN +
                SET CALL = &STR(TSOPTSKL &PGMNAME)
            ELSE +
                SET CALL = &STR(CALL 'SYS2A.LINKLIB(&PGMNAME)')
        SET PLS = &STR(+)
        IF &SWITCHSYS = ON THEN +
            DO
                SET SWITCHSYS = OFF
                SET STRING = &STR( )
                ISREDIT LINE_BEFORE .LABELB = '&STRING'
                SET STRING = &STR(FREE ATTRLIST(ATTRIB&NUMDD))
                ISREDIT LINE_BEFORE .LABELB = '&STRING'
                SET TEMPFREE = &STR(&STRING)
                PUTFILE TEMPFREE
                SET STRING = &STR(ATTRIB ATTRIB&NUMDD OUTPUT +)
                ISREDIT LINE_BEFORE .LABELB = '&STRING'
                SET STRING = &STR(       RECFM(F B) +)
                ISREDIT LINE_BEFORE .LABELB = '&STRING'
                SET RECFM =
                SET STRING = &STR(       LRECL(80) +)
                ISREDIT LINE_BEFORE .LABELB = '&STRING'
                SET LRECL =
                SET STRING = &STR(       BLKSIZE(23440))
                ISREDIT LINE_BEFORE .LABELB = '&STRING'
                SET BLKSIZE =
                SET STRING = &STR( )
                ISREDIT LINE_BEFORE .LABELB = '&STRING'
                SET STRING = &STR(FREE DDNAME(&DDNAME))
                ISREDIT LINE_BEFORE .LABELB = '&STRING'
                SET TEMPFREE = &STR(&STRING)
                PUTFILE TEMPFREE
                SET STRING = &STR(DELETE &DDNAME)
                ISREDIT LINE_BEFORE .LABELB = '&STRING'
                SET STRING = &STR(ALLOC DD(&DDNAME) +)
                ISREDIT LINE_BEFORE .LABELB = '&STRING'
                SET STRING = &STR(      DSN(&DDNAME) +)
                ISREDIT LINE_BEFORE .LABELB = '&STRING'
                SET STRING = &STR(      NEW CATALOG +)
                ISREDIT LINE_BEFORE .LABELB = '&STRING'
                SET STRING = &STR(      UNIT(SYSDA) +)
                ISREDIT LINE_BEFORE .LABELB = '&STRING'
                SET STRING = &STR(      SPACE(50,1) TRACKS RELEASE +)
                ISREDIT LINE_BEFORE .LABELB = '&STRING'
                SET STRING = &STR(      USING(ATTRIB&NUMDD))
                ISREDIT LINE_BEFORE .LABELB = '&STRING'
                SET STRING = &STR( )
                ISREDIT LINE_BEFORE .LABELB = '&STRING'
                SET STRING = &STR(OPENFILE &DDNAME OUTPUT)
                ISREDIT LINE_BEFORE .LABELB = '&STRING'
                SET X = 1
                DO WHILE &X <= &NUMLINE
                    SET Y = &&LINE&X
                    SET STRING = &STR(SET &DDNAME = )+
                                 &STR(¦STR(&Y))
                    IF &LENGTH(&STR(&STRING)) > 70 THEN +
                        DO
                            SET A = &LENGTH(&STR(&STRING))
                            SET STG1 = &SUBSTR(1:70,&STR(&STRING))
                            SET STG2 = &SUBSTR(71:&A,&STR(&STRING))
                            SET STG1 = &STR(&STG1+)
                            SET STG2 = &STR(    &STG2)
                            IF &SYSINDEX(&STR('),&STR(&STG1)) > 0 THEN +
                                ISREDIT LINE_BEFORE .LABELB = "&STG1"
                            ELSE +
                                ISREDIT LINE_BEFORE .LABELB = '&STG1'
                            IF &SYSINDEX(&STR('),&STR(&STG2)) > 0 THEN +
                                ISREDIT LINE_BEFORE .LABELB = "&STG2"
                            ELSE +
                                ISREDIT LINE_BEFORE .LABELB = '&STG2'
                        END
                    ELSE +
                        IF &SYSINDEX(&STR('),&STR(&STRING)) > 0 THEN +
                            ISREDIT LINE_BEFORE .LABELB = "&STRING"
                        ELSE +
                            ISREDIT LINE_BEFORE .LABELB = '&STRING'
                    SET STRING = &STR(PUTFILE &DDNAME)
                    ISREDIT LINE_BEFORE .LABELB = '&STRING'
                    SET X = &X + 1
                END
                SET STRING = &STR(CLOSFILE &DDNAME)
                ISREDIT LINE_BEFORE .LABELB = '&STRING'
                SET STRING = &STR( )
                ISREDIT LINE_BEFORE .LABELB = '&STRING'
                SET STRING = &STR(FREE DDNAME(&DDNAME))
                ISREDIT LINE_BEFORE .LABELB = '&STRING'
                SET TEMPFREE = &STR(&STRING)
                PUTFILE TEMPFREE
                SET STRING = &STR(ALLOC DD(&DDNAME) +)
                ISREDIT LINE_BEFORE .LABELB = '&STRING'
                SET STRING = &STR(      DSN(&DDNAME) +)
                ISREDIT LINE_BEFORE .LABELB = '&STRING'
                SET STRING = &STR(      SHR KEEP)
                ISREDIT LINE_BEFORE .LABELB = '&STRING'
            END
        ELSE +
            IF &SYSINDEX(&STR(NEW),&STR(&DISP)) > 0 THEN +
                DO
                    SET STRING = &STR( )
                    ISREDIT LINE_BEFORE .LABELB = '&STRING'
                    SET STRING = &STR(FREE ATTRLIST(ATTRIB&NUMDD))
                    ISREDIT LINE_BEFORE .LABELB = '&STRING'
                    SET TEMPFREE = &STR(&STRING)
                    PUTFILE TEMPFREE
                    SET STRING = &STR(ATTRIB ATTRIB&NUMDD OUTPUT +)
                    ISREDIT LINE_BEFORE .LABELB = '&STRING'
                    SET STRING = &STR(       RECFM(&RECFM) +)
                    ISREDIT LINE_BEFORE .LABELB = '&STRING'
                    SET RECFM =
                    SET STRING = &STR(       LRECL(&LRECL) +)
                    ISREDIT LINE_BEFORE .LABELB = '&STRING'
                    SET LRECL =
                    SET STRING = &STR(       BLKSIZE(&BLKSIZE))
                    ISREDIT LINE_BEFORE .LABELB = '&STRING'
                    SET BLKSIZE =
                    SET STRING = &STR( )
                    ISREDIT LINE_BEFORE .LABELB = '&STRING'
                    SET STRING = &STR(FREE DDNAME(&DDNAME))
                    ISREDIT LINE_BEFORE .LABELB = '&STRING'
                    SET TEMPFREE = &STR(&STRING)
                    PUTFILE TEMPFREE
                    SET STRING = &STR(ALLOC DD(&DDNAME) +)
                    ISREDIT LINE_BEFORE .LABELB = '&STRING'
                    SET DDNAME =
                    SET X = 1
                    SET Y = &&DSN&X
                    IF &NUMDSN > 1 THEN +
                        DO
                            SET STRING = &STR(      DSN('&Y' +)
                            ISREDIT LINE_BEFORE .LABELB = "&STRING"
                            SET DSN&X =
                        END
                    ELSE +
                        DO
                            SET STRING = &STR(      DSN('&Y') +)
                            ISREDIT LINE_BEFORE .LABELB = "&STRING"
                            SET DSN&X =
                        END
                    SET X = &X + 1
                    DO WHILE &X < &NUMDSN
                        SET Y = &&DSN&X
                        SET STRING = &STR(         &STR('&Y') +)
                        ISREDIT LINE_BEFORE .LABELB = "&STRING"
                        SET DSN&X =
                        SET X = &X + 1
                    END
                    IF &X = &NUMDSN THEN +
                        DO
                            SET Y = &&DSN&X
                            SET STRING = &STR(          &STR('&Y')) +)
                            ISREDIT LINE_BEFORE .LABELB = '&STRING'
                            SET DSN&X =
                        END
                    IF &DISP >     THEN +
                        DO
                            IF &UNIT =     AND +
                               &SPACE =    AND +
                               &NUMDSN = 0 THEN +
                                SET PLS =
                            SET STRING = &STR(      &DISP &PLS)
                            ISREDIT LINE_BEFORE .LABELB = '&STRING'
                            SET DISP =
                        END
                    IF &UNIT >     THEN +
                        DO
                            IF &SPACE =    AND +
                               &NUMDSN = 0 THEN +
                                SET PLS =
                            SET STRING = &STR(      UNIT(&UNIT) &PLS)
                            ISREDIT LINE_BEFORE .LABELB = '&STRING'
                            SET UNIT =
                        END
                    IF &SPACE >     THEN +
                        DO
                            IF &NUMDSN = 0 THEN +
                                SET PLS =
                            SET STRING = &STR(      &SPACE &PLS)
                            ISREDIT LINE_BEFORE .LABELB = '&STRING'
                            SET SPACE =
                        END
                    IF &NUMDSN > 0  THEN +
                        DO
                            SET STRING = &STR(      USING(ATTRIB&NUMDD))
                            ISREDIT LINE_BEFORE .LABELB = '&STRING'
                        END
                END
            ELSE +
                DO
                    SET STRING = &STR( )
                    ISREDIT LINE_BEFORE .LABELB = '&STRING'
                    SET STRING = &STR(FREE DDNAME(&DDNAME))
                    ISREDIT LINE_BEFORE .LABELB = '&STRING'
                    SET TEMPFREE = &STR(&STRING)
                    PUTFILE TEMPFREE
                    SET STRING = &STR(ALLOC DD(&DDNAME) +)
                    ISREDIT LINE_BEFORE .LABELB = '&STRING'
                    SET DDNAME =
                    SET X = 1
                    SET Y = &&DSN&X
                    IF &STR(&Y) >    THEN +
                        DO
                            IF &NUMDSN > 1 THEN +
                                DO
               SET STRING = &STR(      DSN&STR(&LPAREN)'&Y' &STR(&PLUS))
                                    ISREDIT LINE_BEFORE .LABELB = +
                                        "&STRING"
                                    SET DSN&X =
                                END
                            ELSE +
                                DO
                              SET STRING = &STR(      DSN('&Y') +)
                                    ISREDIT LINE_BEFORE .LABELB = +
                                        "&STRING"
                                    SET DSN&X =
                                END
                            SET X = &X + 1
                            DO WHILE &X < &NUMDSN
                                SET Y = &&DSN&X
                    SET STRING = &STR(          &STR('&Y') &STR(&PLUS))
                                ISREDIT LINE_BEFORE .LABELB = "&STRING"
                                SET DSN&X =
                                SET X = &X + 1
                            END
                            IF &X = &NUMDSN THEN +
                                DO
                                    SET Y = &&DSN&X
                        SET STRING = &STR(          &STR('&Y')&RPAREN +)
                                    ISREDIT LINE_BEFORE .LABELB = +
                                        "&STRING"
                                    SET DSN&X =
                                END
                        END
                    IF &DISP >     THEN +
                        DO
                            IF &UNIT =     AND +
                               &SPACE =    THEN +
                                SET PLS =
                            SET STRING = &STR(      &DISP &PLS)
                            ISREDIT LINE_BEFORE .LABELB = '&STRING'
                            SET DISP =
                        END
                    IF &UNIT >     THEN +
                        DO
                            IF &SPACE =    THEN +
                                SET PLS =
                            SET STRING = &STR(      UNIT(&UNIT) &PLS)
                            ISREDIT LINE_BEFORE .LABELB = '&STRING'
                            SET UNIT =
                        END
                    IF &SPACE >     THEN +
                        DO
                            SET STRING = &STR(      &SPACE)
                            ISREDIT LINE_BEFORE .LABELB = '&STRING'
                            SET SPACE =
                        END
                END
    END

CONTINUE: +
ISREDIT FIND P'=' NEXT 1 X

IF &LASTCC = 0 THEN GOTO LOOP

SET STRING = &STR( )
ISREDIT LINE_BEFORE .LABELB = '&STRING'

SET STRING = &STR(&CALL)
ISREDIT LINE_BEFORE .LABELB = "&STRING"

SET STRING = &STR( )
ISREDIT LINE_BEFORE .LABELB = "&STRING"

CLOSFILE TEMPFREE
FREE DDNAME(TEMPFREE)

ISREDIT COPY $&SYSUID BEFORE .LABELB

ISREDIT LABEL .ZCSR = .LABELC

ISREDIT CHANGE ' CATLG ' ' CATALOG ' .LABELA .LABELB ALL

ISREDIT CHANGE '¦' '&&' .LABELA .LABELB ALL

ISREDIT CHANGE ' )' ')' .LABELA .LABELB ALL

ISREDIT DELETE .LABELB .LABELC

ISREDIT RESET

EXIT

HELPSEC: +
CLEAR
WRITE *** HELP FOR EDIT MACRO 'JCLSPLIT' ***
WRITE
WRITE THE JCLCLIST EDIT MACRO WILL TAKE A JOB STEP OF JCL STATEMENTS AND
WRITE CONVERT IT TO CLIST STATEMENTS (I.E. 'ATTRIB', 'ALLOC', 'CALL',
WRITE ETC.).
WRITE
WRITE BASIC SYNTAX :
WRITE
WRITE COMMAND ===> JCLCLIST
WRITE
WRITE THE JOB STEP TO BE CONVERTED MUST BE 'EXCLUDED' (SEE EDIT LINE
WRITE COMMAND HELP FOR HOW TO 'EXCLUDE' A LINE IN AN ISPF EDIT SESSION).
WRITE
WRITE THE FIRST LINE EXCLUDED MUST CONTAIN THE 'EXEC' JCL STATEMENT WITH
WRITE THE 'PGM=' PARAMETER (A JOB STEP WHICH EXECUTES A PROC CANNOT BE
WRITE CONVERTED).
WRITE
WRITE THE CONVERTED CLIST STATEMENTS DO NOT CONSTITUTE A COMPLETE CLIST.
WRITE RATHER, THEY ARE THE 'ROUGH' EQUIVELENT STATEMENTS TO THE JCL IN
WRITE THE CONVERTED JOB STEP.
WRITE
WRITE THE CONVERTED JCL STATEMENTS ARE DELETED FROM THE DATASET BEING
WRITE EDITED.
WRITE
WRITE THE FOLLOWING IS AN EXAMPLE OF THE OUTPUT RECEIVED FROM CONVERTING
WRITE A SIMPLE JOB.
WRITE
WRITE ORIGINAL FILE :
WRITE COMMAND ===>
WRITE 000001 //TFDTDALW JOB (FCEC33,L20A),
WRITE 000002 //             'DAVID LEIGH',
WRITE 000003 //             CLASS=S,
WRITE 000004 //             MSGCLASS=Y,
WRITE 000005 //             NOTIFY=TFDTDAL
WRITE 000006 //JS010   EXEC PGM=WAAPDSUT,
WRITE 000007 //             PARM=ABEND
WRITE 000008 //SYSUT1    DD DSN=PCWCA.PWBUF.RB08.HIERARCH(0),
WRITE 000009 //             DISP=(SHR,KEEP,KEEP)
WRITE 000010 //SYSUT2    DD DSN=TCWCA.TWBUF.RB08.HIERARCH,
WRITE 000011 //             DISP=(NEW,CATLG,DELETE),
WRITE 000012 //             UNIT=PERMDA,
WRITE 000013 //             SPACE=(TRK,(1,1),RLSE),
WRITE 000014 //             DCB=(RECFM=FB,LRECL=2376,BLKSIZE=21384)
WRITE 000015 //SYSPRINT  DD SYSOUT=*
WRITE 000016 //SYSUDUMP  DD SYSOUT=*
WRITE
WRITE RESULTING FILE :
WRITE
WRITE 000001 //TFDTDALW JOB (FCEC33,L20A),
WRITE 000002 //             'DAVID LEIGH',
WRITE 000003 //             CLASS=S,
WRITE 000004 //             MSGCLASS=Y,

WRITE 000005 //             NOTIFY=TFDTDAL
WRITE 000006
WRITE 000007 FREE DDNAME(SYSUT1)
WRITE 000008 ALLOC DD(SYSUT1) &STR(&PLUS)
WRITE 000009       DSN(PCWCA.PWBUF.RB08.HIERARCH(0)) &STR(&PLUS)
WRITE 000010       SHR KEEP
WRITE 000011
WRITE 000012 FREE ATTRLIST(ATTRIB2)
WRITE 000013 ATTRIB ATTRIB2 OUTPUT &STR(&PLUS)
WRITE 000014        RECFM(F B) &STR(&PLUS)
WRITE 000015        LRECL(2376) &STR(&PLUS)
WRITE 000016        BLKSIZE(21384)
WRITE 000017
WRITE 000018 FREE DDNAME(SYSUT2)
WRITE 000019 ALLOC DD(SYSUT2) &STR(&PLUS)
WRITE 000020       DSN(TCWCA.TWBUF.RB08.HIERARCH) &STR(&PLUS)
WRITE 000021       NEW CATLG &STR(&PLUS)
WRITE 000022       UNIT(PERMDA) &STR(&PLUS)
WRITE 000023       SPACE(1,1) TRACKS RELEASE &STR(&PLUS)
WRITE 000024       USING(ATTRIB2)
WRITE 000025
WRITE 000026 FREE DDNAME(SYSPRINT)
WRITE 000027 ALLOC DD(SYSPRINT) &STR(&PLUS)
WRITE 000028       DUMMY
WRITE 000029
WRITE 000030 FREE DDNAME(SYSUDUMP)
WRITE 000031 ALLOC DD(SYSUDUMP) &STR(&PLUS)
WRITE 000032       DUMMY
WRITE 000033
WRITE 000034 CALL 'SYS2A.LINKLIB(WAAPDSUT)' 'PARM=ABEND'
WRITE
WRITE AS YOU MAY KNOW, CLISTS CANNOT HANDLE RELATIVE GENERATION NUMBERS
WRITE LIKE THE ONE IN SYSUT1.  THEREFORE, THAT WOULD BE ONE THING TO
WRITE CHANGE PRIOR TO RUNNING THIS AS A CLIST.
WRITE
WRITE THE JOB CARD INFORMATION AND OTHER REMAINING JCL STATEMENTS WOULD
WRITE HAVE TO BE REMOVED.
WRITE
WRITE 'JCLCLIST' WILL ALSO CHANGE DD'S WITH "SYSOUT=" TO "DUMMY".  THESE
WRITE MAY NEED TO BE DEALT WITH ON AN INDIVIDUAL BASIS.
WRITE
WRITE THE PROGRAM BEING EXECUTED WILL BE ASSUMED TO BE FROM THE SYSTEM
WRITE LIBRARY 'SYS2A.LINKLIB'.  INDIVIDUALLY WRITTEN PROGRAMS, AND THOSE
WRITE FROM VENDOR SOFTWARE PRODUCTS MAY NOT RESIDE IN THIS LIBRARY.
WRITE THEREFORE, THE 'CALL' STATEMENT MAY NEED TO BE CHANGED.  IF THE
WRITE CALLED PROGRAM CONTAINS PARAMETERS WITH SINGLE QUOTES ("'"), MORE
WRITE QUOTES MAY NEED TO BE ADDED DUE TO WAY CLISTS HANDLE SINGLE
WRITE QUOTES.
WRITE
WRITE AS YOU CAN SEE, THIS IS JUST A TOOL TO AID IN CONVERSION FROM JCL
WRITE STATEMENTS TO CLIST STATEMENTS.  (IT CAN BE USED EFFECTIVELY TO
WRITE CONVERT A BACKROUND UTILITY TO A FOREGROUND ONE IN A SHORTER
WRITE AMOUNT OF TIME).  IT IS NOT, HOWEVER, A COMPLETE CLIST COMMAND
WRITE LANGUAGE GENERATOR.  IT NEEDS MANUAL REVIEW AND ADJUSTMENT OF THE
WRITE OUTPUT.
WRITE
WRITE *** END OF HELP *** NO PROCESSING PERFORMED ***
EXIT
            


Documentation


 This edit macro converts JCL code into equivilent (or close) TSO CLIST code.
 To execute it, you edit the JCL to be converted; "exclude" the lines which
 comprise 1 job step (the first excluded line MUST be the EXEC card); type
 JCLCLIST on the command line and press ENTER.  The JCL statements will then be
 REPLACED by the CLIST statements (i.e. don't do this to JCL you want to save...
 make a copy 1st !.)  If a dataset name has a relative GDG number, it will not
 be converted, but must be dealt with prior to running the CLIST as relative GDG
 #'s don't work in CLIST's yet.  Steps with STEPLIB will convert to the TSO
 TASKLIB facility.  Steps without a STEPLIB will convert to the TSO CALL command
 and assume the module is in SYS2A.LINKLIB.
            


Leave a Reply

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