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
 

 

Getting all GDG Base Names using Search Pattern

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Getting all GDG Base Names using Search Pattern
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Fri Jun 20, 2008 11:23 pm    Post subject: Reply to: Getting all GDG Base Names using Search Pattern
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    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Mon Jun 23, 2008 9:43 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon Jun 30, 2008 8:58 pm    Post subject: Reply to: Getting all GDG Base Names using Search Pattern
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    Post subject:
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: 8593
Location: Back in jolly old England

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

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Jun 15, 2009 2:02 pm    Post subject: Reply to: Getting all GDG Base Names using Search Pattern
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    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 Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am
No new posts Using Field names in FILEAID Batch CO... Atul Banke Compuware & Other Tools 2 Wed Jun 29, 2016 9:54 pm
No new posts Search a Load Module sreekanth1984 TSO/ISPF 8 Tue Jun 07, 2016 8:45 pm
No new posts Copy one PDS to another PDS based on ... alluri12 JCL & VSAM 10 Tue Sep 29, 2015 8:10 pm
No new posts Search and replace the key in the report V S Amarendra Reddy SYNCSORT 1 Thu Jul 09, 2015 7:41 pm


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