Professional Documents
Culture Documents
Overview
This Rexx tool can be used for formatting and alignment of the JCL statements to follow JCL
coding standards. (I.e. to align the 'JOB','DD' and 'EXEC' statement in 10th column). The tool can be
executed by the line command ‘TSO JCLALIGN’. It gets the location of the JCL in the format of
‘PDS(MEM)' and aligns the JCL statement according to the JCL coding rules
This Rexx tool can be used for formatting and alignment of the JCL statements to follow JCL
coding standards
This will ask for the PDS and member name where the JCL is present
The tool will align the JCL statement according to the JCL coding rules
The below screen shot shows the JCL after alignment
SOURCE CODE OF THE REXX TOOL WHICH ALIGNS JCL STATEMENTS
Given below is the source code of the Rexx tool to align JCL statements
/****REXX***/
/****PROGRAMMMING********************************************/
/****FINDING NO OF RECORDS*************************************/
LEN=DATA.0
/****UPPERCASING ALL THE RECORDS***************************/
DO I = 1 TO LEN
UPPER DATA.I
PARSE VAR DATA.I WORD1 WORD2 WORD3
IF (WORD2 = 'JOB') | (WORD2 = 'DD') | (WORD2 = 'EXEC') THEN
DO
LEN1 = LENGTH(WORD1)
DO
IF LEN1 < 10 THEN
DO
LEN3 = 10 - LEN1
DO J = 1 TO LEN3
IF WORD2 = 'JOB'
THEN WORD1 = WORD1||'X'
ELSE WORD1 = SUBSTR(WORD1,1,10' ')
END
END
IF LEN1 > 10 THEN
IF POS('.',WORD1) = 0 THEN
DO
SAY 'IN CORRECT DD/JOB NAME IN ' DATA.I
WORD1 = SUBSTR(WORD1,1,10)
END
IF WORD2 = 'JOB' THEN WORD2 = 'JOB'
IF WORD2 = 'DD' THEN WORD2 = 'DD'
IF WORD2 = 'EXEC' THEN WORD2 = 'EXEC'
DATA.I = WORD1 WORD2 WORD3
END
END
END