Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Empty Dataset Check in the Program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
Gautam512

Senior Member


Joined: 05 Oct 2005
Posts: 347
Location: Vizag / US

PostPosted: Thu Sep 04, 2008 9:29 pm    Post subject: Empty Dataset Check in the Program
Reply with quote

Hi,

I have a parm-member having a list of dataset names.
The dataset list changes on a daily basis.

I have a cobol program where i'll be reading this parm member and get the dataset name.

My question:

Is there any way where i can check whether the dataset is empty or not in my cobol program? I have only the dataset name which is coming from the parm-member.

Gautam
Back to top
View user's profile Send private message
References
Bill O'Boyle

Senior Member


Joined: 14 Jan 2008
Posts: 333
Location: Orlando, FL, USA

PostPosted: Thu Sep 04, 2008 9:50 pm    Post subject: Re: Empty Dataset Check in the Program
Reply with quote

I believe an empty dataset status-code on an OPEN will be '35'.

Regards,

Bill
Back to top
View user's profile Send private message
Anuj D.

Global Moderator


Joined: 22 Apr 2006
Posts: 2159
Location: Phoenix, AZ

PostPosted: Thu Sep 04, 2008 9:50 pm    Post subject:
Reply with quote

Hi,

What's the definition of Parm-member?
Code:
//DDname  DD  DSN=XXXXXX.ANUJ.PDS(member),

READ DDname in COBOL program, if on first READ EOF reached file is empty.. I'm confused a little, probably you are not looking for this..icon_confused.gif

Please explain a bit more.
Back to top
View user's profile Send private message
Gautam512

Senior Member


Joined: 05 Oct 2005
Posts: 347
Location: Vizag / US

PostPosted: Thu Sep 04, 2008 11:40 pm    Post subject:
Reply with quote

hi,

i am not using the dataset as a DD in a JCL, i have only the dataset name which comes into the program.

Simply saying:

In the program i have the dataset name, how to check whether that dataset is empty or not.
I am not reading any dataset to check if it is empty...
Back to top
View user's profile Send private message
Anuj D.

Global Moderator


Joined: 22 Apr 2006
Posts: 2159
Location: Phoenix, AZ

PostPosted: Tue Sep 09, 2008 1:25 pm    Post subject:
Reply with quote

Hi,

It's a COBOL Forum so the general perception was to use READ verb, if you have some thing other than COBL you need to tell us about that.

This
Quote:
In the program i have the dataset name
needs clarification.

And if not this
Quote:
I am not reading any dataset to check if it is empty
what are the other options avalable to you ?
Back to top
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 132
Location: Bangalore/Chennai-INDIA

PostPosted: Tue Sep 09, 2008 4:07 pm    Post subject:
Reply with quote

Hello,

Quote:
Is there any way where i can check whether the dataset is empty or not in my cobol program? I have only the dataset name which is coming from the parm-member.


You are clearly saying, You are passing DATASET through PARM parameter so only way is to handle it whether the DATASET is EMPTY or NOT programitically..

I am assuming you passed PDS name through PARM say X.Y.Z(member)

one way is

Route JCL statement with IEBCOMPR utility for comparing input dataset against an EMPTY dataset(external source- EMPTY daatset) by routing statement to INTRDR(internal card reader), then

> Check for RC if it ZERO means the input datset is EMPTY(since you are comparing against EMPTY DS of external source)


> Check if RC is 8 means the input DS is non EMPTY

Refer IEBCOMPR utility for code


Hope you are clear..... :o)
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 8643
Location: 221 B Baker St

PostPosted: Tue Sep 09, 2008 7:42 pm    Post subject:
Reply with quote

Hello,

Quote:
Is there any way where i can check whether the dataset is empty or not in my cobol program? I have only the dataset name which is coming from the parm-member.
In "standard" (by standard i mean SELECTs, FDs, etc) cobol, no.

You could investigate dynamic file allocation from within cobol or you could call an assembler routine, but my preference is to redefine the requirement.
Back to top
View user's profile Send private message
Gautam512

Senior Member


Joined: 05 Oct 2005
Posts: 347
Location: Vizag / US

PostPosted: Thu Sep 25, 2008 2:36 am    Post subject:
Reply with quote

thanks for ur replies...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1