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

How can a fb file convert to vb file using sort program?

794


Suppose there are 2 Input files Infile-1 and Infile-2. Both the Files contain Employee Records. You need to compare both the files and Write the Common Records in third file named Outfile. How can we do this using File-Aid?

2207


how you can access an uncataloged dataset in a JCL?

639


Differentiate between addressing mode and run mode.

606


How jcl is used for testing batch programs?

710






what is use of dcb parameter in dd statement?

762


What is the function of dd name parameter with a 2 part structure; audit.report?

689


What is the purpose of dd * statement in jcl?

785


Explain about LMFREE�free data set from its association with data ID

984


Describe the various parameters utilized in the creation of a gdg?

669


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

1755


I want to join to input files and write the matching fields on to an output file but i dont want the output file a sorted one

1914


Mainframes gets a text file that contains the name of the file. Now using JCL i want to locate that file name in the mainframe system and perform further processing. Please tell how to proceed

1957


what is the resolution for sb37 error

7677


I have many files which i am receiving from client everyday. I have one step for every file to check for empty or not. Here client gives 30 files i need to check for every file for empty or not and i need to perform 30 steps. Can I do it in single step. Dynamically i need to change the File name in my step.

724