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
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 |
Answer / ram g
u can use ams command repro thru idcams utility and check
for rc
Is This Answer Correct ? | 19 Yes | 5 No |
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 |
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 |
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 |
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 |
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 |
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 |
Can we have a JOBSTEP without any EXEC ?
How to send notification to multiple users through jcl???
i have two flat files.i want to select one record from that file by using jcl.for example file1 contains emp no,name,joining date. file2 has same details.emp no is primary key. i will give empno.that emp details send to outfile.please let me know if any one knows it.give sample code.
I've one sequential file, that file size is LREC=100 (File contain Records like 1 to 100). Now I was increase the file size is LREC=102. My question is I want insert 00 (Two Zeros) in to the new file (That output file looks like : 00123 up to 100). How will write the SORT card in JCL. Please let me know.
In JCL I have 5 steps,I need to execute 1st,2nd and 5th steps only,can any one answer me please?
If Name is NOT given for a JOB statement, then will it give error or installation will supply it for the JOB ?
What is the motivation behind coding class parameter in job statement?
by using cond parameter maximum 8 cond can be coded in single cond means ?explain
which are the parameters mandatory in job card ?
What is the purpose of dd * statement in jcl?
what does mvs stand for?
If there are five steps in a JCL i have to execute the 3rd step, bypass the 4th step and execute the 5th step how do i do this?
13 Answers Cognizant, Convergys, IBM, TCS, Wipro,