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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: To get ABSTIME using Date(MMDDYY) and Time (HHMMSS)
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    Post subject: Reply to: To get ABSTIME using Date(MMDDYY) and Time (HHMMSS)
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Jun 30, 2016 7:16 pm    Post subject:
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: 7904
Location: Bellevue, IA

PostPosted: Thu Jun 30, 2016 8:10 pm    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Thu Jun 30, 2016 9:27 pm    Post subject:
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: 7904
Location: Bellevue, IA

PostPosted: Thu Jun 30, 2016 9:32 pm    Post subject:
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    Post subject: Reply to: To get ABSTIME using Date(MMDDYY) and Time (HHMMSS)
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: 7904
Location: Bellevue, IA

PostPosted: Thu Jun 30, 2016 10:06 pm    Post subject:
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    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Thu Jun 30, 2016 10:21 pm    Post subject:
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    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Thu Jun 30, 2016 10:43 pm    Post subject:
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: 7904
Location: Bellevue, IA

PostPosted: Thu Jun 30, 2016 11:56 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Get a job submitted itself every time... arunsoods JCL & VSAM 3 Tue Nov 22, 2016 4:05 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm


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