IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Getting all GDG Base Names using Search Pattern


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

New User


Joined: 17 Feb 2007
Posts: 39
Location: Chennai

PostPosted: Fri Jun 20, 2008 5:22 pm
Reply with quote

Hi all,

I have to perform a search for the GDG bases using the pattern LJ.**.EXAMPLE.

This should return all the GDG base which has the above mentioned pattern. For example LJ.AA.EXAMPLE , LJ.BBBB.EXAMPLE should be the output.

How this can be achieved in background?

Purusothaman.HR
Back to top
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Fri Jun 20, 2008 6:25 pm
Reply with quote

You use pgm IDCAMS to list catalog entries and parameter GDG to list only those types of entries:
Code:
//LIST     EXEC PGM=IDCAMS             
//SYSPRINT DD SYSOUT=*                 
//SYSIN DD *                           
 LISTCAT ENTRIES(LJ.*.EXAMPLE) GDG     
/*                                     
Back to top
View user's profile Send private message
purusothaman

New User


Joined: 17 Feb 2007
Posts: 39
Location: Chennai

PostPosted: Fri Jun 20, 2008 9:10 pm
Reply with quote

Thanks for your reply.

In front end when running using REXX Exec:
When I use LISTCAT, my TSO user id gets appended to the pattern. For example LJ.*.EXAMPLE becomes TSOXXXX.LJ.*.EXAMPLE

When running using IDCAMS:
I am getting Memory error and also LJ.**.EXAMPLE does not seem to work.
Back to top
View user's profile Send private message
purusothaman

New User


Joined: 17 Feb 2007
Posts: 39
Location: Chennai

PostPosted: Fri Jun 20, 2008 9:17 pm
Reply with quote

Forgot to write the code. Sorry. Here is the code.

Code:
//STEP01   EXEC PGM=IDCAMS,REGION=1024K   
//SYSIN DD *                             
 LISTCAT ENTRIES(LJ.**.TRADERPT) GDG     
/*                                       
//SYSPRINT DD SYSOUT=*     


I am getting the following error for the above mentioned code.

LISTCAT ENTRIES(LJ.**.TRADERPT) GDG
IDC3203I ITEM 'LJ.**.TRADERPT' DOES NOT ADHERE TO RESTRICTIONS
IDC3202I ABOVE TEXT BYPASSED UNTIL NEXT COMMAND. CONDITION CODE IS 12
IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE WAS 12
Back to top
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Fri Jun 20, 2008 9:20 pm
Reply with quote

In front end when running using REXX Exec:
enclose the name pattern in single quote 'LJ.*.EXAMPLE' to keep your ID from getting pre-pended

When running using IDCAMS:
use a single asterisk LJ.*.EXAMPLE

What messages indicate a memory error?
Back to top
View user's profile Send private message
purusothaman

New User


Joined: 17 Feb 2007
Posts: 39
Location: Chennai

PostPosted: Fri Jun 20, 2008 9:32 pm
Reply with quote

When I use LJ.*.TRADERPT in IDCAMS, I am not able to get the desired GDGs. All the GDGs that I am looking for are like

LJ.XXXX010XX.X010.TRADERPT

So kindly mention how this should be applied. I need to run through IDCAMS since I need the resuls to be routed to a output file.

When I tried LJ.*.TRADERPT, I got the below error.

LISTCAT LEVEL(LJ.*.TRADERPT) GDG
IDC3012I ENTRY LJ.*.TRADERPT. NOT FOUND
IDC3007I ** VSAM CATALOG RETURN-CODE IS 8
IDC1566I ** LJ.*.TRADERPT NOT LISTED

Thanks a bunch for ur help..
Back to top
View user's profile Send private message
purusothaman

New User


Joined: 17 Feb 2007
Posts: 39
Location: Chennai

PostPosted: Fri Jun 20, 2008 9:35 pm
Reply with quote

Memory Error that I got earlier:

LISTCAT ENTRIES(LJ.*.TRADERPT) GDG
IDC3332I ** INSUFFICIENT MAIN STORAG
IDC1566I ** LJ.*.TRADERPT NOT LISTED
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Fri Jun 20, 2008 11:23 pm
Reply with quote

Google 'IBM lookat'.

Search for IDC3332I.
Back to top
View user's profile Send private message
purusothaman

New User


Joined: 17 Feb 2007
Posts: 39
Location: Chennai

PostPosted: Mon Jun 23, 2008 4:40 pm
Reply with quote

I tried increasing the REGION size.. But still I am getting the error.

Any idea?
Back to top
View user's profile Send private message
nirmalya sengupta

New User


Joined: 28 May 2007
Posts: 5
Location: kolkata

PostPosted: Mon Jun 23, 2008 9:30 pm
Reply with quote

You may use rexx code to run this program. Your id will not be apended if you use "PREF NOPREF". I think that will help you out.
Code:

/**REXX**/
PROF NOPREF
ADDRESS TSO
XX=OUTTRAP("LIST.")
"LISTCAT ENTRIES (LJ.*.EXAMPLE) GDG"
XX=OUTTRAP("OFF")
DO X=1 TO LIST.0
SAY LIST.X
END


I think this should work. Now you may use list. stem as you want.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Jun 23, 2008 9:43 pm
Reply with quote

SYS1.SAMPLIB (IGGCSIRX) is a good place to look at
Back to top
View user's profile Send private message
purusothaman

New User


Joined: 17 Feb 2007
Posts: 39
Location: Chennai

PostPosted: Mon Jun 30, 2008 3:04 pm
Reply with quote

Hi all,

Finally I found a solution for this. Thanks to all the buddies who have helped me.

Here is the code:

Code:
/* REXX */                                                           
                                                                     
NAMES.  =  ' '                                                       
J = 0                                                                 
                                                                     
ADDRESS ISPEXEC "LMDINIT LISTID(TEMPLIST) LEVEL(LJ.**.TRADERPT)"     
DO FOREVER                                                           
  ADDRESS ISPEXEC                                                     
  "LMDLIST LISTID(&TEMPLIST) OPTION(LIST) DATASET(DSVAR) STATS(YES)" 
  IF RC <> 0 THEN LEAVE                                               
  J = J  +1                                                           
  NAMES.J = USERID()"."DSVAR                                         
  DSVAR = ''                                                         
END                                                                   
                                                                     
ADDRESS ISPEXEC "LMDFREE LISTID(&TEMPLIST)"   
                                                       
NAMES.0 = J                                             
ADDRESS TSO "EXECIO "J" DISKW GDGLIST(STEM NAMES. FINIS"
EXIT                                                                           


Thanks again to all.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jun 30, 2008 8:58 pm
Reply with quote

Thank you for posting your solution icon_smile.gif

d
Back to top
View user's profile Send private message
sampatir

New User


Joined: 12 May 2009
Posts: 13
Location: India

PostPosted: Mon Jun 15, 2009 10:29 am
Reply with quote

Hi Purusothaman,

The code you posted above will bring all the NON GDG files along with the required GDGS in the given pattern.

Can you let me know how can we eliminate those files from getting retrieved?

Thanks,
Ram
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Jun 15, 2009 1:57 pm
Reply with quote

Take a look at THIS topic
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Jun 15, 2009 2:02 pm
Reply with quote

You did not specify if it is a repetitive task,

for a once in a while job the best thing would be to use the ISMF dialogs
for dataset list, it has quite powerful filtering facilities

ask Your storage support about ISMF dialogs and how to have them available in Your ISPF session
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

 


Similar Topics
Topic Forum Replies
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts first column truncated in search result IBM Tools 13
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts To search DB2 table based on Conditio... DB2 1
Search our Forums:

Back to Top