View previous topic :: View next topic
|
Author |
Message |
santosh_g
New User
Joined: 14 Aug 2011 Posts: 24 Location: india
|
|
|
|
Hi All,
Using rexx code, I need to list out datasets based on dataset [pattern] given in input.
for example, list out all datasets with aaa.**.ccc.*.eee.**
Can anyone help with the logic to filter the required datasets after capturing all the dataset using HLQ.
Code: |
/* say you want to have only datasets aaa.*.bbb.* to be deleted */
do i = 1 to j
parse var filel.i . '.' . 'bbb.' rest
if rest <> '' then do
k = k + 1
final.k = filel.i
end
end
/* here file. are the list of datasets based on HLQ */
/* here final. are the list of datasets after complete selection. */
|
I am trying to create generic logic which would work for any input.
example:
aaa.*
aaa.bbb.*
aaa.**.ccc.*
aaa.*ccc.**.eee.*
Thanks and Regards, |
|
Back to top |
|
|
sureshpathi10
Active User
Joined: 03 May 2010 Posts: 154 Location: Kuala Lumpur
|
|
|
|
You can use LISTDS along with OUTTRAP to get the list of Generic dataset.
Code: |
x = OUTTRAP("var.");
"LISTDS 'HLQ.*'"
do i=1 to var.0
say var.i
end
y = OUTTRAP("off") |
But I doubt only one '*' symbol allowed in LISTDS. |
|
Back to top |
|
|
santosh_g
New User
Joined: 14 Aug 2011 Posts: 24 Location: india
|
|
|
|
Hi Suresh,
yes. I am using that code to list out datasets based on HLQ.
I am looking for generic code for filtering based on qualifers.
Best Regards, |
|
Back to top |
|
|
TheMFKid
New User
Joined: 20 Nov 2013 Posts: 91 Location: India
|
|
|
|
you can achieve this using LMDLIST with OPTION(LIST). |
|
Back to top |
|
|
TheMFKid
New User
Joined: 20 Nov 2013 Posts: 91 Location: India
|
|
|
|
Try this out for your generic logic..
Code: |
A1 = "AAA.**.BBB.**"
ISPEXEC "LMDINIT LISTID("DID") LEVEL("A1")"
DO FOREVER
ISPEXEC "LMDLIST LISTID("DID") STATS(YES) OPTION(LIST) DATASET(DE)"
IF RC > 0 THEN LEAVE
SAY DE
END
ISPEXEC "LMDFREE LISTID("DID")"
|
|
|
Back to top |
|
|
sureshpathi10
Active User
Joined: 03 May 2010 Posts: 154 Location: Kuala Lumpur
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
wouldn' t it be simpler to use IGGCSI00 ...
well documented in the IBM manuals, pretty easy to use,
WORKING EXAMPLES her on the forum ( a complete script posted by expat - IIRC )
and in SYS1.SAMPLIB
see here for the filtering capabilities
pic.dhe.ibm.com/infocenter/zos/v1r12/index.jsp?topic=%2Fcom.ibm.zos.r12.idac100%2Fc1044.htm
no additional layer ( ISPF )
an order of magnitude faster than LM services
much better filtering than anything else
even faster than IDCAMS - according to some benchmarks |
|
Back to top |
|
|
santosh_g
New User
Joined: 14 Aug 2011 Posts: 24 Location: india
|
|
|
|
Thank you all for your inputs. I have used LMD services and it worked good.
enrico,
Quote: |
wouldn' t it be simpler to use IGGCSI00 ...
well documented in the IBM manuals, pretty easy to use,
WORKING EXAMPLES her on the forum ( a complete script posted by expat - IIRC )
and in SYS1.SAMPLIB
|
Can you please provide me the link for sample examples. I did search the forum but I could not find it.
Thanks and Regards,
Santosh G. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
search the forums with IGGCSI00
also googling withe the same might provide alternative snippets |
|
Back to top |
|
|
|