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: 10202
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: 10202
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 High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm


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