Is there a way to check for an empty file in JCL other than
using IEBCOMPR and the command PRINT COUNT(1)?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the function of a dd statement?

709


How do you create a temporary dataset?

664


What are some jcl statements that are not allowed in procedures?

728


How is a type of file defined in the jcl that executes the cobol program?

714


What is the function of //jcllib statement?

810






Explain the function of a dd statement?

659


what is the resolution for sb37 error

7716


What parameters can be used to limit the number of records written to a sysout dataset?

750


Suppose I have five jobs to do. But I want to hold one?

660


How to resolve the error "WER488A JOIN CAPACITY EXCEEDED" I am using SYNCSORT with JOINKEYS to compare 2 files. I am Getting error - > WER488A JOIN CAPACITY EXCEEDED There are 2 files to be compared with about 2 million records each. LRECL is 3665. Can somebody give a pointer as to how to resolve this problem? I am using SYNCSORT with JOINKEYS to compare 2 files. I am Getting error - > WER488A JOIN CAPACITY EXCEEDED There are 2 files to be compared with about 2 million records each. LRECL is 3665. Can somebody give a pointer as to how to resolve this problem?

7606


What is the difference between the positional and keyword parameters? Give examples.

712


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) ?

1769


hello friends ,i have exam in Hsbc,pls any on send me placement papers and technical questions on mainframes,thank u

1668


How to execute 2nd and 4th steps among 5 steps in jcl proc?

750


how can a gdg base be created in a jcl. What is the difference between empty and scratch parameter while defining/altering gdg base?

789