View previous topic :: View next topic
|
Author |
Message |
DAVID JOHN
New User
Joined: 10 Feb 2016 Posts: 5 Location: INDIA
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
sureshpathi10
Active User
Joined: 03 May 2010 Posts: 154 Location: Kuala Lumpur
|
|
|
|
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 |
|
|
DAVID JOHN
New User
Joined: 10 Feb 2016 Posts: 5 Location: INDIA
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
DAVID JOHN
New User
Joined: 10 Feb 2016 Posts: 5 Location: INDIA
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
That's good eyes, Mr Bill. |
|
Back to top |
|
|
DAVID JOHN
New User
Joined: 10 Feb 2016 Posts: 5 Location: INDIA
|
|
|
|
Bill, you are right. This is what we did.
05 WS-DIFF-FROM-GMT.
10 WS-DIFF-GMT-SIGN PIC X(01).
10 WS-DIFF-GMT-TIME PIC 9(04).
|
|
Back to top |
|
|
DAVID JOHN
New User
Joined: 10 Feb 2016 Posts: 5 Location: INDIA
|
|
|
|
We can close this thread. Is there anyway I can indicate that? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
thread closed ( locked ) per TS request |
|
Back to top |
|
|
|