View previous topic :: View next topic
|
Author |
Message |
Chaitanya Sugathan
New User
Joined: 17 Jun 2009 Posts: 5 Location: Bangalore
|
|
|
|
Hi,
I have a program here where the input is a GDG file. The program has a check on the EMPTY file status at the time the file is opened. But i find that the empty GDG file at the time of opening is returning FILE STATUS code 00 and so its bypassing the step where the EMPTY file is handled.
The program is supposed to abend the job when the input file is empty. But then its not happening. Even if the file is empty the job is executing to completion with MAXCC =0.
I am a bit confused as i was under the impression that an EMPTY file should return status code 10.
Could you please clarify?
Thanks and Regards |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Have you ever read the manual on what a file status code 10 is? Since it is obvious you haven't, I've copied it here:
Quote: |
A sequential READ statement was
attempted and no next logical record
existed in the file because the end of
the file had been reached, or the first
READ was attempted on an optional input
file that was not present. |
Note that a file status 10 does not occur on an OPEN. It specifically states a sequential READ was attempted.
Furthermore, you say the input is a GDG file -- you are completely unclear at this point. Do you mean the input is a GDG base (i.e., all the generations of the GDG from most recent to oldest), a relative generation number (i.e., +0), or an absolute generation number (i.e., G1234V00)? And if it is a relative generation number, you need to tell us which generation you're looking at -- +0, +1, -1, or what? |
|
Back to top |
|
|
Chaitanya Sugathan
New User
Joined: 17 Jun 2009 Posts: 5 Location: Bangalore
|
|
|
|
Thanks Robert for your response.
Yes, i am aware of the fact that File Status code 10 is returned at the time of READ attempted on a Empty file. But i was under the impressions that its not the ONLY situation where File Status code 10 is returned.
The program i mentioned uses the GDG version which was created by a previous program.
The Process flow is like --> Program A creates a new version of the GDG which cascades down to Program B where its used as the main input file.
Both the programs are already existing in the system. So i think the empty file condition check is not properly placed. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
I have never heard of a file status 10 on an OPEN -- other codes like 97 and 35 are possible but not a 10. And since the manual explicitly states it is for a sequential READ, I believe that will be the only time you get a 10.
Your code could open the file, attempt a read immediately, and if you get a 10 at that point you'll know there's no records in the file.
Terminology note: generation and version mean very, very, very different things when used in reference to a GDG. I assume you mean generation because if you mean version, the processing from the system standpoint is quite different (only one version of a generation may exist at one time, and any version other than V00 must be cataloged by the programmer using the absolute generation reference such as GXXXXV??, for example). |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Quote: |
The Process flow is like --> Program A creates a new version of the GDG which cascades down to Program B where its used as the main input file. |
Does it ? Are you sure. Or is this just another case of people using the wrong terminology and trying to confuse every one trying to help.
Version and Generation are both valid terms for a GDS, which are often mixed up by people who know no better.
As both are valid terms for a GDS, do we believe you and waste time on the wrong answers or do we go with our better judgement and ignore the rubbish.
Please go away and learn the correct terminolgy to use when you post a question so as not to cause confusion in the future. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
May be you know the facts, as you said
Quote: |
i am aware of the fact that File Status code 10 is returned at the time of READ attempted on a Empty file. |
but it does not go with what you posted to start with this thread
Quote: |
But i find that the empty GDG file at the time of opening is returning FILE STATUS code 00 and so its bypassing the step where the EMPTY file is handled. |
|
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Quote: |
The program is supposed to abend the job when the input file is empty. But then its not happening. Even if the file is empty the job is executing to completion with MAXCC =0. |
I believe, you need to look at the code where check on empty file is coded, without looking at code it's tough to tell why the expected is not happening. |
|
Back to top |
|
|
|