IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

File status of Empty GDG file open


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Chaitanya Sugathan

New User


Joined: 17 Jun 2009
Posts: 5
Location: Bangalore

PostPosted: Sat Sep 19, 2009 12:15 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Sat Sep 19, 2009 2:51 pm
Reply with quote

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
View user's profile Send private message
Chaitanya Sugathan

New User


Joined: 17 Jun 2009
Posts: 5
Location: Bangalore

PostPosted: Sat Sep 19, 2009 3:12 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Sat Sep 19, 2009 3:30 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sat Sep 19, 2009 3:30 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Sun Sep 20, 2009 7:27 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Sun Sep 20, 2009 7:33 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top