MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Version Number of a GDG
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
Maneesh Chawla
Beginner


Joined: 13 Dec 2002
Posts: 8
Topics: 2

PostPosted: Thu Dec 19, 2002 12:39 am    Post subject: Version Number of a GDG Reply with quote

Hi Masters,

I am creating a new GDG Version as a abc(+1) in a particular step.

Now is it possible that I can get the exact version of this new dataset as abc.v00x00(with version number) in the same jcl or in a different proc.
_________________
Maneesh Chawla


***If at first you don't succeed, destroy all evidence that you tried***
Back to top
View user's profile Send private message Send e-mail
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Thu Dec 19, 2002 1:35 am    Post subject: Reply with quote

If I understand your question properly all you have to do is reference it in another step/job as +0
Back to top
View user's profile Send private message Visit poster's website
Maneesh Chawla
Beginner


Joined: 13 Dec 2002
Posts: 8
Topics: 2

PostPosted: Thu Dec 19, 2002 1:52 am    Post subject: Reply with quote

Hi Warp,

I dont wanna use the sub scripts for that. I want the exact hard coded version number of that latest GDG version.
_________________
Maneesh Chawla


***If at first you don't succeed, destroy all evidence that you tried***
Back to top
View user's profile Send private message Send e-mail
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Thu Dec 19, 2002 2:31 am    Post subject: Reply with quote

Hi Maneesh,

I don't understand why you want to know the exact name of the GDG. If the job where you have created the GDG has not yet ended, then you can reference your newly created GDG in another step of the same job by appending (+1) to your GDG base. And if you want to reference it in another job, you can do so by appending (0) to the GDG base.
Can you please elaborate a little on your exact requirements wherein you need the exact name of the GDG.

Regards,
Manas
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Maneesh Chawla
Beginner


Joined: 13 Dec 2002
Posts: 8
Topics: 2

PostPosted: Thu Dec 19, 2002 2:58 am    Post subject: Reply with quote

Smile

Dear Manas,

I am sure you got the requirement fine.

I want this to automate the process of paging the final dataset name. (The final version that would be created)
_________________
Maneesh Chawla


***If at first you don't succeed, destroy all evidence that you tried***
Back to top
View user's profile Send private message Send e-mail
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Thu Dec 19, 2002 3:19 am    Post subject: Reply with quote

Yeah Maneesh . I now understand your requirements but I had not got your requirements earlier simply for the reason that I had not done that before - Getting the exact name of a GDG version.
Smile

Regards,
Manas
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Thu Dec 19, 2002 7:07 am    Post subject: Reply with quote

I do not know a direct way of doing this. But, it can be surely be done in two steps. First, being IKJEFT01 or IDCAMS to get all entries for a GDG using LISTCAT. The second step will be an ICETOOLstep. (Sincs, I am in a hurry, I am not posting the code.)

The first step will list all entries for a GDG. To "clean" up this listing, INCLUDE only those records having NON-VSAM in them.

Use the O/P file from above as I/P for ICETOOL. Using INREC, pad sequence number and sort on this sequence number in descending order. Now, take the first record from the O/P file so generated (STOPAFT=1, etc).

Reformat the O/P as per your taste.
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
Maneesh Chawla
Beginner


Joined: 13 Dec 2002
Posts: 8
Topics: 2

PostPosted: Thu Dec 19, 2002 11:33 pm    Post subject: Reply with quote

Thanx alot Mr Cogito-Ergo-Sum

I appretiate the kind efforts of everyone for the help.
_________________
Maneesh Chawla


***If at first you don't succeed, destroy all evidence that you tried***
Back to top
View user's profile Send private message Send e-mail
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Fri Dec 20, 2002 2:24 am    Post subject: Reply with quote

Hey Maneesh!
You can drop the Mr.! Smile

Anway, here is the code.
Code:

//GDGE1010 EXEC PGM=IKJEFT01,
//             COND=(0,LT)
//SYSTSIN  DD  *
LISTCAT ENTRIES('gdg name')
/*
//SYSTSPRT DD  DSN=&&TEMP1010,
//             DISP=(,PASS),
//             UNIT=SYSDA,
//             SPACE=(CYL,(5,8),RLSE),
//             DCB=(LRECL=80,RECFM=FB,BLKSIZE=23440)
//SYSOUT   DD  SYSOUT=*
//** *********************************************************
//GDGE1020 EXEC PGM=ICETOOL,
//             COND=(0,LT)
//TOOLIN   DD  *
 COPY FROM(IN01) TO(T1)     USING(CPY1)
 SORT FROM(T1)   TO(T2)     USING(SRT1)
 COPY FROM(T2)   TO(OT01)   USING(CPY2)
/*
//IN01     DD DSN=&&TEMP1010,
//            DISP=(OLD,DELETE)
//T1       DD DSN=&&TEMP1020,
//            DISP=(,PASS)
//T2       DD DSN=&&TEMP2020,
//            DISP=(,PASS)
//OT01     DD SYSOUT=*
//CPY1CNTL DD *
  INREC   FIELDS=(1,80,SEQNUM,8,ZD)
  INCLUDE COND=(4,7,CH,EQ,C'NONVSAM')
  SORT    FIELDS=COPY
/*
//SRT1CNTL DD *
  SORT    FIELDS=(81,8,ZD,D)
  OUTREC  FIELDS=(17,44,80:X)
/*
//CPY2CNTL DD *
  SORT FIELDS=COPY,
  STOPAFT=1
/*
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*


I was trying to combine the first two TOOLIN statements into one. Though, the job ended sucessfully, the result was opposite. I got the oldest version as O/P.
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Fri Dec 20, 2002 9:14 am    Post subject: Reply with quote

Maneesh chawla,

The following DFSORT jcl will give you the desired results.Cogito has the right idea but he is making 3 passes to get the data.You can avoid all that and do it in just 1 pass.

Code:

//STEP0100 EXEC PGM=IKJEFT01                       
//*                                                 
//SYSTSPRT DD DSN=&L,                               
//            DISP=(,PASS),                         
//            SPACE=(CYL,(X,Y),RLSE),             
//            DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)     
//SYSTSIN  DD *                                     
  LISTCAT ENT('GDG NAME')                   
//*                                                 
//STEP0200 EXEC PGM=ICEMAN           
//*                                 
//SYSOUT   DD SYSOUT=*               
//SORTIN   DD DSN=&L,DISP=(OLD,PASS)
//SORTOUT  DD DSN=YOUR LATEST GDGNAME DSN,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(TRK,(1,1),RLSE)               
//SYSIN    DD *                     
  INCLUDE COND=(4,7,CH,EQ,C'NONVSAM')
  INREC FIELDS=(1,80,SEQNUM,8,ZD)     
  SORT FIELDS=(81,8,ZD,D)             
  OUTFIL ENDREC=1,OUTREC=(17,44,80:X)
/*                                   


Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Fri Dec 20, 2002 10:52 pm    Post subject: Reply with quote

Good one, Kolusu! (I had forgotten about ENDREC Sad )
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
Maneesh Chawla
Beginner


Joined: 13 Dec 2002
Posts: 8
Topics: 2

PostPosted: Sat Dec 21, 2002 1:42 am    Post subject: Reply with quote

Kolusu,

You are simply great !!!!

Thanx alot.
_________________
Maneesh Chawla


***If at first you don't succeed, destroy all evidence that you tried***
Back to top
View user's profile Send private message Send e-mail
GaneshB
Beginner


Joined: 03 Dec 2002
Posts: 17
Topics: 5
Location: Columbus, GA

PostPosted: Mon Dec 23, 2002 4:02 pm    Post subject: Reply with quote

Hi Kolusu,

Is there any command in Syncsort to copy the last record alone to the output file?
_________________
Regards,
Ganesh.B


Last edited by GaneshB on Mon Dec 23, 2002 4:13 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Mon Dec 23, 2002 4:09 pm    Post subject: Reply with quote

GaneshB,


The above posted solution by me also works with syncsort. Let me know if you have any problem. If you have very old version of syncsort it might not support the endrec feature.If that is the case I will show you another way around.

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
GaneshB
Beginner


Joined: 03 Dec 2002
Posts: 17
Topics: 5
Location: Columbus, GA

PostPosted: Mon Dec 23, 2002 4:18 pm    Post subject: Reply with quote

Hi Kolusu,

First of all let me apoligize for editing the question after I have posted. I think when you were answering, I was changing the question. Anyway as you said it seems our system wont support the endrec feature. It would be great if you post the other solution.
_________________
Regards,
Ganesh.B
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group