Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Syncsort for Adding days to input date

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort for Adding days to input date
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: 500
Location: USA

PostPosted: Thu Dec 10, 2009 9:45 pm    Post subject:
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    Post subject: Reply to: Syncsort for Adding days to input date
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

Site Director


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

PostPosted: Fri Dec 11, 2009 8:03 pm    Post subject:
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    Post subject: Reply to: Syncsort for Adding days to input date
Reply with quote

Hi dick,

At last, using db2 date function.

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Sat Dec 12, 2009 7:57 pm    Post subject: Reply to: Syncsort for Adding days to input date
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Sat Dec 12, 2009 10:56 pm    Post subject: Re: Reply to: Syncsort for Adding days to input date
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Sat Dec 12, 2009 11:08 pm    Post subject: Reply to: Syncsort for Adding days to input date
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Sat Dec 12, 2009 11:43 pm    Post subject: Re: Reply to: Syncsort for Adding days to input date
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Sun Dec 13, 2009 2:16 pm    Post subject: Reply to: Syncsort for Adding days to input date
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Sun Dec 13, 2009 3:38 pm    Post subject: Re: Reply to: Syncsort for Adding days to input date
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

Site Director


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

PostPosted: Mon Dec 14, 2009 4:00 am    Post subject: Reply to: Syncsort for Adding days to input date
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 17 Tue Dec 06, 2016 8:04 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us