IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to display system current date on screen


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sasidhar.choragudi
Currently Banned

New User


Joined: 26 Jun 2006
Posts: 3
Location: Hyderabad

PostPosted: Tue Feb 27, 2007 10:36 pm
Reply with quote

want to get system date?

in working-storage section i wrote like this
77 ws-date pic x(12)

and i wrote a statement in procedure division for that
display ws-date from date

then i am getting 990227. but the year is not showing correctly . for this how to write a programme please

sasi
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Feb 27, 2007 11:21 pm
Reply with quote

Did you put the system date in ws-date?
Back to top
View user's profile Send private message
sachin_star3
Warnings : 1

New User


Joined: 30 Sep 2006
Posts: 78
Location: pune

PostPosted: Wed Feb 28, 2007 3:35 pm
Reply with quote

ID-DIVISION.
PROGRAME-ID. XXX.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 WS-DATE PIC X(12).
PROCEDURE DIVISION.
ACCEPT WS-DATE FROM DATE
DISPLAY WS-DATE
STOP-RUN.
========================
THIS YOU GET RESULT
FROM- SACHIN BORASE
IBM PUNE
Back to top
View user's profile Send private message
sasidhar.choragudi
Currently Banned

New User


Joined: 26 Jun 2006
Posts: 3
Location: Hyderabad

PostPosted: Wed Feb 28, 2007 6:49 pm
Reply with quote

OK THANK YOU BOSS, BUT I AM GETTING THAT DATE

AS FOLLOWS 99 02 28 THAT IS YY MM DD. THAT TOO NOT 2007 BELOW 2000 ONLY IT IS SHOWING. HOW TO SOLVE THIS PROBLEM WITH SIMPLE CODE
Back to top
View user's profile Send private message
sasidhar.choragudi
Currently Banned

New User


Joined: 26 Jun 2006
Posts: 3
Location: Hyderabad

PostPosted: Wed Feb 28, 2007 6:56 pm
Reply with quote

WHEN I WROTE THAT PROGRAME LIKE THIS
D-DIVISION.
PROGRAME-ID. TTT.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 WS-DATE PIC X(12).
PROCEDURE DIVISION.
ACCEPT WS-DATE FROM DATE
DISPLAY WS-DATE
STOP-RUN.


I AM GETTING DATE AS FOLLOWS 990228 WHICH REPRESENTS YYMMDD. THAT TOO YEAR IS NOT CORRECT. IT IS SHOWING BELOW 2K. NOT AFTER 2K. HOW TO SOLVE
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Wed Feb 28, 2007 7:55 pm
Reply with quote

Which version of cobol are you using?
I am using IBM ENTERPRISE COBOL FOR Z/OS AND OS/390 3.2.0.
It is not giving any problem. icon_smile.gif
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Feb 28, 2007 9:30 pm
Reply with quote

sasidhar.choragudi wrote:
AS FOLLOWS 99 02 28 THAT IS YY MM DD. THAT TOO NOT 2007 BELOW 2000 ONLY IT IS SHOWING. HOW TO SOLVE THIS PROBLEM WITH SIMPLE CODE
Stop with the all CAPS!
is there a time/date program forcing the year to 99 tor testing purposes?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Sysplex System won't IPL at DR site I... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts Need to convert date format DFSORT/ICETOOL 20
Search our Forums:

Back to Top