IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

list dataset based on input file.


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
santosh_g

New User


Joined: 14 Aug 2011
Posts: 24
Location: india

PostPosted: Tue Feb 18, 2014 8:10 am
Reply with quote

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
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Tue Feb 18, 2014 9:26 am
Reply with quote

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
View user's profile Send private message
santosh_g

New User


Joined: 14 Aug 2011
Posts: 24
Location: india

PostPosted: Tue Feb 18, 2014 9:46 am
Reply with quote

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
View user's profile Send private message
TheMFKid

New User


Joined: 20 Nov 2013
Posts: 91
Location: India

PostPosted: Tue Feb 18, 2014 9:49 am
Reply with quote

you can achieve this using LMDLIST with OPTION(LIST).
Back to top
View user's profile Send private message
TheMFKid

New User


Joined: 20 Nov 2013
Posts: 91
Location: India

PostPosted: Tue Feb 18, 2014 9:56 am
Reply with quote

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
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Tue Feb 18, 2014 9:58 am
Reply with quote

You are right MFKid.... I totally forgot about LMD services. icon_lol.gif

This link will be more helpful to you http://ibmmainframes.com/about20708.html
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10695
Location: italy

PostPosted: Tue Feb 18, 2014 1:15 pm
Reply with 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

see here for the filtering capabilities

Use [URL] BBCode for Links

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
View user's profile Send private message
santosh_g

New User


Joined: 14 Aug 2011
Posts: 24
Location: india

PostPosted: Tue Feb 18, 2014 11:13 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10695
Location: italy

PostPosted: Tue Feb 18, 2014 11:17 pm
Reply with quote

search the forums with IGGCSI00
also googling withe the same might provide alternative snippets
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts JOINKEYS to match two input files on ... DFSORT/ICETOOL 3
No new posts COBOL VS SORT Utility for file format... COBOL Programming 6
No new posts How to find which file contains my se... DFSORT/ICETOOL 6
No new posts IGZ0035S THERE WAS AN UNSUCCESSFUL OP... COBOL Programming 3
No new posts Hex Value - vb file replace old date ... DFSORT/ICETOOL 14

Back to Top