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
 

 

how to execute join query in cobol programming

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sahanawaj

New User


Joined: 04 Dec 2007
Posts: 2
Location: Mumbai

PostPosted: Fri Dec 07, 2007 12:43 pm    Post subject: how to execute join query in cobol programming
Reply with quote

Hi
i have written a cobol programming which is given below

EXEC SQL
SELECT C_INT_ISIN
,C_ITD_NINTRPDT
,C_ITD_RDDT
,C_INT_INSSTTS
,C_ITD_SHUTIND
,C_INT_INSTYPID
INTO :C-INT-ISIN
,:C-ITD-NINTRPDT
,:C-ITD-RDDT
,:C-INT-INSSTTS
,:C-ITD-SHUTIND
,:C-INT-INSTYPID
FROM CS_INSTRU_T , CS_INSTRUDETLS_T
WHERE .C_INT_INSTRUID = C_ITD_INSTRUID
AND C_INT_INSTRUID = :WS-ACP-INSTRUID
END-EXEC.


But during executing that program,it is giving sqlcode =00030N

Please can any body help me whats wrong with this query


Hi! This is your First post in our Forums! So please be sure to 1) Use meaningful and descriptive Topic Title 2) Try to post your query in the relevant forum category 3) Make sure your query is not already posted and solved in our forums, Use the Search facility and avoid Reposts! If you are following the above rules, delete this message and post your query here!
Back to top
View user's profile Send private message

ulfnsc

New User


Joined: 15 Jan 2004
Posts: 19
Location: Stockholm, SWEDEN

PostPosted: Fri Dec 07, 2007 4:52 pm    Post subject:
Reply with quote

Hi sahanawaj
-305....
Check your return code, it will tell you what output host variable
need to have a indicator variable.
Back to top
View user's profile Send private message
rpuhlman

New User


Joined: 11 Jun 2007
Posts: 80
Location: Columbus, Ohio

PostPosted: Fri Dec 07, 2007 5:09 pm    Post subject:
Reply with quote

Move SQLCODE to a working storage field, such as
Code:
01  WS-SQLCODE  PIC  -----9.
and then display WS-SQLCODE. Reply back here with the edited SQLCODE or look it up in the manual.
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: Fri Dec 07, 2007 9:46 pm    Post subject:
Reply with quote

Hello,

If there could be more than 1 "details" row per INSTRU row, you will need to use a CURSOR.
Back to top
View user's profile Send private message
sahanawaj

New User


Joined: 04 Dec 2007
Posts: 2
Location: Mumbai

PostPosted: Tue Dec 11, 2007 1:34 pm    Post subject:
Reply with quote

dick scherrer wrote:
Hello,

If there could be more than 1 "details" row per INSTRU row, you will need to use a CURSOR.


but INSTRUID is the primary key of that two tables
Back to top
View user's profile Send private message
dr_te_z

New User


Joined: 08 Jun 2007
Posts: 71
Location: Zoetermeer, the Netherlands

PostPosted: Tue Dec 11, 2007 4:37 pm    Post subject:
Reply with quote

Are there any columns with NULLS allowed?
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Need DB2 query to fetch previous row ! Chandan1993 DB2 10 Sat Jun 03, 2017 10:43 am


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