View previous topic :: View next topic
|
Author |
Message |
Gautam512
Active User
Joined: 05 Oct 2005 Posts: 308 Location: Vizag / US
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
I believe an empty dataset status-code on an OPEN will be '35'.
Regards,
Bill |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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..
Please explain a bit more. |
|
Back to top |
|
|
Gautam512
Active User
Joined: 05 Oct 2005 Posts: 308 Location: Vizag / US
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
revel
Active User
Joined: 05 Apr 2005 Posts: 135 Location: Bangalore/Chennai-INDIA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Gautam512
Active User
Joined: 05 Oct 2005 Posts: 308 Location: Vizag / US
|
|
|
|
thanks for ur replies... |
|
Back to top |
|
|
|