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 |
wht is sysudump n sysout,sysprint ?
How do you override a parameter in Positional parameters?
a input file contains 1000 records, how to move the first 500 record into one out put file and how to move to second 500 records to anothere output file
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?
What is QSAM error usually when it is occurs?
what are JCLLIB and STEPLIB in JCL?
How to Enter The Spool Area In Real Time?
What do you feel makes a good program?
In My job I have 15 procs.and in each proc i have 3 steps. i want to execute 3 step in proc 10.is it possible? if possible how?
what is a cataloged procedure ?
Name the statement which can be used to send data to another mvs jes3 node?
how would you create a temporary dataset? And where will you use them?