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

Extracting latest generation of each GDG


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

New User


Joined: 24 Mar 2005
Posts: 51

PostPosted: Tue Dec 11, 2007 6:39 pm
Reply with quote

Hi, When I opened USER.ISF.* datset using 3.4, it will list a number of GDG base and generations as below

USER.ISF.GDG1
USER.ISF.GDG1.G0001V00
USER.ISF.GDG1.G0002V00
USER.ISF.GDG2
USER.ISF.GDG2.G0001V00
USER.ISF.GDG2.G0002V00
USER.ISF.GDG2.G0003V00
USER.ISF.GDG3
USER.ISF.GDG3.G0001V00
USER.ISF.GDG3.G0002V00

Now, I need to extract all latest generations to output dataset as below:

USER.ISF.GDG1.G0002V00
USER.ISF.GDG2.G0003V00
USER.ISF.GDG3.G0002V00

Any inputs to do this please.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Dec 11, 2007 7:04 pm
Reply with quote

A. If you've already created the dataset list from ISPF 3.4, why not just print it to a dataset and use that as input to your program?

B. Since you already know how to retrieve the information you want using ISPF 3.4, why not call the same ISPF Services that 3.4 uses in your program?

LMDINIT.

LMDLIST.

LMDFREE.

C. There's always LISTCAT.
Back to top
View user's profile Send private message
sudhaaa

New User


Joined: 24 Mar 2005
Posts: 51

PostPosted: Tue Dec 11, 2007 7:59 pm
Reply with quote

Hey Guys, I am really sorry that this is not my query, I have a requirement to code REXX to extract all latest generations into output dataset, and this will be an ongoing process. My requirement is to do using REXX only
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Dec 11, 2007 8:12 pm
Reply with quote

sudhaaa wrote:
My requirement is to do using REXX only


What do you mean by "REXX only"? Do you mean that you can't use TSO commands, ISPF services, or even standard MVS utilities? If that's what you mean, then you can't do this with REXX, as it has no built-in functions to do what you're asking.

Unless, you're talking about a simple batch process:

Code:

//STEPXXXX EXEC PGM=IRXJCL,PARM='DOIT'
//SYSEXEC DD DISP=SHR,DSN=HLQ.REXX
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//IN1 DD DISP=SHR,DSN=USER.ISF.GDG1(0)
//IN2 DD DISP=SHR,DSN=USER.ISF.GDG2(0)
//IN3 DD DISP=SHR,DSN=USER.ISF.GDG3(0)
//OUT DD DSN=USER.ISF.COMB,DISP=(MOD,CATLG,DELETE),...


Code:

/* REXX DOIT */
Do Forever
  "EXECIO 1 DISKR IN1"
  If rc <> 0 Then Leave
  Pull therec
  Push therec
  "EXECIO 1 DISKW OUT"
End
"EXECIO 0 DISKR IN1 (FINIS"
Do Forever
  "EXECIO 1 DISKR IN2"
  If rc <> 0 Then Leave
  Pull therec
  Push therec
  "EXECIO 1 DISKW OUT"
End
"EXECIO 0 DISKR IN2 (FINIS"
Do Forever
  "EXECIO 1 DISKR IN3"
  If rc <> 0 Then Leave
  Pull therec
  Push therec
  "EXECIO 1 DISKW OUT"
End
"EXECIO 0 DISKR IN3 (FINIS"
"EXECIO 0 DISKW OUT (FINIS"
Exit 0


Of course, WHY would you want to do it this way?
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Dec 13, 2007 12:52 am
Reply with quote

Take a look at the example in SYS1.SAMPLIB(IGGCSIRX).

The manual is in the SMS bookshelf and is called "Managing Catalogs"

Everything that you need will be there.
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Help in extracting data between doubl... DFSORT/ICETOOL 5
No new posts DFHPI1008 JSON generation failed COBOL Programming 0
No new posts Started task using a generation dataset JCL & VSAM 7
No new posts Compare latest 2 rows of a table usin... DB2 1
Search our Forums:

Back to Top