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