GDG Generations



IBM's Command List programming language & Restructured Extended Executor

GDG Generations

Postby vamsyk9 » Fri Feb 10, 2012 10:44 am

Hi,

I am trying with the below code , but it is giving later version code , I tried giving Dataset.GDG(-2) but gives me error. Do i need to change anything below.

/* REXX */
PARSE UPPER PULL GDG
DSN = STRIP(GDG!!".G0000V00") /* DEFAULT IF NOT EXIST */
X=OUTTRAP(LST.) /* LISTCAT GDG BASE */
" LISTC ENT('"GDG"')"
X=OUTTRAP(OFF)
DO A = LST.0 TO 1 BY -1 /* FIRST FIND = 0 GDG */
  IF POS('NONVSAM',LST.A) > 0 THEN DO
    DSN = SUBSTR(LST.A,POS('NONVSAM',LST.A)+13,44)
    A = 0
  END
END
SAY "GDG=" GDG
SAY "DSN =" DSN
GDG1= SUBSTR(DSN,19,8)
QUEUE GDG1
"EXECIO "QUEUED() "DISKW OUTSRCH (FINIS"
vamsyk9
 
Posts: 24
Joined: Mon Nov 28, 2011 7:19 pm
Has thanked: 0 time
Been thanked: 0 time

Re: GDG Generations

 

Re: GDG Generations

Postby NicC » Fri Feb 10, 2012 11:53 am

I am trying with the below code , but it is giving later version code

I do not know what the above means - I read it to mean that you are using the program quoted below but it is using a later version of the program. This is gibberish. If you mean GDG version then you are not touching the V00 part of the dataset name at any point in the program.

You do realise that you are quitting your loop as soon as you find the string 'NONVSAM' and nowhere are you specifying a generation other than the later - except G0000V00 for the default.

By now you shaould also know to use the code tags to make your code readable - preserve spacing.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: GDG Generations

Postby expat » Fri Feb 10, 2012 1:03 pm

My code is doing exactly what it was written to do, to obtain the latest generation of any given GDS.

You need to adapt the code to suit your purpose.
expat
 
Posts: 382
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 1 time

Re: GDG Generations

Postby vamsyk9 » Fri Feb 10, 2012 9:22 pm

Thanks for the above. I am new to Rexx and trying to learn things.

It would be great if you can guide me to change.
vamsyk9
 
Posts: 24
Joined: Mon Nov 28, 2011 7:19 pm
Has thanked: 0 time
Been thanked: 0 time

Re: GDG Generations

Postby NicC » Sat Feb 11, 2012 1:43 am

Best way to learn is get the manual, get another rexx program, read the manual, study the program. You can also get rexx on your PC so that you can practice at home - the i/o is different but, depending on which version of rexx for the pc you ,most of the other stuff is compatible.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: GDG Generations

Postby enrico-sorichetti » Sat Feb 11, 2012 2:04 am

oorexx provides EXECIO
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2643
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times


Return to CLIST & REXX