Thursday, September 12, 2019

How to find file is empty or not

We need to use a simple control card which will check the input file record count.

//JOB001AB JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//INPUT DD DSN=JOB001.RATNESH.INFILE, DISP=SHR
//SYSIN DD *
  PRINT INFILE(INPUT) COUNT(1)
/*

If the RC=00 then the file is not empty. If RC=04, THEN it is empty.

No comments:

Post a Comment