View previous topic :: View next topic
|
Author |
Message |
mssabirami
New User
Joined: 11 Feb 2008 Posts: 17 Location: Chennai
|
|
|
|
Hi,
We have input file with run start date and end date in it.
At the end of the job, we need to add 7 days to the start date and end date.
File details:
LRECL: 80; FB file.
Input File contents:
2009113020091206
Expected output:
2009120720091213
Thanks, |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
Date arithmetic is not yet available in SyncSort for z/OS, unless it is an offset from the current system date. |
|
Back to top |
|
|
mssabirami
New User
Joined: 11 Feb 2008 Posts: 17 Location: Chennai
|
|
|
|
Hi Alissa,
Is there any way to convert the gregorian date to julian date.
Then add 7 days to julian. And then convert back this julian date to gregorian date in syncsort??
Thanks, |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Date arithmetic is not yet available in SyncSort for z/OS |
Rather clear. . .
Hopefully, you have begun working on an alternative. . .
One thought might be to use date functions in db2. . . |
|
Back to top |
|
|
mssabirami
New User
Joined: 11 Feb 2008 Posts: 17 Location: Chennai
|
|
|
|
Hi dick,
At last, using db2 date function.
Thanks, |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
to disturb db2 for a simple data calculations seems a bit of overshooting
if You had searched better the forums You would have found lots of examples
using a simple cobol or even simpler a rexx script
for example to add 7 days to a variable containing a date in the format
yyyymmdd ( rexx SORTED representation ) and get the new data in the same format ...
Code: |
olddate = yyyymmdd
tmpdate = date("B",olddate,"S") + 7
newdate = date("S",olddate,"B") |
|
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
enrico-sorichetti wrote: |
to disturb db2 for a simple data calculations seems a bit of overshooting
if You had searched better the forums You would have found lots of examples
using a simple cobol or even simpler a rexx script
for example to add 7 days to a variable containing a date in the format
yyyymmdd ( rexx SORTED representation ) and get the new data in the same format ...
Code: |
olddate = yyyymmdd
tmpdate = date("B",olddate,"S") + 7
newdate = date("S",olddate,"B") |
|
And how about processing a huge dataset in rexx?
I got the idea that that is advised against by a lot of commenters
(to be true only a few) here.
SAS, Easytrieve e.g. could do the job too. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Quote: |
And how about processing a huge dataset in rexx?
I got the idea that that is advised against by a lot of commenters |
I am one of them....
but from the ts(*) wording I got the impression that it was a dataset containing just one record
Adding an artificial db2 dependency where none is needed would be a waste of resources
precompile, bind, all the change management stuff, add as many as You want
in cobol dateofinteger(integerofdate + 7) would have achieved the same result,
even the CEE.... stuff would have achieved the same
just two lines of code
I would also add that such approach would never pass any decent quality assurance review
(*) topic starter |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
[quote="enrico-sorichetti"]
Quote: |
ts(*) topic starter |
With all due respect, i know what a ts is. I had some difficulties with
"op" (original poster?).
But a dataset with 1 record?
I know a lot of cardlib libraries with control records
for utilities for example. But they are static files.
In my experience, if we are talking about date control cards in one record,
they were mostly in stream and changed manually by certified personnel. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Hi Peter!
You are pretty new to the forum , You will see shortly what appalling situations we are facing here,
a "one record dataset" to keep track of something is not to be considered outrageous around here |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
enrico-sorichetti wrote: |
Hi Peter!
You are pretty new to the forum , You will see shortly what appalling situations we are facing here,
a "one record dataset" to keep track of something is not to be considered outrageous around here |
Hello Enrico,
thats very true. I thought i had seen it all in my IT life,
but then I am surely mistaken. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Stick around. . .
For some time to come yet, we (IT) are in a downward spiral.
There are more and more systems being supported by less and less able people. Many/most new people do not receive appropriate training - but it is the only training they have available.
And it is even more out of control in some of the "server environments".
I'll cease before getting on a major "roll". . .
d |
|
Back to top |
|
|
|