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

Oldest generation from SAR


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
janusman

New User


Joined: 09 Sep 2008
Posts: 31
Location: India

PostPosted: Tue Nov 03, 2009 1:19 am
Reply with quote

Hi

While retrieving data from SAR using SARBCH - if we do not give the GEN parameter it will retrieve the latest generation of the Load ID given.

Is there a way to generate OLDEST generation from SAR without giving the GEN number and Sequence??
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Tue Nov 03, 2009 5:05 pm
Reply with quote

Hi,

I too have had the similar issues, Have not found the solution yet.
Latest version can be retrieved w/o specifying the the GEN and SEQ number.
I don't know about the oldest version.

Can anyone shed some light of wisdom please.

Thanks & Regards,
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Nov 04, 2009 5:21 pm
Reply with quote

Hi,
There is a way to extract the oldest generation if you don't have too many reports that meet your selection criteria.

Give the sysin card with GEN parameter as a relative number. Something like as shown below...


Code:
//XK89GOD1 JOB 1,'JWALS',CLASS=2,MSGCLASS=P,NOTIFY=&SYSUID
//UNLOAD   EXEC PGM=SARBCH,PARM='SAR.SARJLD01'             
//SYSPRINT DD SYSOUT=*,DCB=BLKSIZE=133                     
//REPORT   DD SYSOUT=*,DCB=BLKSIZE=133                     
//SARLOAD  DD DSN=XK89.JWA.JWA,DISP=OLD                   
//SYSIN    DD *
/LOAD ID=DL@@EODA GEN=-1
/LOAD ID=DL@@EODA GEN=-2
/LOAD ID=DL@@EODA GEN=-3
/LOAD ID=DL@@EODA GEN=-4
/LOAD ID=DL@@EODA GEN=-5
and so on
.
.
.

//*



The SARLOAD DD should be in DISP=OLD.
Every time the control card is executed, the SARLOAD DD will be rewritten by older version.

At one point the control card will fail saying that the requested report is not found.
At that time you can break the operation and the SARLOAD dataset will have the oldest version.

This may be a nooby technique, but if you want a quick solution, this is what I can offer.

Hope this helps. icon_biggrin.gif

Thanks & Regards,
Back to top
View user's profile Send private message
janusman

New User


Joined: 09 Sep 2008
Posts: 31
Location: India

PostPosted: Fri Nov 06, 2009 10:19 am
Reply with quote

Hi

Thanks for the reply. I have daily reports dating back to 2006-2005.
I was looking to automate taking backups daily an oldest generation or sumthing like that.
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: Fri Nov 06, 2009 10:22 am
Reply with quote

Hello,

Quote:
looking to automate taking backups daily an oldest generation or sumthing like that.
This needs some clarification.

Possibly you could explain with an example?

Keep in mind that what you posted is clear to you, but may not be to others who would like to help.
Back to top
View user's profile Send private message
janusman

New User


Joined: 09 Sep 2008
Posts: 31
Location: India

PostPosted: Sat Nov 07, 2009 2:15 am
Reply with quote

I have some SAR reports that run back to 2006 dates.

Wat happens is - daily - the a new generation is added for that day and the oldest generation is lost. I want to backup that oldest generation. I can manually change the GEN# by seeing the oldest generation and run the job daily.

But i want to automate it. By not giving GEN# - the sar extract jobs takes the newest generation automatically. In the same way - is there a way to refer the oldest generation ?

e.g.
JOBNAME-R12 03/30/2006 01:02 PTAP
JOBNAME-R12 03/29/2006 00:45 PTAP

- this is the oldest generation available in my SAR.

Tonight when a new generation is added this generation the report dated 03/29/2006 will be lost. I want to take a backup of this generation automatically.

Hope this helps.
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: Sat Nov 07, 2009 2:40 am
Reply with quote

Hello,

Quote:
I want to take a backup of this generation automatically.
How will this backup output be named? If this is another gdg, it too will "roll off" after a time. . .

Quote:
is there a way to refer the oldest generation
Unfortunately, I don't "speak" SAR icon_confused.gif
However - If you want to read the oldest cataloged generation, one thing you could do is process the output of a LISTCAT and generate the jcl to do the copy you want. Once implemented, it could be automatic.

Possibly i misunderstand?
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Sat Nov 07, 2009 2:25 pm
Reply with quote

Hi Janusman,

Still the modified version of the above nooby technique is open for you.
If you say that each day a new generation is created and one deleted off then there must be a purge value of something like,"SAR u thing keep only last 400 jobs or something like that"

Give the starting relative SAR reference value as some value starting from -385 increment it one by one to -410(assuming that there are around 400 jobs ). Iterate the same step till it fails.

When the job fails you will have the correct output - How oxymoronic icon_biggrin.gif

BTW - ur name sounds like the second hero charcter in Jab we met movie icon_smile.gif
Regards,
Back to top
View user's profile Send private message
janusman

New User


Joined: 09 Sep 2008
Posts: 31
Location: India

PostPosted: Fri Jan 15, 2010 2:59 am
Reply with quote

Hi

I achieved this today by a series of steps.

1. SAR report listing of the job I needed into a dataset
2. Sort the above dataset to get the oldest record (date, gen#, seq#, report name)
3. Build a control card with the report name, gen#,seq# in a dataset
4. use the above dataset and backup the last generation
5. backup name - I used SYNMANES and had date as a node for the backup.

I can schedule this daily which will take a backup.
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: Fri Jan 15, 2010 3:09 am
Reply with quote

Good to hear it is now working - thank you for posting your solution icon_smile.gif

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

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Mon Jan 18, 2010 2:04 pm
Reply with quote

Hi Janusman,

Good to hear its working,

Could you please give the SYSIN card for step1.
Im aware of getting the JES data from SAR, but how to get the listing of the job O_o.

Quote:
1. SAR report listing of the job I needed into a dataset


Thanks,
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 -> CA Products

 


Similar Topics
Topic Forum Replies
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 Report generation JCL & VSAM 18
No new posts How can I get Generation Nbr of GDG f... IBM Tools 1
No new posts Sequence number generation for multip... DFSORT/ICETOOL 2
Search our Forums:

Back to Top