Skip to Content

TheBlogReaders.com

Salesforce.com, PHP, MySQL, Javascript, Ajax, Htacces

JCL Interview Questions and Answers For Freshers Part-2

Be First!

jcl11.How to do automated RESTART when a job abends?
Using RD parameter in JOB/EXEC statement. The abend codes for which RESTART need to be performed can be mentioned in the SCHEDxx member of the IBM system parmlib library.

12.A JCL has 10 steps. How to run step3 and step7 (only) without using COND parameter or IF-THEN-ELSE?
Using IEBEDIT in a JCL, selected steps of another JCL can be run. In the above JCL, the input JCL with 10 steps is present in MYDATA.URMI.JOBS(INPUTJOB). STEP3 and STEP7 is specified in SYSIN of IEBEDIT, so that those two steps are run.

//STEP001 EXEC PGM=IEBEDIT
//SYSUT1 DD DSN=MYDATA.URMI.JOBS(INPUTJOB),DISP=SHR
//SYSUT2 DD SYSOUT=(*,INTRDR)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
EDIT TYPE=INCLUDE,STEPNAME=(STEP3,STEP7)
/*
13.When does a dataset go uncataloged?
When it is defined with DISP = (NEW,KEEP) at the time of creation. In case of a GDG, least recent generation is uncataloged if the GDG base had been defined with NOEMPTY parameter when the LIMIT is reached. All generations are uncataloged when coded with EMPTY.

14.How can a GDG base be created in a JCL. What is the difference between EMPTY and SCRATCH parameter while defining/altering GDG base?
GDG base can be created using IDCAMS utility. EMPTY uncataloges all the generations when the LIMIT is reached. SCRATCH physically deletes the generation, when it is uncataloged. (LIMIT specifies the maximum number of versions that the GDG base can hold).

15.A dataset contains 2500 records. How can the last 1500 records copied to an output file?
In the SORT/ICETOOL program, SKIPREC = n can be used, which skips the first n records and then copies the rest to the output file.

//JSTEP020 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT = *
//DFSMSG DD SYSOUT = *
//IN1 DD DSN = MYDATA.URMI.SKIPREC,DISP=SHR
//OUT1 DD SYSOUT = *
//TOOLIN DD *
COPY FROM(IN1) TO(OUT1) USING(CTL1)
/*
//CTL1CNTL DD *
SORT FIELDS = COPY
SKIPREC = 1000
/*
16.How can a file of 3n records be split into 3 files each containing n records?
STARTREC and ENDREC restricts the READ from the input file on the specified record number.

//URMISPLT EXEC PGM = SORT
//SORTIN DD DSN=MYDATA.URMI.FILEIN,DISP=SHR
//SORTOF01 DD DSN = MYDATA.URMI.FILEOUT1,
// DISP = (NEW,CATLG,DELETE),
// RECFM = FB, LRECL = 50
//SORTOF02 DD DSN = MYDATA.URMI.FILEOUT2,
// DISP = (NEW, CATLG, DELETE),
// RECFM = FB, LRECL = 50
//SORTOF03 DD DSN = MYDATA.URMI.FILEOUT3,
// DISP = (NEW, CATLG, DELETE),
// RECFM = FB, LRECL = 50
//SYSPRINT DD SYSOUT = *
//SYSOUT DD SYSOUT = *
//SYSUDUMP DD SYSOUT = *
//SYSIN DD *
SORT FIELDS = COPY
OUTFIL FILES = 01,ENDREC=100 //*assuming input file has 300 records.
OUTFIL FILES = 02, STARTREC = 101, ENDREC = 200
OUTFIL FILES = 03, STARTREC = 201
//*
17.When can a job time-out occur? How to overcome that?
A job time-out error can occur when the program takes more time than the time limit for the specified class. This is called a S322 abend. This error is encountered when there are some looping errors in the program and it does not reach completion.
If the data processed in the program is genuinely huge and needs more time than the class limit, then the TIME parameter can be coded as TIME = 1440 to get infinite time until job completion.

18.In a JCL, a large volume dataset is loaded to a table using BMCLOAD in STEP1 and an image copy of the loaded table is taken using BMCCOPY in step2. Step2 abends because the image copy dataset cannot hold the volume of the table. How can this be rectified?
The SPACE parameter of the image copy dataset can be increased based on the volume of the table and the job can be restarted from step2.

19.If the submitter of a job wants to inform another user about the job completion, how can it be done?
NOTIFY = userid of the person (not the submitter) can be specified in the JOB statement so that the user gets a notification with the return code upon job completion. But the job log is present in the spool under the submitter’s userid only.

20.How can a FB file converted to VB file using SORT program?
FTOV option in SORT helps in converting FB to VB file.

//URMIFTOV EXEC PGM = SORT
//SORTIN DD *
123*******
4560000000
123****123
789
//SORTOF01 DD DSN = MYDATA.URMI.FILEOUT1,
// DISP = (NEW, CATLG, DELETE),
// RECFM = VB, LRECL = 54
//SORTOF02 DD DSN = MYDATA.URMI.FILEOUT2,
// DISP = (NEW, CATLG, DELETE),
// RECFM = VB, LRECL = 54
//SORTOF03 DD DSN = MYDATA.URMI.FILEOUT3,
// DISP = (NEW, CATLG, DELETE),
// RECFM = VB, LRECL = 54
//SYSPRINT DD SYSOUT = *
//SYSOUT DD SYSOUT = *
//SYSUDUMP DD SYSOUT = *
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES = SORTOF01, FTOV, VLTRIM = C’*’ //*removes trailing ‘*’
OUTFIL FNAMES = SORTOF02, FTOV, VLTRIM = X’40’//*removes trailing space
OUTFIL FNAMES = SORTOF03, FTOV, VLTRIM = X’00’//*removes trailing zeros

(166)

Previous
Next

Leave a Reply