Page 1 of 2

Getting dataset name

PostPosted: Wed Sep 19, 2007 6:47 pm
by Jeri Kattar
Hi,
When I am inside a member in a pds, i will be executing a REXX routine. This routine needs to get this member's name like 'SCLMTFS.PREP.SOURCE(one)' into a variable. But this name should not be got from user.Implicitly the varibale should get this name.

Pls help me in this asap.
Thanks in advance

Re: Getting dataset name

PostPosted: Wed Sep 19, 2007 8:03 pm
by MrSpock
What do you mean by "inside a member in a pds"?

If you are Editing (or Viewing) a dataset or PDS with ISPF EDIT, then you can use an ISPF EDIT Macro to obtain the name of the dataset currently being edited.

If that's not the case, the REXX LISTDSI function (only available if you're running in a TSO/E environment) can resolve an allocated DDNAME to it's dataset name.

Re: Getting dataset name

PostPosted: Thu Sep 20, 2007 3:04 pm
by Jeri Kattar
Can u pls give me that ISPF EDIT macro syntax to identify the dataset name.

Re: Getting dataset name

PostPosted: Thu Sep 20, 2007 4:21 pm
by MrSpock
3.3.21 DATASET--Query the Current and Original Data Set Names[b] from the z/OS V1R7.0 ISPF Edit and Edit Macros guide.

[b]3.3.53 MEMBER--Query the Current Member Name from the z/OS V1R7.0 ISPF Edit and Edit Macros guide.

Re: Getting dataset name

PostPosted: Thu Sep 20, 2007 6:43 pm
by Jeri Kattar
Hi,
I have used the following code to display the name of the dataset being viewed or edited. But only the word MEM is getting displayed instead of dataset name.
Please advise.

ADDRESS ISREDIT
"ISREDIT MACRO"
"ISREDIT(MEM) = DATASET"
SAY MEM

Re: Getting dataset name

PostPosted: Thu Sep 20, 2007 6:51 pm
by MrSpock
Works for me. What does the TRACE show?

Re: Getting dataset name

PostPosted: Thu Sep 20, 2007 6:58 pm
by Jeri Kattar
There is no error. But only the word MEM is displayed not the dataset name.
When I am viewing a dataset 'SCLMTFS.PREP.SOURCE(ONE)', the dataset name must be displayed right.
But only the variable name is getting displayed.

Re: Getting dataset name

PostPosted: Thu Sep 20, 2007 7:01 pm
by marso
I see you put no space between ISREDIT and (MEM). That may cause the problem.
Try also:
"ISREDIT MACRO"
"ISREDIT (PDSName,,) = DATASET"
"ISREDIT (Member) = MEMBER"

PDSName will have the dataset name and Member the member name...
The commas are not really necessary
I think "Address ISREDIT" is not necessary.

Re: Getting dataset name

PostPosted: Thu Sep 20, 2007 7:04 pm
by Jeri Kattar
Actually I am not getting any error. But when I try to display the variable value, I am not getting the dataset name.
Instead the variable name is displayed.

Re: Getting dataset name

PostPosted: Fri Sep 21, 2007 7:11 pm
by Jeri Kattar
Hi,
Can anyone help me in this regards.