How to test thru JCL if any file(PS or VSAM) is empty or
not. I do not want to use any COBOL prog or Ezytrieve and
want to do using utility.

Answers were Sorted based on User's Feedback



How to test thru JCL if any file(PS or VSAM) is empty or not. I do not want to use any COBOL prog ..

Answer / vani

By IDcams its is possible
// STEP EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//FILE1 DD DSN=INPUT-FILE,DISP=SHR
//SYSIN DD *
PRINT INFILE(FILE1)
DUMP COUNT(1)
/*
IF THE FILE IS EMPTY JCL GIVES RC=4

Is This Answer Correct ?    21 Yes 6 No

How to test thru JCL if any file(PS or VSAM) is empty or not. I do not want to use any COBOL prog ..

Answer / ram g

u can use ams command repro thru idcams utility and check
for rc

Is This Answer Correct ?    19 Yes 5 No

How to test thru JCL if any file(PS or VSAM) is empty or not. I do not want to use any COBOL prog ..

Answer / naren

IFEMPTY utility is used to check the file is empty or not,
if the return code of this step is 4 then the file is empty.

Is This Answer Correct ?    15 Yes 5 No

How to test thru JCL if any file(PS or VSAM) is empty or not. I do not want to use any COBOL prog ..

Answer / ekluba

With proper Syntax answer #5 is correct:

//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=???.EMPTY,DISP=SHR
//SYSIN DD *
PRINT INFILE(DD1) COUNT(1)
/*

Is This Answer Correct ?    9 Yes 2 No

How to test thru JCL if any file(PS or VSAM) is empty or not. I do not want to use any COBOL prog ..

Answer / suga

you can use IEBPTPCH utility.it is used to check whether it
is empty or not.If the return code is 4 then the file is
empty.

Is This Answer Correct ?    10 Yes 4 No

How to test thru JCL if any file(PS or VSAM) is empty or not. I do not want to use any COBOL prog ..

Answer / deb

First SORT the input file.
Assume the sorted o/p is in MY.SORT.FILE, then run this step

//CHEKEMTY EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//MYFILE DD DSN=MY.SORT.FILE,DISP=SHR
//SYSIN DD *
PRINT INFILE(MYFILE) CHARACTER COUNT(1)

if the above step returns a RC=4, then the file is
empty

Is This Answer Correct ?    10 Yes 5 No

How to test thru JCL if any file(PS or VSAM) is empty or not. I do not want to use any COBOL prog ..

Answer / nagendra

Hi vani,

When i tried executing ur JCL i am getting this error while
giving JJ.

'DUMP' IS NOT A RECOGNIZED IDCAMS STATEMENT NAME

What shall i do????

Is This Answer Correct ?    5 Yes 2 No

How to test thru JCL if any file(PS or VSAM) is empty or not. I do not want to use any COBOL prog ..

Answer / guruprasad

print command

Is This Answer Correct ?    2 Yes 1 No

How to test thru JCL if any file(PS or VSAM) is empty or not. I do not want to use any COBOL prog ..

Answer / manid

//STEP1 EXEC PGM=IDCAMS
//DD1 DD DSN=FILE1
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
PRINT INFILE(DD1) COUNT(*)
/*

IF STEP1 RETURNS RC=4 THEN FILE1 IS EMPTY FILE

I HOPE THIS WILL HELP YOU

Thanks
ManiD

Is This Answer Correct ?    3 Yes 4 No

How to test thru JCL if any file(PS or VSAM) is empty or not. I do not want to use any COBOL prog ..

Answer / sivakumar

Use comparex/ISRSUPC utility and compare ur file with an
empty file of the same DCB parameter. Retrun code of 28
means the file is empty. return code of 1 means the file is
not empty.

Is This Answer Correct ?    5 Yes 7 No

Post New Answer

More JCL Interview Questions

There are 2PROCS in a JCL. I want following conditions to be carried out 1) 1st PROC should be executed as such In second PROC 2) First 4steps should not be executed 3) 5th step should not be executed 4) 6th and 7th step should be executed The change should be done only in the JCL and PROC should be untouched ?

3 Answers   ADP,


Explain about File Tailoring

1 Answers  


how to compare two datasets without using superce because output is limited to 133 bytes

0 Answers  


How system will identify whether user wants to create PS or PDS? If answer is SPACE parameter then why we need to pass ps or po as dataset organisation while creation

1 Answers  


can we write a proc with in a proc

4 Answers   IBM,






IN-STREAM DATA NOT ALLOWED IN PROC how can come out from this problem

7 Answers  


how to split a file

4 Answers   IBM,


Explain about LMPUT-

1 Answers  


Is automatic restart possible in jcl? If yes, how?

0 Answers  


Is condition checking possible in jcl?

0 Answers  


i have 1000 records in input file and i want to sort it and the first 200 records to be placed in output file. how to do that??

14 Answers   L&T,


what are the options in file-aid to edit vsam dataset and to compare data sets.

2 Answers   Ocwen,


Categories