Is there a way to check for an empty file in JCL other than
using IEBCOMPR and the command PRINT COUNT(1)?
Answers were Sorted based on User's Feedback
using the Uitility IEBPTPCH
If RC=04 no data ie the file is empty
rc=00 file is not empty
| Is This Answer Correct ? | 12 Yes | 1 No |
Answer / arul anand.a
//STEP01 EXEC PGM=IDCAMS
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//INDD DD DSN=FILE1,
// DISP=SHR
//OUTDD DD DSN=FILE2,
// DISP=SHR,
REPRO INFILE(INDD) OUTFILE(OUTDD) COUNT(1)
THIS WILL GIVE RC = 04 IF THE INFILE IS EMPTY.
OTHERWISE IT WILL GIVE 0.
| Is This Answer Correct ? | 10 Yes | 1 No |
Answer / saikat
By using a simple selcopy we can determine whether the file
is empty or not. IF file is empty then we can set the
return code of the step in the selcopy code.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / arun
Use the SORT utility with NULLOUT=RC04 OR RC16..If the file
is empty the step returns either 04 or 16 depending on what
you coded.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / nbohr02
By adding an ICETOOL (DFSORT) step you can force a return
code on empty with the COUNT (dd) EMPTY this will set RC to
12 so your Batch scheduler may not like it.
| Is This Answer Correct ? | 3 Yes | 2 No |
Answer / nbohr02
You could write a REXX EXEC to read your required files then
have the exec sumbit the job to the internal reader with
either omitted steps or condition step coding. The IEBPTPCH
technique will work too.
| Is This Answer Correct ? | 0 Yes | 3 No |
what sort card you will use to copy the data from one dataset to another dataset?
How system will identify whether user wants to create PS or PDS? If answer is SPACE parameter then why we need to pass ps or po as dataset organisation while creation
A dd statement consists of 4 fields. Name them?
Suppose I have five jobs to do. But I want to hold one?
Name what parameter directs the output of the job log dataset?
with out sorting how to copy records from one file to another file using jcl.Mean I have one input file in which the record are like 1,6,5,4,2,3(for example) and i want to copy to output file from top to bottom(without sorting) like 3,2,4,5,6,1.so I want the JCL for this.cna any one can answers?
There are two input sorting files and there is a need to create one sort out file which contains data of both input files. What is the sort card for this. Write a sample JCL for this using a control card?
once we submitted the job to the operating system, how can we cancel the job before execution?
What is the meaning of the EXEC statement keyword, COND? What is its syntax?
what is the JCL statement consists of?
which are the parameters mandatory in job card ?
List the different components of jcl statement?