empty check and abend the JCL

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
User avatar
arrbee
Active Member
Posts: 144
Joined: Fri Feb 24, 2006 11:33 am

empty check and abend the JCL

Post by arrbee » Wed Mar 05, 2008 7:39 pm

Hi,

Our production job cycle has got 200 jobs. The new requirement from the customer is as given below:

"There are 10 important files among these 200 jobs and these files should be checked for emptiness and if any of the file is empty then the JCL should abend or issue some meaningful return code". :x

Please let me know how to achieve it. :?: :?:

TIA. 8)
Arr Bee
-------------
?My joy in learning is partly that it enables me to teach? - Seneca(Roman philosopher, mid-1st century AD)

User avatar
Krishna
Site Admin
Posts: 1052
Joined: Fri Jan 27, 2006 7:50 am

Post by Krishna » Thu Mar 06, 2008 4:36 pm

There are multiple ways you can achieve this...


Using ICE TOOL...

// EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//INFILE DD DSN=XXX.YYY.ZZZ,DISP=SHR
//TOOLIN DD *
COUNT FROM(INFILE) EMPTY
/*

RC=12, tells us.. given file is empty.



Using IDCAMS.

//CHECKING EXEC PGM=IDCAMS
//INFILE DD DSN=XXX.YYY.ZZZ,DISP=SHR
//SYSIN DD *
PRINT INFILE(INFILE) COUNT(1)
IF LASTCC NE 0 THEN SET LASTCC = 12
/*


RC=12, tells us.... given file is empty.

User avatar
arrbee
Active Member
Posts: 144
Joined: Fri Feb 24, 2006 11:33 am

Thx.

Post by arrbee » Thu Mar 06, 2008 5:49 pm

Krishna,

Thank you.

But, in case, the input file to be checked has got millions of records then would the job take long time to complete?

Thx.
Arr Bee
-------------
?My joy in learning is partly that it enables me to teach? - Seneca(Roman philosopher, mid-1st century AD)

User avatar
DavidatK
Active Member
Posts: 65
Joined: Tue Mar 27, 2007 8:41 am
Location: Troy, MI USA

Post by DavidatK » Thu Mar 06, 2008 9:36 pm

No, both examples Krishna gives will read only a single record. If EOF on the first record then the file is emply, good rc on first read, file is not emply. You are not asking how many records

Dave

User avatar
arrbee
Active Member
Posts: 144
Joined: Fri Feb 24, 2006 11:33 am

Post by arrbee » Wed Jun 25, 2008 8:39 pm

Thank you guys
Arr Bee
-------------
?My joy in learning is partly that it enables me to teach? - Seneca(Roman philosopher, mid-1st century AD)

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others