Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us