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
 

 

How to get local time using CICS commands?

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: How to get local time using CICS commands?
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: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Wed Feb 10, 2016 6:29 pm    Post subject:
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    Post subject:
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    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Feb 17, 2016 5:31 pm    Post subject: Reply to: How to get local time using CICS commands?
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    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Feb 17, 2016 5:58 pm    Post subject: Reply to: How to get local time using CICS commands?
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Feb 17, 2016 6:06 pm    Post subject: Reply to: How to get local time using CICS commands?
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    Post subject:
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    Post subject: THREAD CLOSED!!
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Fri Feb 19, 2016 11:26 pm    Post subject: Reply to: How to get local time using CICS commands?
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.    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
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts DSNACCOX (can it be run on 1 db/ts, t... SRICOBSAS DB2 3 Sat May 06, 2017 12:59 am
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts CICS Transaction Timeout Hooman24 CICS 2 Sun Apr 16, 2017 2:16 pm
No new posts Application not run by time HH:MM tri... jzhardy IBM Tools 1 Sun Apr 09, 2017 3:22 pm


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