View previous topic :: View next topic
|
Author |
Message |
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
Hi,
I have 5 steps in my Job and the output of 5th step (i.e. last step) will have disposition MOD as we want to append records to the output dataset everyday.
My requirement is on the 200 calender day, this dataset should be copied into GDG and deleted (so, on very 200th calander day(i.e, 200,400,...), this backup and delete step should be executed). Can we do this in the same JCL using DFSORT?
Regards,
KSK |
|
Back to top |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
Adding to the above, output of 5th step file contains "Current Date" colomn also. So, every day Current date is added to each record of the file.
Is there any way to do the above requirement from initial date and current date using DFSORT? |
|
Back to top |
|
|
Anu R
New User
Joined: 09 Apr 2008 Posts: 18 Location: India
|
|
|
|
Hi Ksk,
Please provide more information as to what is the format of the date in the file.Whether it is Julian or gregorian.And whether the initial date has to be taken from the file or can it be hardcoded? |
|
Back to top |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
Format of the file in the input file is YYYYMMDD. Initial date also extracted using CURRENT DATE function only. Everyday when job runs, current date would be extracted.
So, if job runs 200 calendar days back, the value of that colomn would be 200 days back date and as job is running daily, today it would extract today's date as Current Date.
Let me know if you are not clear. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Sounds like a job for the scheduling software to handle.
Are we talking total days or working days here ?
Either way the scheduling SW can schedule jobs every nnn days using either the everyday or working days calender. |
|
Back to top |
|
|
Anu R
New User
Joined: 09 Apr 2008 Posts: 18 Location: India
|
|
|
|
Ksk,
Can you explain it with an example so that I can understand it better. |
|
Back to top |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
Expat,
We can schedule if we write a new job for backup and delete. Can we write this step in the same job after STEP5?
I am talikng about total days. |
|
Back to top |
|
|
Santoshdorge
New User
Joined: 27 Jun 2006 Posts: 48 Location: Pune
|
|
|
|
Hi KSK,
I am not sure why you want to do this in same job.But here is solution you can follow to achieve what you want.
step 6 : in your JCL
You can write a program (cobol/ rexx or any language ) read the file.check the date in file and date of 200th day of year and set the return code to 1000 ( any value).
Step 7:
Depending on the return code execute backup job and delete input file.
I am not sure how this can be done in DFSORT.
Thanks,
Santosh. |
|
Back to top |
|
|
jayreddy
New User
Joined: 07 Apr 2008 Posts: 10 Location: Mumbai
|
|
|
|
Hi
I got this from
www-304.ibm.com/systems/support/storage/software/sort/mvs/peug/pdf/sortpeug.pdf
I think you can use Past date or Future date as the decimal number in the COND statement.
eg formats :
Format of Operand Format of Constant Ex of Operand Ex const
Date3p+d +YYYYDDD Date3p+200 +2008302
if you take your job runs today 2008 11 april as current date and then after 200 days it should be 302 day in the year.
I think you can keep your Date3p+200 in the Cond and execute your backup and delete steps.
Regards
Jay |
|
Back to top |
|
|
|