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
 

 

Get dataset name from pds

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
oerdgie

New User


Joined: 22 Nov 2007
Posts: 55
Location: Germany

PostPosted: Thu Mar 12, 2015 8:52 pm    Post subject: Get dataset name from pds
Reply with quote

Hi Folks,

I like to call a REXX from ISPF member list panel.
The REXX need the dataset name of the pds (USERID.TEST.LIB).

Code:
EDIT              USERID.TEST.LIB               
Command ===>                                     
          Name     Prompt       Size   Created          ......   ...... 
_________ #ENQ                    21  2011/08/30
_________ #LISTDS                 22  2011/06/28
_________ #V                      10  2008/06/10
_________ ACC                      2  2009/10/28

Do you have any ideas, how can I get the dataset name auf the pds in the REXX ?

Thanks in advance for help icon_smile.gif
Back to top
View user's profile Send private message

Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Thu Mar 12, 2015 9:59 pm    Post subject: Reply to: Get dataset name from pds
Reply with quote

This worked for me:
Code:
/* rexx */             
parse arg DSNAME       
Say 'DSNAME=('DSNAME')'
exit                   
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Thu Mar 12, 2015 11:10 pm    Post subject: Reply to: Get dataset name from pds
Reply with quote

If I understand this correctly then you need the name of the PDS where your Rexx code resides. I was looking for the same thing on the internet and found this which gets you the PDS and member name:

Code:

/* rexx */                               
PARSE SOURCE . . MEM DDNAME CHANCE .     
IF CHANCE \= '?' THEN DO                 
  SAY 'FIND ME HERE:'                     
  SAY CHANCE'('MEM')'                     
  EXIT                                   
END                                       
X=OUTTRAP('LISTA.')                       
"LISTA ST"                               
X=OUTTRAP('OFF')                         
DO I=1 TO LISTA.0                         
  IF WORD(LISTA.I,1)=DDNAME THEN DO       
    IS=I-1                               
    LEAVE                                 
  END                                     
END                                       
DO I=IS TO LISTA.0 BY 2                   
  PATH=LISTA.I'('MEM')'                   
  ANSWER=SYSDSN("'"PATH"'")               
  ANSWER=SYSDSN("'"PATH"'")
  IF ANSWER='OK' THEN DO   
    SAY "I'M HERE! :)"     
    SAY PATH               
    LEAVE                 
  END                     
END                       
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Thu Mar 12, 2015 11:42 pm    Post subject: Reply to: Get dataset name from pds
Reply with quote

My previous post was a long code that I copied.

You may only need this code:
Code:

/* rexx */                               
PARSE SOURCE . . MEM . CHANCE .
  SAY CHANCE'('MEM')'         
  EXIT                         
END                           
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Fri Mar 13, 2015 6:32 pm    Post subject: Reply to: Get dataset name from pds
Reply with quote

Quote:
If I understand this correctly then you need the name of the PDS where your Rexx code resides

That is not what the original poster asked for. He asked for the PDS name where the selected member resides.
Back to top
View user's profile Send private message
oerdgie

New User


Joined: 22 Nov 2007
Posts: 55
Location: Germany

PostPosted: Tue Mar 17, 2015 2:40 pm    Post subject:
Reply with quote

Hi Folks,

I try to tell you, what I want exactly...

I like to call a REXX from the Command line in the member list.
The REXX has no input parameters.

The REXX should change all members in the member list by calling an edit macro, running a CHANG ALL command for each member.

For that, it's necessary to get a list of all members of the PDS.
For getting all member names of the PDS, I would use LMMLIST.

The LMMLIST needs a DATAID, im getting with LMINIT.
The LMINIT now needs the name of a library, exactly the name of the PDS, I'm looking for.

That's it...

Is there another way to change all members of a PDS via command line, with one command, please tell me.


Many thanks in advance
icon_smile.gif
Back to top
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 175
Location: UK

PostPosted: Tue Mar 17, 2015 3:55 pm    Post subject:
Reply with quote

I might be missing something here, but why don't you just use the ISRMBRS macro?
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Tue Mar 17, 2015 9:29 pm    Post subject: Reply to: Get dataset name from pds
Reply with quote

Quote:
I like to call a REXX from the Command line in the member list.

Are you purposefully trying to make this hard? I do not believe there are any ISPF services that will work from the command line in the member list (1).

You can accomplish what you want from ISPF option 3.4. Get your data set to show in the list. Invoke your rexx exec as a line command from the data set list. Use PARSE ARG to get the name of the data set, as I posted earlier.

(1) you can use the ZSCREENI variable to get the currently shown screen image, which has the data set name in the title line. You have to figure out how to parse the data in the variable.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Tue Mar 17, 2015 9:39 pm    Post subject: Reply to: Get dataset name from pds
Reply with quote

see here for a COMPLETE WORKING application
REXX SCRIPTS,PANELS,MSGS,SKELS

http://www.ibmmainframes.com/viewtopic.php?t=60794&highlight=chgall
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Tue Mar 17, 2015 9:39 pm    Post subject: Reply to: Get dataset name from pds
Reply with quote

see here for a COMPLETE WORKING application
REXX SCRIPTS,PANELS,MSGS,SKELS

http://www.ibmmainframes.com/viewtopic.php?t=60794&highlight=chgall
Back to top
View user's profile Send private message
oerdgie

New User


Joined: 22 Nov 2007
Posts: 55
Location: Germany

PostPosted: Tue Mar 17, 2015 11:21 pm    Post subject:
Reply with quote

Oh, I didn't know the ISRMBRS Marco. Sounds deeply interesting...

But it's a good objection, why not invoke the REXX from shown 3.4 dataset list ? This solves my problem.

Sometimes things can be so easy...

Thank's very much all of you for help ! icon_biggrin.gif
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
No new posts Allocate dataset withour BLKSIZE Susanta CLIST & REXX 2 Thu Sep 22, 2016 11:51 am
No new posts dataset copy question - REPRO or some... atulxp TSO/ISPF 2 Wed Aug 03, 2016 10:56 pm
No new posts FTOPEN TEMP is failing due to dataset... mbenaud TSO/ISPF 7 Thu Jul 28, 2016 4:28 pm


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