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



Is there a way to check for an empty file in JCL other than using IEBCOMPR and the command PRINT C..

Answer / jayaprabhu

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

Is there a way to check for an empty file in JCL other than using IEBCOMPR and the command PRINT C..

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

Is there a way to check for an empty file in JCL other than using IEBCOMPR and the command PRINT C..

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

Is there a way to check for an empty file in JCL other than using IEBCOMPR and the command PRINT C..

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

Is there a way to check for an empty file in JCL other than using IEBCOMPR and the command PRINT C..

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

Is there a way to check for an empty file in JCL other than using IEBCOMPR and the command PRINT C..

Answer / mdv

Simple Sort job'll do.

Give PARM='nullout=rc4'

Is This Answer Correct ?    0 Yes 0 No

Is there a way to check for an empty file in JCL other than using IEBCOMPR and the command PRINT C..

Answer / d

October_tare.pre-ounced soft continúe dis the great

Is This Answer Correct ?    0 Yes 0 No

Is there a way to check for an empty file in JCL other than using IEBCOMPR and the command PRINT C..

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

Post New Answer

More JCL Interview Questions

What does a disposition of (new,catlg,keep) for a dsn mean?

0 Answers  


IF we are calling a PROC from Jcl...This Proc have 3 steps in it and we want to execute only the second step using the JCL, How to do it?? Please give the answer ASAP:)

8 Answers  


How do you pass parameters to the program as the job is being executed ?

2 Answers  


How to execute 300 steps in a Job?

15 Answers   Accenture, Zensar,


i have a string of 80 chars i want to replace 4th char with "a"?

3 Answers   CSC,






if time parameter is not coded on the job card and job step then what is the default time assigned to the entire job and for each step in the job by the systyem ?

2 Answers   ITC Infotech,


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,


how can handle the s0c4 abend???

3 Answers  


When The Define Jcl Is Not Available, How Can You Get Information About A Vsam File's Organisation ?

0 Answers   IBM,


When space is allocated for an output dataset, what units can be used?

0 Answers  


What is the meaning of keyword in JCL? What is its opposite?

1 Answers  


what is the job entry system used in your project?

3 Answers  


Categories