We are using 2 files , file one has data, file two is
empty.Using jcl how can we find the other file is empty?
Answers were Sorted based on User's Feedback
Answer / mchava
using IDCAMS utitlity
Print infile(file name) count(1)
it will check whether the file is empty or not
Is This Answer Correct ? | 14 Yes | 0 No |
Answer / sundar
Using IDCAMS utility
In SYSIN:
PRINT(infile) COUNT(1)
If this step return 4 then the file is empty otherwise if
return 0 then the file is not empty.
Is This Answer Correct ? | 10 Yes | 0 No |
Answer / sham
using idcams and its command print we can find wheather the
fiel is empty or not
Is This Answer Correct ? | 8 Yes | 1 No |
Answer / raghu
This can be done using ICETOOL.
//STEP1 EXEC PGM=ICETOOL
//IN DD DSN=……input file1
//TOOLMSGDD SYSOUT=*
//DFSMSG DD SYSOUT=*
//TOOLIN DD*
COUNT FROM(IN) EMPTY
/*
In the above JCL, Input file1 is empty. If we run this JCL
it will retrun NON-ZERO retrun code.
adv: It will be very helpful when we want to run some steps
after checking a particular file is empty or not.
Is This Answer Correct ? | 8 Yes | 1 No |
Answer / bala
Compare the file with another known empty file. IEBCOMPR
comparison of two empty files should give non empty RC.
Is This Answer Correct ? | 6 Yes | 3 No |
Answer / vinay sonar
Print the contents of file using IDCAMS utility if it is
empty you will get MAXCC 4
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / rajesh_m13
stepname exec vsamempt=yes
that shows empty file
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / deepak dada, jaipur
the handling would happen
if the file is empty then pass the zero to return code in
cobol program
then go to jcl step and check for the conditiom code( 0,
eq) where the program is getting called and do whatever you
want to do
Is This Answer Correct ? | 0 Yes | 3 No |
Answer / deepak dada, jaipur
the handling would happen
if the file is empty then pass the zero to return code in
cobol program
then go to jcl step and check for the conditiom code( 0,
eq) where the program is getting called and do whatever you
want to do
Is This Answer Correct ? | 0 Yes | 5 No |
What are the keywords associated with DCB? How can you specify DCB information? What is the OS precedence for obtaining that DCB information, ie. where does the system look for it first?
how many members can be created inside a single pds?
What are the parameters that are used in creating a gdg?
How to get the last but one duplicate record of the file using Sort?
in my jcl have 20 steps step1,step2,.... step20.and i have to execute step1,step2,..and skip the step3 and remaing step4,step5 are execute? i want skip step3 only? what code u can write?
What are the basic JCL Statements for a Job?
I have DATE filed like DD-MM-YYYY, So I want output should be MM/DD/YYYY using JCL? Can anybody post the answer for above requirement?
4 Answers BirlaSoft, FIS, Wipro,
How to identify where file is empty or not? How many ways are there to identifying?
How to get cursor position from system in CICS environment ?
which statement is used to end the in-stream procedure in a jcl?
One dataset is creating in the step1 with LRECL of 133 and the same dataset is used in the next step in DISP=SHR mode, but while scanning the JCL the following error is thrwon. Please verify the below JCL $/SEPP030.PROVIDER DD DSN=Z1225BT.F5750PG9.F5910PRV.QC#A6868 //ERRORRPT DD DSN=F5910&ST&IN..F5910EPP.ERRORRPT.P&CYCDATE, --ERRORRPT DD DSN=F5910PG.F5910EPP.ERRORRPT.P, // DISP=&DISNCD,UNIT=&DELQ, -- DISP= (NEW,CATLG,DELETE),UNIT=DELQ, // SPACE=(TRK, (30,15),RLSE), // DCB=&DCB2 -- DCB= (PPG.METMODEL,BLKSIZE=0,LRECL=133,RECFM=FB) $/SEPP030.ERRORRPT DD DSN=Z1225BT.F5910EPP.ERRORRPT.AOUTPUT //SEPP040 EXEC PGM=FILEAID,COND= (0002,EQ,SEPP030) //SYSPRINT DD SYSOUT=* //SYSLIST DD SYSOUT=* //DD01 DD DSN=SYSCMN.PROD.CCLIB (F5910EP1),DISP=SHR $/SEPP040.DD01 DD DSN=Z1225BT.TEST.CCLIB (F5910EP1) E1 - DSS20791E - DATA SET 'Z1225BT.F5910EPP.ERRORRPT.AOUTPUT' HAS AN LRECL OF 133 COULD NOT BE OPENED BECAUSE THE CODED LRECL WAS 80. // DD DSN=F5910&ST&IN..F5910EPP.ERRORRPT.P&CYCDATE, -- DD DSN=F5910PG.F5910EPP.ERRORRPT.P, // DISP=SHR $/ DD DSN=Z1225BT.F5910EPP.ERRORRPT.AOUTPUT please find the error code in the above mentioned lines and please suggest me about the error and the solution for that.
How would you understand error(execution phase)?