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

Empty Dataset Check in the Program


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Gautam512

Active User


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

PostPosted: Thu Sep 04, 2008 9:29 pm
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
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu Sep 04, 2008 9:50 pm
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 Dhawan

Superior Member


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

PostPosted: Thu Sep 04, 2008 9:50 pm
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

Active User


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

PostPosted: Thu Sep 04, 2008 11:40 pm
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 Dhawan

Superior Member


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

PostPosted: Tue Sep 09, 2008 1:25 pm
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 COBOL 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: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Tue Sep 09, 2008 4:07 pm
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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Sep 09, 2008 7:42 pm
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

Active User


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

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

thanks for ur replies...
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top