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
 

 

find particular member name in PDS using REXX

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

New User


Joined: 03 Aug 2011
Posts: 9
Location: Bangalore

PostPosted: Mon Dec 19, 2016 6:44 pm    Post subject: find particular member name in PDS using REXX
Reply with quote

Hi All,

I am new to rexx, Could you please let me know how can I find the member name that starts with AAA( example ) in the given PDS using REXX. Thanks much in Advance.

Thank You!
Back to top
View user's profile Send private message

Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1753
Location: Bloomington, IL

PostPosted: Mon Dec 19, 2016 7:34 pm    Post subject:
Reply with quote

Searching a PDS directory in Rexx is tricky and quite possibly above your pay grade. You will be better off using the ISPF LMMLIST service.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1755
Location: UK

PostPosted: Mon Dec 19, 2016 7:39 pm    Post subject:
Reply with quote

And reading all about the all the LM services before you start coding. And you might as well read the Dialogue Manager guide as well.

Also, as you are new to rexx why post in the expert's forum and not the beginner's forum? Even I ask my questions in the beginner's forum when it is not a subject that I am competent in.
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 495
Location: The Universe

PostPosted: Mon Dec 19, 2016 9:57 pm    Post subject:
Reply with quote

Akatsukami wrote:
Searching a PDS directory in Rexx is tricky and quite possibly above your pay grade. You will be better off using the ISPF LMMLIST service.
As Akatsukami says, it is possible to read and parse a PDS directory in Rexx, but it is moderately difficult. The LMxxx services are much easier, but they are connected to ISPF, which means preparing the environment for ISPF must be done. <Is this true??>

A method that is somewhat simpler and usable even by a Rexx beginner is to output trap the output from the TSO LISTDS dataset MEMBERS command. -
Code:
XXXXXX.LMEM.LOAD
--RECFM-LRECL-BLKSIZE-DSORG
  U     **    32760   PO
--VOLUMES--
  XXXXXX
--MEMBERS--
  LMEM
  TEMPNAME

Your Rexx EXEC must then examine the member list. Click here to go to the discussion of OUTTRAP in a somewhat back level Rexx manual.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1753
Location: Bloomington, IL

PostPosted: Mon Dec 19, 2016 10:10 pm    Post subject:
Reply with quote

steve-myers wrote:
The LMxxx services are much easier, but they are connected to ISPF, which means preparing the environment for ISPF must be done. <Is this true??>

Yes; the ISPF libraries must be allocated and the script started via the ISPSTART command. If one is running ISPF in the foreground, of course this is all automatic, but in the background the JCL must follow the examples given on these fora.
Back to top
View user's profile Send private message
sergeyken

New User


Joined: 29 Apr 2008
Posts: 71
Location: Maryland

PostPosted: Thu Dec 29, 2016 11:59 pm    Post subject:
Reply with quote

If REXXTOOLS by Compuware are available in your environment then you could use some functions from there, like LISTM:

Code:
Parse Value LISTM("'USER01.LIBRARY'") With RC memcnt mlist
If RC = 0 Then
Do i=1 To memcnt
   Parse Var mlist mem mlist
   Say mem
End
Else Do
   Parse Var memcnt reason dsn message
   Say 'LISTM error:' message
End
Back to top
View user's profile Send private message
sergeyken

New User


Joined: 29 Apr 2008
Posts: 71
Location: Maryland

PostPosted: Fri Dec 30, 2016 2:18 am    Post subject:
Reply with quote

Sorry for misinformation:
REXXTOOLS by Open Software Technologies
Back to top
View user's profile Send private message
anatol

Active User


Joined: 20 May 2010
Posts: 101
Location: canada

PostPosted: Thu Jan 05, 2017 9:46 pm    Post subject:
Reply with quote

You can use LISTDS command with MEMBERS parameter

Code:

/* REXX -                                                            */
dsn = your pds                                                         
APP = OUTTRAP( "F.",'*')                                               
 "LISTDS '"||dsn||"' MEMBERS"                                           
APP = OUTTRAP( "OFF")                                                   
 DO I = 1 TO F.0                                                       
    IF substr(word(F.I,1),1,4) = 'AAAA' THEN say F.I                   
 END
                                                                   


where dsn your PDS name, F - is array with LISTDS results
Back to top
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 112
Location: Switzerland

PostPosted: Thu Jan 05, 2017 10:17 pm    Post subject:
Reply with quote

Short working sample:
Code:

/* rexx */                                                     
 Address TSO                                                   
 sds  = 'a.lib.data'                                           
 mpfx='VSAM'                                                   
 mpfxl=length(mpfx)                                             
                                                               
 zz=outtrap('smbr.')                                           
 "listds '"sds"' members"                                       
 zz=outtrap('off')                                             
 do n=7 to smbr.0                                               
   say 'Source member:' smbr.n                                 
   if Abbrev(strip(smbr.n),mpfx,mpfxl) then say 'match:' smbr.n
 end                                                                                             
Back to top
View user's profile Send private message
sergeyken

New User


Joined: 29 Apr 2008
Posts: 71
Location: Maryland

PostPosted: Fri Jan 06, 2017 9:02 pm    Post subject:
Reply with quote

Just FYI

In some cases there is a trap with using LISTDS command to analyze PDS member list. This doesn't happen too often, but if by a chance the library contains aliases besides of regular member names the output is a bit messy.

Example:
Code:
listds 'sys1.linklib' members 

SYS1.LINKLIB                   
--RECFM-LRECL-BLKSIZE-DSORG   
  U     **    32760   PO       
--VOLUMES--                   
  X2C1T1                       
--MEMBERS--                   
  ADFIDF00                     
  ADFMCOPY  ALIAS(SMC,SMCOPY) 
  ADFMDFLT                     
  ADFMDF0A                     
  ADFMDF01  ALIAS(ADFGLUET)   
  ADFMDF03                     
  ADFMDOLD                     
  ADFMFIND  ALIAS(SMF,SMFIND) 
  ADFMPUT  ALIAS(SMP,SMPUT)   
  ADRCIPH                     
. . . . . . . . . . . . . . . . . . .
  AHLWTASK                                                       
  AIRAMBGN                                                       
  AIRAMPVT  ALIAS(AIRA1INI,AIRH1CHK,AIRH1DCT,AIRP1TSK,AIRS1STK,   
           AIRS2STK)                                             
  AIRAMRES                                                       
. . . . . . . . . . . . . . . . . . .
  ANTCVXPR  ALIAS(ANTCVX00,ANTCVX01,ANTCVX02,ANTCVX03,ANTCVX04,           
           ANTCVX05,ANTCVX06,ANTCVX07,ANTCVX08,ANTCVX09,ANTCVX10,ANTCVX11,
           ANTCVX13,ANTCVX15,ANTCVX16,ANTCVX17,ANTCVX18,ANTCVX19,ANTCVX20,
           ANTCVX21,ANTCVX22,ANTCVX23,ANTCVX24,ANTCVX25,ANTCVX26,ANTCVX27,
           ANTCVX28,ANTCVX30,ANTCVX31,ANTCVX32,ANTCVX33,ANTCVX34,ANTCVX35,
           ANTCVX36,ANTCVX37,ANTCVX38,ANTCVX39,ANTCVX40,ANTCVX41,ANTCVX42,
           ANTCVX43,ANTCVX44,ANTCVX45,ANTCVX48,ANTCVX49,ANTCVX50,ANTCVX51,
           ANTCVX52,ANTS4902,ANTS4903,ANTS4904,ANTS4905,ANTS4906,ANTS4907,
           ANTS4908,ANTS4909,ANTS4910,ANTS4948,ANTS4950,ANTS4951,ANTS4952,
           ANTUSAF)                                                       
  ANTKDBUG                                                                 
  ANTKHSX                                                                 
  ANTKING                                                                 
  ANTKPDO                                                                 
  ANTMAIN                                                                 
  ANTMONR1                                                                 
  ANTSDMLK  ALIAS(ANTSDMLP,ANTUSUBT,ANTXPRSM)                             
  ANTSDMLL  ALIAS(ANTUFABN,ANTUFFND,ANTUFOEX,ANTUFSTW)                     
  ANTSTRT  ALIAS(ANTXAINI)                                                 
  ANTURQST  ALIAS(ANTCNVRT)                                               
  ANTUSCAN  ALIAS(ANTUCMPR,ANTUDRVR)                                       
  ANTUXDVC                                                                 
  ANTUXFQA                                                                 
. . . . . . . . . . . . . . . . . .
 etc. etc. etc .
 


If somebody is interested I have in my archives the old REXX function code to handle any combination of member names/aliases.
Back to top
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 112
Location: Switzerland

PostPosted: Sat Jan 07, 2017 1:27 am    Post subject:
Reply with quote

I like programs like the PDS86 found on cbttape.org file 182, because with that you can do copy including aliasses.
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 REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am
No new posts Browsing member from any PDS shiitiizz CLIST & REXX 7 Wed Mar 08, 2017 1:17 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm
No new posts Bind plan as a member to another bind... rexx77 DB2 0 Thu Feb 16, 2017 2:02 am
No new posts REXX compiled via RXTCOMP sergeyken CLIST & REXX 7 Tue Feb 07, 2017 9:41 pm


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