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
 

 

Coverting Current date to integer of date

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Coverting Current date to integer of date
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: 1823
Location: UK

PostPosted: Tue Mar 22, 2011 11:33 am    Post subject:
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: 8117
Location: East Dubuque, Illinois, USA

PostPosted: Tue Mar 22, 2011 4:11 pm    Post subject:
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: 1232
Location: Israel

PostPosted: Tue Mar 22, 2011 9:34 pm    Post subject:
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    Post subject:
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    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 How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm


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