Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

File status of Empty GDG file open

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: File status of Empty GDG file open
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: 8056
Location: East Dubuque, Illinois, USA

PostPosted: Sat Sep 19, 2009 2:51 pm    Post subject:
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    Post subject: Reply to: File status of Empty GDG file open
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: 8056
Location: East Dubuque, Illinois, USA

PostPosted: Sat Sep 19, 2009 3:30 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Sat Sep 19, 2009 3:30 pm    Post subject:
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

Senior Member


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

PostPosted: Sun Sep 20, 2009 7:27 pm    Post subject:
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

Senior Member


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

PostPosted: Sun Sep 20, 2009 7:33 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Testing rerad cursor for status with ... John F Dutcher DB2 8 Fri May 19, 2017 9:35 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us