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: 1722
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: 7931
Location: Bellevue, IA

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: 1224
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 TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


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