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

Coverting Current date to integer of date


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sreeharithag

New User


Joined: 26 Apr 2010
Posts: 9
Location: chennai

PostPosted: Tue Mar 22, 2011 11:24 am
Reply with quote

Hi,
I need to convert the current date to integer of date.
But i am facing the below error

Function argument "WS-CURR-DATE" did not have the correct type for function "INTEGER-OF-DATE". The statement was discarded.
Below is the declaration of variables in working storage
01 WS-CURR-DATE PIC X(08).
01 WS-CURR-DATE-INTGER PIC S9(09) COMP.
.
.
.
.
COMPUTE WS-CURR-DATE-INTGER = FUNCTION INTEGER-OF-DATE (WS-CURR-DATE)

Please let me know how to rectify this....
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Mar 22, 2011 11:33 am
Reply with quote

Read the manual to see what the data format of the variables are that the function is expecting and also check that the data within the variables is in the correct format.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Tue Mar 22, 2011 4:11 pm
Reply with quote

Hint: if you are going to convert a date variable to an integer, would it not be a nice thing if the date variable WAS NUMERIC before the conversion occurred?
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Mar 22, 2011 9:34 pm
Reply with quote

1. Learn about INTEGER-OF-DATE.
2. Try different options by yourself !
Back to top
View user's profile Send private message
sreeharithag

New User


Joined: 26 Apr 2010
Posts: 9
Location: chennai

PostPosted: Wed Mar 23, 2011 11:35 am
Reply with quote

Thanks guys.It got resolved.I have changed the alphanumeric date to numeric before converting it into INTEGER-OF-DATE.
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 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
No new posts Changeman - how can we know the curr... Compuware & Other Tools 2
Search our Forums:

Back to Top