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

how can we override data definitions in jcl. can any one give detailed example

3 Answers   TCS,


We can use PASS with permanent datasets also. THEN Which is the condition in which we may use PASS (instead of KEEP) with permanent data sets, while there is no need to specify UNIT and VOL for them like temporary data sets (in cas we use KEEP for permanent data sets) ?

0 Answers   IBM,


What are the valid DSORG values ?

3 Answers  


A maximum of 100 chars can be passed to Cobol through Parm in JCL, If we want to pass more than 100 Chars how we can do it ?

4 Answers   IBM,


How to remove the spaces at end of each record in the output file Via COBOL program? note: The file has a VB length ----TRY

0 Answers  






Statement1 "We can not use UNCATLG in SMS managed VSAM datasets" Statement2 "We can not delete a SMS managed data set without UNCATLG it" (P-353, Saba Zameer book) Then how do we delete SMS managed VSAM datasets ?

1 Answers   IBM,


how to increase the space of a dataset in instream procedure.

1 Answers   HCL,


proc1,proc2,up to proc5 is there if i want to call proc1 and proc5how can u write the code

2 Answers  


I've one sequential file, that file size is LREC=100 (File contain Records like 1 to 100). Now I was increase the file size is LREC=102. My question is I want insert 00 (Two Zeros) in to the new file (That output file looks like : 00123 up to 100). How will write the SORT card in JCL. Please let me know.

2 Answers   Syntel,


How to code these statements in JCL: CLEANUP INITIAL(NO) RESTART(NO) DYNALLOC(NO) job definition..?

0 Answers  


What are SD37, SB37, SE37 abends?

4 Answers  


What does the TIME parameter signify ? What does TIME=1440 mean ?

6 Answers   Accenture, TCS,


Categories