Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
date arithematic in db2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
Author Message
i_suman

New User


Joined: 01 Mar 2005
Posts: 19

PostPosted: Thu Oct 09, 2008 8:45 am    Post subject: date arithematic in db2
Reply with quote

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
View user's profile Send private message
References
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 8730
Location: 221 B Baker St

PostPosted: Thu Oct 09, 2008 8:57 am    Post subject:
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1001
Location: Virginia, USA

PostPosted: Thu Oct 09, 2008 5:48 pm    Post subject:
Reply with quote

What is the definition of ws-hold-month-da?
Back to top
View user's profile Send private message
i_suman

New User


Joined: 01 Mar 2005
Posts: 19

PostPosted: Thu Oct 09, 2008 5:54 pm    Post subject: ws-hold-month-da is a pic 9(2) value zeroes variable
Reply with quote

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
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 8730
Location: 221 B Baker St

PostPosted: Thu Oct 09, 2008 10:05 pm    Post subject:
Reply with quote

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. . . icon_sad.gif
Back to top
View user's profile Send private message
stodolas

Senior Member


Joined: 13 Jun 2007
Posts: 647
Location: Wisconsin

PostPosted: Sun Oct 12, 2008 7:05 pm    Post subject:
Reply with quote

It appears that the date math can't take the working storage field when executed with a cursor.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 1639
Location: germany

PostPosted: Mon Oct 13, 2008 12:30 am    Post subject:
Reply with quote

maybe var1 is the problem.
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 8730
Location: 221 B Baker St

PostPosted: Mon Oct 13, 2008 1:02 am    Post subject:
Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1