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

Incrementing current time field by 30 Minutes


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
arunsoods

New User


Joined: 13 Jul 2016
Posts: 35
Location: India

PostPosted: Thu Oct 26, 2017 3:22 pm
Reply with quote

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

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Oct 26, 2017 5:13 pm
Reply with quote

Does the manual say that this can be done?
Back to top
View user's profile Send private message
arunsoods

New User


Joined: 13 Jul 2016
Posts: 35
Location: India

PostPosted: Thu Oct 26, 2017 5:45 pm
Reply with quote

For the date function we can increment.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Oct 26, 2017 7:52 pm
Reply with quote

Date is not time so why bring that into it?
Back to top
View user's profile Send private message
arunsoods

New User


Joined: 13 Jul 2016
Posts: 35
Location: India

PostPosted: Thu Oct 26, 2017 8:19 pm
Reply with quote

For the date function we can increment.
Back to top
View user's profile Send private message
prino
Warnings : 1

Senior Member


Joined: 07 Feb 2009
Posts: 1244
Location: Vilnius, Lithuania

PostPosted: Thu Oct 26, 2017 8:37 pm
Reply with quote

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

Active Member


Joined: 29 Apr 2008
Posts: 967
Location: Maryland

PostPosted: Thu Oct 26, 2017 8:58 pm
Reply with quote

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

New User


Joined: 13 Jul 2016
Posts: 35
Location: India

PostPosted: Fri Oct 27, 2017 12:08 pm
Reply with quote

Thanks Serheyken for the response.

I am getting below output when I am using it:-

Code:
2331     23.31                23.61


Where as it should be:-

Code:
2331     23.31                00.01


I want to increment the time by 30 Minutes and not 30 as decimal.
I hope you understood the problem
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 870
Location: The Universe

PostPosted: Fri Oct 27, 2017 6:04 pm
Reply with quote

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

Active Member


Joined: 29 Apr 2008
Posts: 967
Location: Maryland

PostPosted: Fri Oct 27, 2017 7:35 pm
Reply with quote

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... icon_pray.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Moderator


Joined: 14 Mar 2007
Posts: 10730
Location: italy

PostPosted: Mon Oct 30, 2017 2:39 pm
Reply with quote

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

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Oct 30, 2017 5:14 pm
Reply with quote

Not a dfsort problem - TS is using Syncsort. Locked.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Modify Several JCLs at the Same Time JCL & VSAM 6
This topic is locked: you cannot edit posts or make replies. Passing a field name to COBOL program COBOL Programming 10
No new posts Hex Value - vb file replace old date ... DFSORT/ICETOOL 14
No new posts BMS map length field greater than zero CICS 3
No new posts Break a record into fields, each fiel... SYNCSORT 2
Search our Forums:

Back to Top