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

To get ABSTIME using Date(MMDDYY) and Time (HHMMSS)


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
krish2309

New User


Joined: 29 Jan 2014
Posts: 17
Location: Kuala Lumpur

PostPosted: Thu Jun 30, 2016 9:55 am
Reply with quote

Dear All,

Can anyone help to advise any CICS command to calculate Abstime using Date and Time as input?

Thank you
Best regards
Krishna
Back to top
View user's profile Send private message
krish2309

New User


Joined: 29 Jan 2014
Posts: 17
Location: Kuala Lumpur

PostPosted: Thu Jun 30, 2016 3:42 pm
Reply with quote

Hi All,

I am trying convert time into millisecond and subtract from ABSTIME. I hope it will solve. Thank you..

best regards,
Krishna
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


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

PostPosted: Thu Jun 30, 2016 7:16 pm
Reply with quote

In one day asking the same?

Maybe you tell us twice in one day what YOU did?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Jun 30, 2016 8:10 pm
Reply with quote

I'm not aware of any CICS API to go from date/time to ABSTIME. However, since the manual tells you that ABSTIME is the number of milliseconds from 00:00 on January 1, 1900 it is not difficult to convert the date/time into an ABSTIME value. It would best be done by a program to minimize human calculation errors.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Thu Jun 30, 2016 9:27 pm
Reply with quote

FORMATTIME
What is your exact requirement?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Jun 30, 2016 9:32 pm
Reply with quote

Rohit, FORMATTIME does the exact opposite of what was requested -- it takes an ABSTIME value and converts it to date and time. What was asked for was something to take date and time into an ABSTIME value.
Back to top
View user's profile Send private message
krish2309

New User


Joined: 29 Jan 2014
Posts: 17
Location: Kuala Lumpur

PostPosted: Thu Jun 30, 2016 9:46 pm
Reply with quote

Hi All,

We will be receiving time & date from different region but the requirement is to send GMT as o/p. This could be same day.

My thinking is that

Fetch Abstime,

Convert the EIB time into milliseconds
Also the convert the time in millisecond which received from other region
Get the difference of both then subtract it from ABSTIME and formattime to get the GMT.

Kindly please advise if you find any error

Thank you

Best regards,
Krishna
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Jun 30, 2016 10:06 pm
Reply with quote

Why not do it the easy way?

EXEC CICS ASKTIME ABSTIME(<abstimevar>)
EXEC CICS FORMATTIME ABSTIME(<abstimevar>) DATESTRING(<varname>) and bytes 18 to 25 will have GMT in HH:MM:SS format

This is another example of someone posting how they want to do something rather than just posting the issue. If you had said you need to get GMT in CICS (instead of saying your issue is to convert date/time values to ABSTIME), you probably would have gotten this solution much quicker.
Back to top
View user's profile Send private message
krish2309

New User


Joined: 29 Jan 2014
Posts: 17
Location: Kuala Lumpur

PostPosted: Thu Jun 30, 2016 10:16 pm
Reply with quote

Hi Robert,

Sorry for the confusion. I may not have explained the problem correctly.

I only have date and time which receive from another CICS region which MMDDYY and HH:MM:SS. I believe cannot use the ASK ABSTIME directly to convert HH:MM:SS to GMT.

Thank you
Best Regards,
Krishna
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Thu Jun 30, 2016 10:21 pm
Reply with quote

Quote:
This is another example of someone posting how they want to do something rather than just posting the issue. If you had said you need to get GMT in CICS (instead of saying your issue is to convert date/time values to ABSTIME), you probably would have gotten this solution much quicker.
Hence I asked "What is your exact requirement?"
icon_smile.gif
One of your advice here which TS could have searched.
Is that answers your problem?
Back to top
View user's profile Send private message
krish2309

New User


Joined: 29 Jan 2014
Posts: 17
Location: Kuala Lumpur

PostPosted: Thu Jun 30, 2016 10:28 pm
Reply with quote

hi Rohit,

I accept and correct myself for Robert's comment. But i feel being hurt by your comment. Hope you understand.

I also wants to add here that i do search here(this forum)/ IBM manual before make any post here.

Thanks


Regards
Krishna
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Thu Jun 30, 2016 10:43 pm
Reply with quote

My bad if you take it that way icon_redface.gif . I am just saying if you could tell the requirement exactly then you would get a quicker and better solution. Also when you claim you did check the manuals and this forum then how did you not find what I found?
From the Manual...
Code:
To obtain an elapsed time in a particular format, the ABSTIME data value can be the difference between two values that are returned by ASKTIME, and options such as DAYCOUNT(d) and TIME(t) can be specified.When you use the DATESTRING option to request an architected date and time stamp string that requires the clock time to be at GMT or Coordinated Universal Time (UTC), CICS calculates the required timezone offset from your supplied ABSTIME value, which is in local time, and produces the date and time stamp string in GMT or UTC. All other values that are returned by the FORMATTIME command, such as the TIME value, are returned in local time. It is therefore normal for the FORMATTIME command to produce an architected date and time stamp string that shows one date and time, and return other values that show another date and time, for the same supplied ABSTIME value.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Jun 30, 2016 11:56 pm
Reply with quote

Quote:
I only have date and time which receive from another CICS region which MMDDYY and HH:MM:SS.
This may get complicated. Are the other CICS region or regions in the same time zone as your site? If so, use the method I provided earlier to get local and GMT time for your site and subtract the GMT time from the local time to get the GMT offset; you can then adjust the received date / time values appropriately. If the other CICS region(s) can be in a different time zone (or zones), then you have the additional issue that a GMT offset calculation for your time zone does you absolutely no good unless you know the relative difference in time zones from the source of the date / time. If you're dealing with a single source and time zone, you can use a fixed difference; if you're dealing with multiple source time zones, your best bet would be to get the date / time values sent to you with GMT offset included such as ISO 8601 format.
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
Search our Forums:

Back to Top