How do you handle empty files in a JCL ?
Answers were Sorted based on User's Feedback
Answer / guest
Yes, we can handle empty file in JCL, there is utility
provided by IBM "UT939" ,eg //STEP1 EXEC PGM=UT939,
IF step1 return code is 4 then there is empty file and else
if return code is 0 (for non-empty file). We can handle
this with COND parameters whether to execute next step or
not if file is empty.
SUPPOSE WE DON'T WANT TO EXECUTE THEN
eg //STEP2 EXEC PGM=XXX,
COND=(4,EQ,STEP1)
| Is This Answer Correct ? | 6 Yes | 1 No |
Answer / bharani
Read first record of the file using IDCAMS, It will return
the cc=0 if the file is not empty, otherwise it returns
CC=4.
| Is This Answer Correct ? | 5 Yes | 3 No |
My JCL has 4 steps that execute PROC’s P1, P2, P3 and P4 as shown below //P1 EXEC PROC=P1 //P2 EXEC PROC=P2 //P3 EXEC PROC=P3 //P4 EXEC PROC=P4 There are four steps S1, S2, S3 and S4 in each PROC’s (i.e. P1, P2, P3 and P4) I want to execute only step S2 of PROC P2 and no other steps or PROC’s. How do you achieve this?
Explain how can an in-stream dataset be terminated?
how to see the latest generation in gdg?
what is the difference between perform varying and perform
How many types of parameters are used in JCL and what are mandatory parameters of JOB statement.
What is maximum length of block size?
5 Answers Cap Gemini, Kanbay, TCS,
i just need the first and last record from a sequencial file?how
Can you delete the GDG base without deleting GDG generations ?
How many parameters are there to a DISP statement and what are their uses ?
a job have 5 steps and it will executes a proc which have 5steps in it. now i have to execute step3 only when step2 of proc executes successfully
How to read and write a single record into a file. I would like to use it to enter a single 8-character piece of information and use it to put it into a variable for processing in JCL. Thank you
i have a jcl calling proc which has 10 steps, i want to execute from step5 to step10, where can i code RESTART and COND parameter?