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

How to get local time using CICS commands?


IBM Mainframe Forums -> CICS
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
DAVID JOHN

New User


Joined: 10 Feb 2016
Posts: 5
Location: INDIA

PostPosted: Wed Feb 10, 2016 3:16 pm
Reply with quote

Hi!

I'm trying to get the local time using CICS commands.

The below command gives the LOCAL time when the MAINFRAME is hosted.
In our case EST (Eastern Standard Time).
EXEC CICS ASKTIME

Now, when we log in from India IST (-5.30 from EST) using QWS3270 Emulator, we would like to get the LOCAL LOGIN TIME.

fyi
We are able to get the local IP Address using the below command.

EXEC CICS INQUIRE
ASSOCIATION (EIBTASKN)
CLIENTIPADDR (WS-CLIENT-IP)
END-EXEC

How do we get it?
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: Wed Feb 10, 2016 6:29 pm
Reply with quote

I'm not aware of any way to do this. The mainframe has one clock, which is (usually) set to local time (although I have seen UMT used as well). As far as I know, CICS has no way to associate an IP address or terminal name with a particular time zone.
Back to top
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Wed Feb 17, 2016 12:11 pm
Reply with quote

I'm not sure.... but I find this...

Converts an architected date and time stamp string to the ASKTIME format.

Read syntax diagramSkip visual syntax diagram
CONVERTTIME

>>-CONVERTTIME--DATESTRING(data-area)--ASKTIME(data-area)------><

CONVERTTIME analyzes four different date and time stamp formats that are commonly used on the Internet, and converts them to the ASKTIME (absolute date and time) format, in local time.
Back to top
View user's profile Send private message
DAVID JOHN

New User


Joined: 10 Feb 2016
Posts: 5
Location: INDIA

PostPosted: Wed Feb 17, 2016 2:09 pm
Reply with quote

Thanks Robert & Suresh.
We used the UTC with an offset of the timezone.
We got the TimeZone using FUNCTION CURRENT-DATE.

We could not get the local IST time.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Feb 17, 2016 5:31 pm
Reply with quote

You can also obtain the UTC/GMT offset by calling LE Callable Service routine "CEEGMTO".

If you're using FUNCTION CURRENT-DATE just to obtain the GMT-Offset in positions 17-21 of this FUNCTION, "CEEGMTO" would be a more efficient approach.
Back to top
View user's profile Send private message
DAVID JOHN

New User


Joined: 10 Feb 2016
Posts: 5
Location: INDIA

PostPosted: Wed Feb 17, 2016 5:38 pm
Reply with quote

Thanks for that Bill.
In our case we are using this to get the timestamp too.

01 WS-CURRENT-DATE-TIME.
05 WS-CURRENT-DATE.
10 WS-CURRENT-YEAR PIC 9(04).
10 WS-CURRENT-MONTH PIC 9(02).
10 WS-CURRENT-DAY PIC 9(02).
05 WS-CURRENT-TIME.
10 WS-CURRENT-HOURS PIC 9(02).
10 WS-CURRENT-MINUTE PIC 9(02).
10 WS-CURRENT-SECOND PIC 9(02).
10 WS-CURRENT-MILLSEC PIC 9(02).
05 WS-DIFF-FROM-GMT PIC S9(04).
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Feb 17, 2016 5:58 pm
Reply with quote

OK, gotcha.

But, wouldn't WS-DIFF-FROM-GMT PIC S9(04) have to be defined as SIGN LEADING SEPARATE, because there's a '+' or a '-' in position 17, followed by the GMT-Offset HHMM in positions 18-21?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Feb 17, 2016 6:06 pm
Reply with quote

That's good eyes, Mr Bill.
Back to top
View user's profile Send private message
DAVID JOHN

New User


Joined: 10 Feb 2016
Posts: 5
Location: INDIA

PostPosted: Wed Feb 17, 2016 7:02 pm
Reply with quote

Bill, you are right. This is what we did.icon_arrow.gif

05 WS-DIFF-FROM-GMT.
10 WS-DIFF-GMT-SIGN PIC X(01).
10 WS-DIFF-GMT-TIME PIC 9(04).

36_2_51.gif
Back to top
View user's profile Send private message
DAVID JOHN

New User


Joined: 10 Feb 2016
Posts: 5
Location: INDIA

PostPosted: Fri Feb 19, 2016 10:19 pm
Reply with quote

We can close this thread. Is there anyway I can indicate that?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Feb 19, 2016 11:26 pm
Reply with quote

thread closed ( locked ) per TS request
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
No new posts Calling an Open C library function in... CICS 1
No new posts How to 'Ping' a CICS region in JCL CICS 2
Search our Forums:

Back to Top