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
 
date arithematic in db2

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

New User


Joined: 01 Mar 2005
Posts: 20

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

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

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: 1512
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: 20

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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

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

Active Member


Joined: 13 Jun 2007
Posts: 632
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

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 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 Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm

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