Comment-Uncomment JCL

Comment/ Un comment  multiple lines in JCL

 

The following CLIST code can be used to comment/uncomment JCL code with ease. The instructions to use this are provided in the comments.

/**********************************************************************
/* TITLE      : JCOM
/*-------------------------------------------------------------------
/* FUNCTION   : TO BLOCK COMMENT OR UNCOMMENT THE JCL
/*-------------------------------------------------------------------
/* AUTHOR     : mainframewizard.com
/*-------------------------------------------------------------------
/* DESCRIPTION: THIS CLIST COMMENTS OR UNCOMMENTS THE DESIRED NUMBER
/*            : OF JCL STATEMENTS.
/*            :
/*            :
/*-------------------------------------------------------------------
/* HOW TO RUN : COPY THIS MEMBER TO THE PDS ALLOCATED TO SYSPROC. OPEN
/*            : THE JOB IN WHICH YOU WISH TO COMMENT OR UNCOMMENT.
/*            : TYPE 'JCOM' WITH PARMETER ON/OFF FOR COMMENTING AND
/*            : UNCOMMENTING RESPECTIVELY ON THE COMMAND LINE AND GIVE
/*            : ANY OF THE COMMANDS V,VN,VV AT THE LINE COMMAND AREA
/*            : WHERE V IS A SINGLE LINE COMMAND, N IS THE NUMBER TO BE
/*            : GIVEN TO COMMENT N NUMBER OF LINES, VV IS BLOCK COMMAND
/*            : YOU CAN USE THIS AS ANY OTHER LINE COMMAND LIKE C,R,M
/**********************************************************************
ISREDIT MACRO (PARM1) NOPROCESS
ISPEXEC CONTROL ERRORS RETURN
ISREDIT PROCESS RANGE V
IF &LASTCC >= 16 THEN EXIT CODE(&LASTCC)
  ISREDIT (CMD) = RANGE_CMD
ISREDIT FIND FIRST '//' 1
/**********************************************************************
/********* VALIDATING THAT IT IS A JCL BEFORE SCANNING  ****************
/**********************************************************************
IF &LASTCC NE 0 THEN +
DO
SET &ZEDSMSG = &STR(NOT VALID JCL)
ISPEXEC SETMSG MSG(ISRZ001)
GOTO ENDCLIST
END
/**********************************************************************
/*STORING FIRST AND LAST LINE NUMBERS
/**********************************************************************
ISREDIT (FIRST) = LINENUM .ZFRANGE
ISREDIT (LAST) = LINENUM .ZLRANGE
/**********************************************************************
/*GETTING TOTAL NO OF LINES
/**********************************************************************
SET TOT_LINES=&LAST - &FIRST + 1
 IF &STR(&CMD) =  THEN +
   DO
    SET &ZEDSMSG = &STR(LINE COMMAND 'V' PENDING)
    ISPEXEC SETMSG MSG(ISRZ001)
    EXIT CODE(12)
   END
 IF &STR(&CMD) = &STR(V) THEN +
   DO
    ISREDIT X  '//*' .ZFRANGE .ZLRANGE ALL
    ISREDIT (EXLN,EXCNT) = EXCLUDE_COUNTS
   ISREDIT C '/*' '//*' .ZFRANGE .ZLRANGE NX ALL
   ISREDIT X  '//*' .ZFRANGE .ZLRANGE ALL
     IF &PARM1=ON | &PARM1= THEN +
       DO
        IF &EXCNT=&TOT_LINES THEN +
          DO
           SET &ZEDSMSG = &STR(LINES UNCOMMENTED)
           ISPEXEC SETMSG MSG(ISRZ001)
           ISREDIT C '//*' '//' .ZFRANGE .ZLRANGE ALL
           ISREDIT RESET
           ISREDIT LOCATE .ZFRANGE
           EXIT CODE(1)
          END
        SET &ROWNO=&FIRST
        ISREDIT C '//' '//*' .ZFRANGE .ZLRANGE NX ALL
          DO WHILE &ROWNO<&EVAL(&LAST+1)
            ISREDIT (CSRDATA) = LINE &ROWNO
            SET DOUBLE_SLASH=&SYSINDEX(&STR(//),&STR(&CSRDATA),1)
              IF &DOUBLE_SLASH=0 THEN +
                DO
                ISREDIT SHIFT &ROWNO ) 3
                ISREDIT LINE &EVAL(&ROWNO) = LINE +  '//*'
                END
            SET ROWNO= &EVAL(&ROWNO +1)
          END
           SET &ZEDSMSG = &STR(LINES COMMENTED)
           ISPEXEC SETMSG MSG(ISRZ001)
       END
     IF &PARM1=OFF THEN +
       ISREDIT C '//*' '//' .ZFRANGE .ZLRANGE ALL
     ISREDIT RESET
     ISREDIT LOCATE .ZFRANGE
   END
EXIT CODE(1)
END
ENDCLIST: +
ISREDIT RESET
ISREDIT LOCATE .ZFRANGE
EXIT CODE(1)
END



 

Please provide your feedback/suggestions regarding this tutorial on contact form.  For other automation tutorials visit menu item Automation.

Comments

Web Site Software Examples

Quite nice software. Thanks for providing, Larry

Click the +1 button  below to share it with your friends and colleagues

 

Share this if you liked it!

 

Disclaimer

Navigation