View previous topic :: View next topic |
Author |
Message |
Allenantony Beginner
Joined: 05 Nov 2006 Posts: 9 Topics: 4
|
Posted: Mon Feb 25, 2008 4:39 pm Post subject: Empty File Condition check |
|
|
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 |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Tue Feb 26, 2008 6:09 am Post subject: |
|
|
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 |
|
 |
Bill Dennis Advanced

Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Tue Feb 26, 2008 9:57 am Post subject: |
|
|
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 |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Tue Feb 26, 2008 10:45 am Post subject: |
|
|
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 |
|
 |
Allenantony Beginner
Joined: 05 Nov 2006 Posts: 9 Topics: 4
|
Posted: Tue Feb 26, 2008 11:26 am Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
Allenantony Beginner
Joined: 05 Nov 2006 Posts: 9 Topics: 4
|
Posted: Wed Feb 27, 2008 2:06 pm Post subject: |
|
|
I Thank each and every one for the help rendered. |
|
Back to top |
|
 |
|
|