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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm


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