How to check empty file in jcl?

Answer Posted / muttaiah

There are so many utilities(ICetool, IDcams, Iebgener)
which we can make use to check whether a file is empty.

//Jobcard
//stepname exec pgm=idcams
//dd1 dd dsn=xxx.pds,disp=shr
//sysin dd *
print infile(dd1) count(1)
/*

Here the job will give a return code '0' if the file has
atleast 1 record and RC-4 if there are no records

Suppose you want to check whether any records are there
apart from header and trailer. then Make the count as Count
(3).

//sysin dd *
print infile(dd1) count(3)
/*

Is This Answer Correct ?    16 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

2072


Step 1 RC 4 Step 2 Step 3 I want to know the COND parameter which can be coded in step 2 or 3. Step 2 should be executed based on Step 1 RC and Step 3 should not be executed based on step 1's RC

4549


What is the job entry system used in your project? based on what criteria the sequence of jobs are picked if priority is not mentioned in the job card?

2010


Mention the types of job control statements?

907


How can values be passed from the job stream to an executable program?

1092


why should SYSIN DD * statement should not be included inside a PROCedure snippet??? please answer this.. i need to know.

2179


Explain about ISPF/TSO Commands

1567


what EXEC statement is and what is the syntax of EXEC statement used in JCL?

872


How to compare two files in SYNCSORT and on the mismatch record should be deleted from second file.

5294


What are the difference between jcl and jes?

1279


What are the parameter we cannot use in procedure? How many instream we can write in single jcl?

770


What are steplib and joblib?

890


What do you understand by the term “keyword” with respect to jcl and what is the opposite of the term?

866


what are the statements that are not valid to be included in an include statement?

1074


What is jcl in mainframe?

932