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

Syncsort for Adding days to input date


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mssabirami

New User


Joined: 11 Feb 2008
Posts: 17
Location: Chennai

PostPosted: Thu Dec 10, 2009 12:48 pm
Reply with quote

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
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Thu Dec 10, 2009 9:45 pm
Reply with quote

Date arithmetic is not yet available in SyncSort for z/OS, unless it is an offset from the current system date.
Back to top
View user's profile Send private message
mssabirami

New User


Joined: 11 Feb 2008
Posts: 17
Location: Chennai

PostPosted: Fri Dec 11, 2009 7:48 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Fri Dec 11, 2009 8:03 pm
Reply with quote

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
View user's profile Send private message
mssabirami

New User


Joined: 11 Feb 2008
Posts: 17
Location: Chennai

PostPosted: Sat Dec 12, 2009 8:51 am
Reply with quote

Hi dick,

At last, using db2 date function.

Thanks,
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Sat Dec 12, 2009 7:57 pm
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Sat Dec 12, 2009 10:56 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Sat Dec 12, 2009 11:08 pm
Reply with quote

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.... icon_biggrin.gif

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Sat Dec 12, 2009 11:43 pm
Reply with quote

[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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Sun Dec 13, 2009 2:16 pm
Reply with quote

Hi Peter!
You are pretty new to the forum icon_biggrin.gif , 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 icon_wink.gif
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Sun Dec 13, 2009 3:38 pm
Reply with quote

enrico-sorichetti wrote:
Hi Peter!
You are pretty new to the forum icon_biggrin.gif , 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 icon_wink.gif


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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Mon Dec 14, 2009 4:00 am
Reply with quote

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". . . icon_neutral.gif

d
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts COBOL sorting, with input GDG base COBOL Programming 7
No new posts Syncsort help SYNCSORT 3
No new posts Date format correction using dfsort DFSORT/ICETOOL 3
No new posts SYNCSORT-DB2 interface SYNCSORT 0
No new posts Sorting Date Field DFSORT/ICETOOL 4
Search our Forums:

Back to Top