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
 

 

Empty Dataset Check in the Program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Gautam512

Active User


Joined: 05 Oct 2005
Posts: 309
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

Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, 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 Dhawan

Senior Member


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

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

Active User


Joined: 05 Oct 2005
Posts: 309
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 Dhawan

Senior Member


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

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 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    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

Site Director


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

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

Active User


Joined: 05 Oct 2005
Posts: 309
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm


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