I have four steps in jcl they are STEP1,STEP2,STEP3 and STEP4.
Can it possible to run the reverse order like step4 first
then step3,step2,step1?

Answers were Sorted based on User's Feedback



I have four steps in jcl they are STEP1,STEP2,STEP3 and STEP4. Can it possible to run the reverse o..

Answer / muttaiah

JCL processes steps sequentially i mean to say we have ways
to skip steps but we don't have a way to run steps in
reverse or random way. EX; i have a job with steps 1, 2, 3.
Executing steps 3, 1, 2 is not at all possible.

If you want to do so then you have to write a new JCL with
IEBEDIT utility. Here is the JCL.

//JOBCARD AS PER INSTALLATION
//STEP1 EXEC PGM=IEBEDIT
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=FILE1,DISP=SHR
//SYSUT2 DD SYSOUT=(*,INTRDR)
//SYSIN DD *
TYPE=INCLUDE,STEPS=(STEP4,STEP3,STEP2,STEP1)
/*
//

Here file1 can either be PDS/PS that holds the actual JCL.
Type=Include will copy the steps specified in the sequence
as per STEPS parm

In real time there won't be any scenario as such..If any
interviewer asks this question then blast him with this
answer. Tell him not to waste your time by such questions

Is This Answer Correct ?    44 Yes 2 No

I have four steps in jcl they are STEP1,STEP2,STEP3 and STEP4. Can it possible to run the reverse o..

Answer / atul

This solution is not working.

Is This Answer Correct ?    1 Yes 0 No

I have four steps in jcl they are STEP1,STEP2,STEP3 and STEP4. Can it possible to run the reverse o..

Answer / sitharam

Just correction on above answers, It will work
//JOBCARD AS PER INSTALLATION
//STEP1 EXEC PGM=IEBEDIT
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=FILE1,DISP=SHR
//SYSUT2 DD SYSOUT=(*,INTRDR)
//SYSIN DD *
EDIT TYPE = INCLUDE,STEPNAME=(STEP4,STEP3,STEP2,STEP1)
/*

Is This Answer Correct ?    1 Yes 0 No

I have four steps in jcl they are STEP1,STEP2,STEP3 and STEP4. Can it possible to run the reverse o..

Answer / premadevi

//JOBCARD AS PER INSTALLATION
//STEP1 EXEC PGM=IEBEDIT
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=FILE1,DISP=SHR
//SYSUT2 DD SYSOUT=(*,INTRDR)
//SYSIN DD *
TYPE=EDIT,INCLUDE=(STEP4,STEP3,STEP2,STEP1)
/*
//

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JCL Interview Questions

I have a PDS and want to omit few rows of all members of a PDS. How to do it?

6 Answers   Accenture,


Mainframes gets a text file that contains the name of the file. Now using JCL i want to locate that file name in the mainframe system and perform further processing. Please tell how to proceed

0 Answers  


How gdg are concatenated?

0 Answers  


What is the function of the dd avgrec keyword in sms datasets?

0 Answers  


Is stepname is a MUST and should be unique also for each JOBSTEP ? or system can supply the stepname for a step which is not given a name by the programmer ?

6 Answers   IBM,






if we want to use a gdg which is already created by some job, then how to use the reference of the last generation in a jcl?

0 Answers   IBM,


I have a dataset with record length 40 in production, due to some requirements it was changed to 80. Then how can we know the jobs which are effected by this change and how can we resolve it.

3 Answers   iGate,


What is the meaning of data definition name (ddname) and dataset name (dsname) in the DD statement?

2 Answers  


why jobstep can't be more than 255 and for GDG has max limit 255 . Is there any relation between the two

1 Answers   IBM, Perot Systems,


Can comments be specified at the very beginning of a jobcard? Will the JCL execute?

3 Answers  


I have 15 flat files. each record in the files have the monthly salary for 12 months with the employee number. Now I want to concatenate the 15 files such that for the employee numbers that are common the o/p file should have only one record and the salaries should be concatenated to that record. How can we do it with JCL?

1 Answers  


What is STEPLIB, JOBLIB? What is it used for?

2 Answers  


Categories