IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Comparing a DATE (from DB2 table) with Comp variable


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top