MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

System Date & Time

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
sarvan
Beginner


Joined: 06 Aug 2007
Posts: 15
Topics: 3
Location: India

PostPosted: Fri Nov 30, 2007 10:12 am    Post subject: System Date & Time Reply with quote

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
View user's profile Send private message Yahoo Messenger
gd
Beginner


Joined: 05 Apr 2006
Posts: 5
Topics: 2

PostPosted: Fri Nov 30, 2007 10:33 am    Post subject: Reply with quote

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
View user's profile Send private message
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Sat Dec 01, 2007 1:32 pm    Post subject: Reply with quote

The date and time will BOTH be in FUNCTION CURRENT-DATE. See COBOL manual.
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Mon Dec 03, 2007 5:30 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
sarvan
Beginner


Joined: 06 Aug 2007
Posts: 15
Topics: 3
Location: India

PostPosted: Thu Dec 06, 2007 12:00 am    Post subject: Reply with quote

Thanks a lot friends...
_________________
Thanks,

Sarvan.M
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group