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
 
Comparing a DATE (from DB2 table) with Comp variable

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

New User


Joined: 11 Feb 2008
Posts: 17
Location: Chennai

PostPosted: Mon Mar 17, 2008 11:12 am    Post subject: Comparing a DATE (from DB2 table) with Comp variable
Reply with quote

Hi all,
I am new to Mainframe domain.
I am using a SQL query in which Date is compared with Comp variabe.
While binding i get SQLCODE -401.
this is my SQL query
EXEC SQL
SELECT MIN(TRSPRDC_ID)
INTO :WS-TRSPRDC-ID
FROM BPRR
WHERE BNFT_ID_CD=:WS-TEMP-BIC
AND BPRR_EFF_DT=:WS-D133050-ORIG-EFF-DATE
END-EXEC

Here data type of BPRR_EFF_DT is DATE and that of WS-D133050-ORIG-EFF-DATE is S9(7) USAGE IS COMP-3.
Back to top
View user's profile Send private message

Prajesh_v_p

Active User


Joined: 24 May 2006
Posts: 133
Location: India

PostPosted: Mon Mar 17, 2008 11:51 am    Post subject:
Reply with quote

Abi,

You should be using an X(10) variable to the date comparios in the query.

Also u might have to ensure that date field in S9(7) comp-3should be properly formatted before u move it to X(10) field.

Hope this helps..

Thanks,
Prajesh
Back to top
View user's profile Send private message
mssabirami

New User


Joined: 11 Feb 2008
Posts: 17
Location: Chennai

PostPosted: Mon Mar 24, 2008 7:45 pm    Post subject: Reply to: Comparing a DATE (from DB2 table) with Comp variab
Reply with quote

Prajesh,

Thanks...it worked out...
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 Compare yesterday's date to the one o... migusd SYNCSORT 7 Fri Sep 22, 2017 11:35 pm
No new posts Comparing 2 Files using Current time arunsoods DFSORT/ICETOOL 3 Fri Sep 22, 2017 6:00 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm

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