View previous topic :: View next topic
|
Author |
Message |
janusman
New User
Joined: 09 Sep 2008 Posts: 31 Location: India
|
|
|
|
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 |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
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 |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
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.
Thanks & Regards, |
|
Back to top |
|
|
janusman
New User
Joined: 09 Sep 2008 Posts: 31 Location: India
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
janusman
New User
Joined: 09 Sep 2008 Posts: 31 Location: India
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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
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 |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
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
BTW - ur name sounds like the second hero charcter in Jab we met movie
Regards, |
|
Back to top |
|
|
janusman
New User
Joined: 09 Sep 2008 Posts: 31 Location: India
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good to hear it is now working - thank you for posting your solution
d |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
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 |
|
|
|