View previous topic :: View next topic |
Author |
Message |
sarvan Beginner

Joined: 06 Aug 2007 Posts: 15 Topics: 3 Location: India
|
Posted: Fri Nov 30, 2007 10:12 am Post subject: System Date & Time |
|
|
HI ALL HOW TO DISPLAY THE CURRENT DATE AND TIME USING COBOL PROGRAM. IF IT HAS BEEN ALREADY ANSWERED PLEASE REFER ME THE LINK. THANKS IN ADVANCE _________________ Thanks,
Sarvan.M |
|
Back to top |
|
 |
gd Beginner

Joined: 05 Apr 2006 Posts: 5 Topics: 2
|
Posted: Fri Nov 30, 2007 10:33 am Post subject: |
|
|
Define Date and Time variables in your working storage:
Code: |
01 WS-DATE-TIME
05 WS-RUN-DATE.
10 RUN-CC PIC 9(02) VALUE ZEROES.
10 RUN-YY PIC 9(02) VALUE ZEROES.
10 RUN-MM PIC 9(02) VALUE ZEROES.
10 RUN-DD PIC 9(02) VALUE ZEROES.
05 WS-RUN-TIME.
10 RUN-HRS PIC 9(02) VALUE ZEROES.
10 RUN-MIN PIC 9(02) VALUE ZEROES.
10 RUN-SEC PIC 9(02) VALUE ZEROES.
|
Then in procedure division use logic:
Code: |
MOVE FUNCTION CURRENT-DATE(1:8) TO WS-RUN-DATE.
ACCEPT WS-RUN-TIME FROM TIME.
DISPLAY WS-RUN-DATE.
DISPLAY WS-RUN-TIME. |
|
|
Back to top |
|
 |
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Sat Dec 01, 2007 1:32 pm Post subject: |
|
|
The date and time will BOTH be in FUNCTION CURRENT-DATE. See COBOL manual. _________________ ....Terry |
|
Back to top |
|
 |
vkphani Intermediate

Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Mon Dec 03, 2007 5:30 am Post subject: |
|
|
The CURRENT-DATE function returns a 21-character alphanumeric value that represents the calendar date, time of day, and time differential from Greenwich Mean Time provided by the system on which the function is evaluated.
The function type is alphanumeric.
Check the below link for more explanation.
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3lr10/7.1.9? |
|
Back to top |
|
 |
sarvan Beginner

Joined: 06 Aug 2007 Posts: 15 Topics: 3 Location: India
|
Posted: Thu Dec 06, 2007 12:00 am Post subject: |
|
|
Thanks a lot friends... _________________ Thanks,
Sarvan.M |
|
Back to top |
|
 |
|
|