View previous topic :: View next topic
|
Author |
Message |
arunsoods
New User
Joined: 13 Jul 2016 Posts: 35 Location: India
|
|
|
|
Hi Team,
I need to increment current time I got using below code by 30 mins.
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(5:&TIME2)
/* |
Any Suggestion ...!! |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Does the manual say that this can be done? |
|
Back to top |
|
|
arunsoods
New User
Joined: 13 Jul 2016 Posts: 35 Location: India
|
|
|
|
For the date function we can increment. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Date is not time so why bring that into it? |
|
Back to top |
|
|
arunsoods
New User
Joined: 13 Jul 2016 Posts: 35 Location: India
|
|
|
|
For the date function we can increment. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
Don't be afraid to make a mistake. But make sure you don't make the same mistake twice. (Akio Morita)
'nuff said...
And furthermore, your question has fluck all to do with JCL! |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2023 Location: USA
|
|
|
|
Code: |
//TIME2 EXEC PGM=SYNCSORT,COND=(0,NE)
//*
//SYSOUT DD SYSOUT=*
//*
//SORTIN DD *
--------------------------------------------------
//*
//SORTOUT DD SYSOUT=*
//*
//SYSIN DD *
INREC FIELDS=(5:&TIME2)
SORT FIELDS=COPY
OUTREC FIELDS=(1:5,4, ORIGINAL TIME2
10:5,4,ZD,EDIT=(TT.TT), ORIGINAL TIME2 IN CHARS
20:5,4,ZD,ADD,+30,EDIT=(TT.TT)) UPDATED TIME2 IN CHARS
END
//* |
|
|
Back to top |
|
|
arunsoods
New User
Joined: 13 Jul 2016 Posts: 35 Location: India
|
|
|
|
Thanks Serheyken for the response.
I am getting below output when I am using it:-
Where as it should be:-
I want to increment the time by 30 Minutes and not 30 as decimal.
I hope you understood the problem |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
As Prino says, this is not a JCL question; it is, or should be, a sort question, as (presumably) the sort product is the entity altering a time value in data. JCL cannot manipulate or alter data in any way. JCL simply specifies the resources required to run a program.
Second, I do not think the topic starter has thought this through. A time of day is always linked to a date, at least by implication. If I say it is 23:45 I imply it is also today (presumably October 27), so to add 30 minutes to 23:45 I also imply it is 00:15 October 28. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2023 Location: USA
|
|
|
|
arunsoods wrote: |
I want to increment the time by 30 Minutes and not 30 as decimal.
I hope you understood the problem |
SORT is not supposed to seriously manipulate with specific data types, like TIME. In general, one can use a number of sophisticated combination of IFTHEN/WHEN parameters to recalculate it as desired. But in this case it would resemble an attempt to calculate a square root value using SORT facility... |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
the problem was not given enough consideration ...
the TS did not take into account that for the times after 23.30
the increment would imply a date change also |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Not a dfsort problem - TS is using Syncsort. Locked. |
|
Back to top |
|
|
|