Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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 -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
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

ksk

Active User


Joined: 08 Jun 2006
Posts: 356
Location: New York

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

Active Member


Joined: 20 Jan 2007
Posts: 684
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: 203
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

Active Member


Joined: 20 Jan 2007
Posts: 684
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

Active Member


Joined: 31 Oct 2006
Posts: 962
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: 203
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Overlay the system date Danielle.Filteau SYNCSORT 4 Fri Mar 03, 2017 1:16 am
No new posts Checking Current date vickey_dw DFSORT/ICETOOL 1 Wed Feb 08, 2017 11:14 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us