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 is the function of the steplib dd statement?

0 Answers  


wht is the d/f between positional parameter n keyword parameter ?

1 Answers  


Could anyone please suggest me what is the maximum length of data that can be pass as input in //sysin dd * This was asked in interview. TIA

3 Answers   VC, Wipro,


i have 5 steps to execute in that i want to skip 3nd step and start execute from forth step how can u do this.

7 Answers   Syntel,


what is use of disp parameter in dd statement?

0 Answers   IBM,






How I sort the records in a file and copy the first 10 records to another file

5 Answers  


Why do you use a control card?

3 Answers   IBM, iNautix,


When a dataset is UNCATALOGED in a JOBSTEP, how to get its UNIT and VOL in JCL to refer in subsequent steps ?

1 Answers   IBM,


How do you skip a particular step in a proc/JOB?

5 Answers   CSC, CTS,


1) SORT FIELDS=(20,4,CH,D,10,3,CH,D) OUTREC FIELDS=(7:20,4,C' FUTURE ',20,2,10,3,1Z,1,9,13,7, 24,57,TRAN=LTOU,6X'FF') This example illustrates how a fixed-length input data set can be sorted and reformatted for output. The SORTIN LRECL is 80 bytes. The reformatted output records are fixed length with a record size of 103 bytes. SOLRF (the IBM-supplied default) is in effect, so unless the SORTOUT LRECL is specified or available, it will automatically be set to the reformatted record length of 103. in the above example i have some doubts that a) sort fields=(20,4,CH,D,10,3,CH,D) -what exactly it does and this fields related to output record fields or input record fields b)outrec used to refprmat the records after sorting that means could please reply me as soon as possible Thanks. Venkat

1 Answers   Tesco,


i have step1,step2,step3 from where can i start coding cond parameter ?

2 Answers   Verizon,


shall we concordinate two different length dataset in to a new date set.

6 Answers  


Categories