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
 

 

list dataset based on input file.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: list dataset based on input file.
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10272
Location: italy

PostPosted: Tue Feb 18, 2014 1:15 pm    Post subject: Reply to: list dataset based on input file.
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

http://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
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10272
Location: italy

PostPosted: Tue Feb 18, 2014 11:17 pm    Post subject: Reply to: list dataset based on input file.
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    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 xls file from Mainfrmae kumarsatheeshc1 TSO/ISPF 5 Tue Jun 20, 2017 6:56 pm
No new posts Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am
No new posts XML Parse for large file muralikrishnan_new COBOL Programming 3 Mon Jun 12, 2017 12:50 pm


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