MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Empty File Condition check

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
Allenantony
Beginner


Joined: 05 Nov 2006
Posts: 9
Topics: 4

PostPosted: Mon Feb 25, 2008 4:39 pm    Post subject: Empty File Condition check Reply with quote

Dear Friends,

One of our programs is unable to handle empty file condition. As a result when this program is getting executed from JCL, the particular step is erroring out with a return code of -322.

The program accepts 3 files as input. I know that by using IDCAMS for checking the empty file condition and based on this return code (RC= 4 -> EMPTY FILE) I can decide whether I should execute the program or not in the JCL. But since the file uses 3 input files, I am getting confused.

Please can you help me in resolving this issue.

Thanks.
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue Feb 26, 2008 6:09 am    Post subject: Reply with quote

1 - fix your program so that it handles an empty file - if this is a valild condition
2 - 322 - is that a system code (S322) or some other code. An S322 is a cancel (time limit exceeded)
3 - what is confusing you - you test for an emty file using IDCAMS - give a return code of 4 if the file is empty and by-pass the problem program. If you still have to execute the program because the other files have data then you have to fix the program as per 1.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Tue Feb 26, 2008 9:57 am    Post subject: Reply with quote

Nic's #1 solution is best - fix the program.

Or, can you check each file and then if CC=4 copy some "dummy" record into it that will not affect the program?
_________________
Regards,
Bill Dennis

Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Tue Feb 26, 2008 10:45 am    Post subject: Reply with quote

or write a small rexx pgm to check the files using the I/O method of your choice (EXECIO, LMGET, IDCAMS invocation, etc) and issue 1 final return code for the step and then check that return code.
_________________
New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html.
Back to top
View user's profile Send private message Visit poster's website
Allenantony
Beginner


Joined: 05 Nov 2006
Posts: 9
Topics: 4

PostPosted: Tue Feb 26, 2008 11:26 am    Post subject: Reply with quote

Dear all,

Thanks a lot for your suggestions. I have made a fix to the program.

But can you please show me ( a JCL example) how to check the empty file conditions in JCL if there are multiple files, say 5 or 10? With a single file, I am able to do. But if there are more than one file, I am unable to do the validation on each input file and skip the execution of the programs if they are empty.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Feb 26, 2008 11:42 am    Post subject: Reply with quote

Allenantony,


Please Search before posting. Check this link which discusses various ways of checking an empty file

http://www.mvsforums.com/helpboards/viewtopic.php?p=5977#5977
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Allenantony
Beginner


Joined: 05 Nov 2006
Posts: 9
Topics: 4

PostPosted: Wed Feb 27, 2008 2:06 pm    Post subject: Reply with quote

I Thank each and every one for the help rendered.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group