Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1932
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: 8199
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: 1250
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 Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm
No new posts Comparision with current time arunsoods DFSORT/ICETOOL 5 Thu Nov 09, 2017 10:37 am
This topic is locked: you cannot edit posts or make replies. Comparing current time with the time ... arunsoods SYNCSORT 1 Mon Oct 30, 2017 4:07 pm
This topic is locked: you cannot edit posts or make replies. Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us