View previous topic :: View next topic
|
Author |
Message |
abhishek mitra
New User
Joined: 24 Feb 2008 Posts: 48 Location: Kolkata
|
|
|
|
Hi,
I have a JCL from which I pass the date in the format DD.MM.YYYY to cobol. now i accept that in cobol and pass it to the LAST_DAY function whicle searching the last date of the month from SYSTDAT/SYSDUMMY1 table.
Query i wrote is like
Select LAST_DAY(WS-DATE)into..
It throws me error in bind. Says the token WS-DATE is invalid.
Please show me the way.
Thanks |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
change DD.MM.YYYY to DD-MM-YYYY and see |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Code: |
Select LAST_DAY(WS-DATE)into..
should be
Select LAST_DAY(DATE(:WS-DATE))into..
|
|
|
Back to top |
|
|
abhishek mitra
New User
Joined: 24 Feb 2008 Posts: 48 Location: Kolkata
|
|
|
|
ashimer wrote: |
change DD.MM.YYYY to DD-MM-YYYY and see |
Hi,
Thanks for your reply.
But i believe both are equivalent with respect to a database.
Thanks
Abhishek |
|
Back to top |
|
|
abhishek mitra
New User
Joined: 24 Feb 2008 Posts: 48 Location: Kolkata
|
|
|
|
Craq Giegerich wrote: |
Code: |
Select LAST_DAY(WS-DATE)into..
should be
Select LAST_DAY(DATE(:WS-DATE))into..
|
|
Thanks a lot for your reply.
I think this is going to work but as I am away from terminal so won't be able to tell whether it has actually resolved my problem or not.
Anyways just one more thing to ask.. If I use the same query for finding the last day of the previous month can i try like this -
Select LAST_DAY(DATE(:WS-DATE) - 1 month)into..
Regards |
|
Back to top |
|
|
|