|
View previous topic :: View next topic
|
| Author |
Message |
ravi243
New User
Joined: 03 Aug 2011 Posts: 9 Location: Bangalore
|
|
|
|
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 |
|
 |
Akatsukami
Global Moderator

Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
| 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 |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
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 |
|
 |
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
| 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 |
|
 |
Akatsukami
Global Moderator

Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
| 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 |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2288 Location: USA
|
|
|
|
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 |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2288 Location: USA
|
|
| Back to top |
|
 |
anatol
Active User
Joined: 20 May 2010 Posts: 121 Location: canada
|
|
|
|
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 |
|
 |
Willy Jensen
Active Member

Joined: 01 Sep 2015 Posts: 777 Location: Denmark
|
|
|
|
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 |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2288 Location: USA
|
|
|
|
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 |
|
 |
Willy Jensen
Active Member

Joined: 01 Sep 2015 Posts: 777 Location: Denmark
|
|
|
|
| I like programs like the PDS86 found on cbttape.org file 182, because with that you can do copy including aliasses. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|