View previous topic :: View next topic
|
Author |
Message |
i_suman
New User
Joined: 01 Mar 2005 Posts: 20
|
|
|
|
Hi
In db2 i am doing a date arithematic ,
Case 1:-
--------
select date(:ws-hold-da) - 11 months into var1 from sys1.sysdummy
The above querry is working fine,
Case 2:-
----------
select date(:ws-hold-da) - (:ws-hold-month-da) months into var1
from sys1.sysdummy
I moved number of months from the input file to ws-hold-month-da,
instead of number 11 of case 1; i am using host variable in case 2,
here i am getting problem because of host variable ;
Can some one please help me how to do this date arithematic.
Thanks,
Srikanth |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
here i am getting problem because of host variable ;
Can some one please help me how to do this date arithematic. |
Not until you post the problem. . .
Telling us "it did not work" provides nothing to work with.
Have you provided the info requested in your other topic about cobol/sql?
If would be good to work on one issue at a time rather than using a shotgun approach. . . |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
What is the definition of ws-hold-month-da? |
|
Back to top |
|
|
i_suman
New User
Joined: 01 Mar 2005 Posts: 20
|
|
|
|
ws-hold-month-da is a pic 9(2) value zeroes variable ; which is getting
populated from input file; input file will have number of months in it;
for eg:- 12 months , 22 months etc... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
When do you think you might mention the problem you are having?
Part of getting help from the forums is following the directions you are given. . . |
|
Back to top |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
|
|
|
|
It appears that the date math can't take the working storage field when executed with a cursor. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
maybe var1 is the problem. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Srikanth,
We'll try yet again. . . .
Quote: |
here i am getting problem because of host variable ; |
Quote: |
maybe var1 is the problem. |
Almost surely. . .
Quote: |
When do you think you might mention the problem you are having? |
It has only been 5 days since you were asked to post your problem. You do realize that you still have not posted what error/problem you are having. . . Are you technically unable or merely unwilling to post the actual problem you want help with? |
|
Back to top |
|
|
|