Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Truncated System Date

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 172
Location: India

PostPosted: Wed Mar 26, 2008 10:11 am    Post subject: Truncated System Date
Reply with quote

Hi All,

I am using the piece of Code

Code:
ACCEPT WS-DATE FROM DATE.

I have declared the WS-DATE variable as CCYYMMDD. But the date provided by the system is YYMMDD.

Can we get the year as CCYY by any means?
Back to top
View user's profile Send private message
References
ksk

Senior Member


Joined: 08 Jun 2006
Posts: 315
Location: Pune, India

PostPosted: Wed Mar 26, 2008 10:28 am    Post subject:
Reply with quote

One way is to move some variable e.g., "20" in CC field of WS-DATE for 21st Century.
Back to top
View user's profile Send private message
Devzee

Senior Member


Joined: 20 Jan 2007
Posts: 708
Location: Hollywood

PostPosted: Wed Mar 26, 2008 11:05 am    Post subject:
Reply with quote

Use FUNCTION CURRENT-DATE?
Back to top
View user's profile Send private message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 172
Location: India

PostPosted: Wed Mar 26, 2008 11:24 am    Post subject:
Reply with quote

Shall i use the code as:

Code:
ACCEPT WS-DATE FROM CURRENT-DATE.


for using the FUNCTION CURRENT-DATE?
Back to top
View user's profile Send private message
Devzee

Senior Member


Joined: 20 Jan 2007
Posts: 708
Location: Hollywood

PostPosted: Wed Mar 26, 2008 8:18 pm    Post subject:
Reply with quote

swapnadeep.ganguly
I can write one line of code for you but I dont want to do that, please refer to COBOL manual of how to use Functions.
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 497
Location: Richmond, Virginia

PostPosted: Wed Mar 26, 2008 10:45 pm    Post subject:
Reply with quote

Code:
ACCEPT ... FROM DATE


is pre-Y2K COBOL. Since zillions of programs use it, IBM could not expand the result or otherwise alter the syntax, so you can't just define your receiving field to an incompatible length.

The function mentioned is the post-Y2K solution.
Back to top
View user's profile Send private message
gvsus

New User


Joined: 27 Mar 2008
Posts: 4
Location: USA

PostPosted: Thu Mar 27, 2008 4:52 am    Post subject:
Reply with quote

Code:
ACCEPT WS-DATE FROM DATE CCYYMMDD.


I think it works in ILE Cobol only.

I have mainframe code like above in production.
Back to top
View user's profile Send private message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 172
Location: India

PostPosted: Thu Mar 27, 2008 9:20 am    Post subject:
Reply with quote

Hi all,

The piece of code that worked for me are as under:

Code:
ACCEPT WS-DATE FROM DATE YYYYMMDD.


Also, there is another piece of code that extract the current date from the system. It is as under:

Code:
SELECT CURRENT DATE
   FROM SYSIBM.SYSDUMMY1
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1