Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Incrementing current time field by 30 Minutes

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

New User


Joined: 13 Jul 2016
Posts: 33
Location: India

PostPosted: Thu Oct 26, 2017 3:22 pm    Post subject: Incrementing current time field by 30 Minutes
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: 1922
Location: UK

PostPosted: Thu Oct 26, 2017 5:13 pm    Post subject:
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: 33
Location: India

PostPosted: Thu Oct 26, 2017 5:45 pm    Post subject:
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: 1922
Location: UK

PostPosted: Thu Oct 26, 2017 7:52 pm    Post subject:
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: 33
Location: India

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

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

Senior Member


Joined: 07 Feb 2009
Posts: 1067
Location: Oostende, Belgium

PostPosted: Thu Oct 26, 2017 8:37 pm    Post subject:
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 User


Joined: 29 Apr 2008
Posts: 212
Location: Maryland

PostPosted: Thu Oct 26, 2017 8:58 pm    Post subject:
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: 33
Location: India

PostPosted: Fri Oct 27, 2017 12:08 pm    Post subject:
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: 585
Location: The Universe

PostPosted: Fri Oct 27, 2017 6:04 pm    Post subject:
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 User


Joined: 29 Apr 2008
Posts: 212
Location: Maryland

PostPosted: Fri Oct 27, 2017 7:35 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10350
Location: italy

PostPosted: Mon Oct 30, 2017 2:39 pm    Post subject: Reply to: Incrementing current time field by 30 Minutes
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: 1922
Location: UK

PostPosted: Mon Oct 30, 2017 5:14 pm    Post subject:
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.    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Comparision with current time arunsoods DFSORT/ICETOOL 5 Thu Nov 09, 2017 10:37 am
This topic is locked: you cannot edit posts or make replies. Comparing current time with the time ... arunsoods SYNCSORT 1 Mon Oct 30, 2017 4:07 pm
This topic is locked: you cannot edit posts or make replies. 00D3003B - time outs in DB2 when invo... chavinash2004 DB2 2 Mon Oct 09, 2017 4:39 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts VSAM RLS Wait time blayek JCL & VSAM 2 Mon Oct 02, 2017 9:05 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us