View previous topic :: View next topic
|
Author |
Message |
sindhu_raghu Currently Banned New User
Joined: 18 Mar 2009 Posts: 7 Location: trichy
|
|
|
|
how to display the system date and time in the map initially when the application program is cobol? |
|
Back to top |
|
|
muthuvel
Active User
Joined: 29 Nov 2005 Posts: 217 Location: Canada
|
|
|
|
Allocate a field for it in the MAPSCREEN and in the program use ASKTIME to get current time and date. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
what is wrong with using eibdate and eibtime?
they are already populated.
why incur the extra cpu resource for an asktime and format? |
|
Back to top |
|
|
sindhu_raghu Currently Banned New User
Joined: 18 Mar 2009 Posts: 7 Location: trichy
|
|
|
|
i have used eibdate and eidtime but i cant interpret the date format
i want the date to be displayed in standard format |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
There are numerous date-formats as well as a time-format available from the FORMATTIME command. However, you need to issue an ASKTIME ABSTIME command beforehand. The overhead is negligible and their usage is very straightforward.
Review the applicable CICS Application Programmer Reference manual for the proper syntax and usage.
Click here -
ibmmainframes.com/manuals.php
Regards, |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
EIBDATE is defined as PIC S9(7) COMP-3 .
The Fine manual states
Quote: |
The date is in packed decimal form (0CYYDDD+) where C shows the century with values 0 for the 1900s and 1 for the 2000s. For example, the dates 31 December 1999 and 1 January 2000 have EIBDATE values of 0099365 and 0100001 respectively. |
You just need to unpack using a suitable PICTURE.
Dick,
Garry.
Quote: |
what is wrong with using eibdate and eibtime?
|
Depending on when you access them, EIBDATE and EIBTIME fields may not be exact. The ASKTIME refreshes both.
Garry. |
|
Back to top |
|
|
Vishu
New User
Joined: 23 Mar 2009 Posts: 22 Location: Bangalore
|
|
|
|
You can use the following code:
EXEC CICS ASKTIME ABSTIME(WS-ABSTIME)
END-EXEC.
EXEC CICS FORMATTIME ABSTIME(WS-ABSTIME)
DDMMYY(WS-DATE)
DATESEP('/')
TIME(WS-TIME)
TIMESEP(':')
END-EXEC.
**
DDMMYY can be changed to DDMMYYYY etc |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
Code: |
05 WS-DATE-CURRENT.
10 WS-DATE-CUR-CCYY.
15 WS-DATE-CUR-CC PIC 9(02) VALUE ZEROES.
15 WS-DATE-CUR-YY PIC 9(02) VALUE ZEROES.
10 WS-DATE-CUR-MM PIC 9(02) VALUE ZEROES.
10 WS-DATE-CUR-DD PIC 9(02) VALUE ZEROES.
10 WS-TIME-CUR-HH PIC 9(02) VALUE ZEROES.
10 WS-TIME-CUR-MM PIC 9(02) VALUE ZEROES.
10 WS-TIME-CUR-SS PIC 9(02) VALUE ZEROES.
10 WS-TIME-CUR-MS PIC 9(02) VALUE ZEROES.
10 WS-TIME-LOC-ID PIC X(01) VALUE SPACES.
10 WS-TIME-GMT-HR PIC 9(02) VALUE ZEROES.
10 WS-TIME-GMT-MM PIC 9(02) VALUE ZEROES. |
then you can display it anyway you like on the screen.
Code: |
MOVE FUNCTION CURRENT-DATE TO WS-DATE-CURRENT |
|
|
Back to top |
|
|
|