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
 

 

Regarding COBOL Stored Procedure option - GENERAL WITH NULLS

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

New User


Joined: 09 Aug 2010
Posts: 16
Location: Coimbatore

PostPosted: Fri Nov 04, 2016 8:57 pm    Post subject: Regarding COBOL Stored Procedure option - GENERAL WITH NULLS
Reply with quote

Hi all,

I have coded a COBOL Stored procedure (DB2) program, for which I am facing 2 issues. I have went through the ibm knowledge center and did exactly the same.

1.Didn't coded Null variable as Out parameter in CREATE PROCEDURE (SP definition). All other IN and OUT parameters coded. Initially setting all the Null fields to true. Based on query result, I am setting Null variables to 0 and moving corresponding values to Out variables in COBOL SP. After running SP using IBM Rational tool, I am only able to see Null values in OUT parameters.

Link : http://www.ibm.com/support/knowledgecenter/SSEPEK_11.0.0/apsg/src/tpc/db2z_xmpcobolstoredproceduregeneralwithnulls.html

2. In that SP, I am selecting columns of more than 2 tables with Alias for identifcation. On Compiling, I am getting DSNH2061 W "STATEMENT REFERENCES COLUMN "A"."COLUMN_NAME" WHICH IS NOT DECLARED IN THE SPECIFIC TABLES. But the bind is successful.
While running in IBM Rational tool, Result sets are coming without column names of table. How to remove Alias and connect more than 2 tables.
Back to top
View user's profile Send private message

Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1674
Location: NY,USA

PostPosted: Fri Nov 04, 2016 10:02 pm    Post subject:
Reply with quote

Quote:
Result sets are coming without column names of table.
That is how it will be, why do you need column name here?
Quote:
How to remove Alias and connect more than 2 tables.
why remove for the same column appearing in both or multiple tables, you will get err?
Back to top
View user's profile Send private message
selvamsrinivasan85

New User


Joined: 09 Aug 2010
Posts: 16
Location: Coimbatore

PostPosted: Fri Nov 04, 2016 10:35 pm    Post subject:
Reply with quote

Hi Rohit,

I am not facing any issue incase of native SP. I used to get column names in Result set.

I hope removing Alias will resolve this issue 2.

Want alias on where clause like below. Suggestions please.

Select Col1_tb1, Col2_tb1, Col1_tb2, Col2_tb2 from Table1 A, Table2 B where A.id = B.id;

Any suggestions on issue 1 will be grateful.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1674
Location: NY,USA

PostPosted: Fri Nov 04, 2016 10:41 pm    Post subject:
Reply with quote

Is that what you lookingg for?
Code:
Select Col1_tb1 as col1,
Col2_tb1 as col2,
Col1_tb2 as col3,
Col2_tb2 as col4
from Table1 A, Table2 B
where A.id = B.id;
Back to top
View user's profile Send private message
selvamsrinivasan85

New User


Joined: 09 Aug 2010
Posts: 16
Location: Coimbatore

PostPosted: Fri Nov 04, 2016 10:46 pm    Post subject:
Reply with quote

Hi Rohit,
You gave me a clue. Thanks.

I think below will work fine. Will try and let you know.

Code:
Select A.Col1_tb1 as col1,
A.Col2_tb1 as col2,
B.Col1_tb2 as col3,
C.Col2_tb2 as col4
from Table1 A, Table2 B
where A.id = B.id;


Code'd by Rohit Umarjikar
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 COBOL Programming Sandpit? jodrisco COBOL Programming 6 Wed Apr 12, 2017 3:47 am
No new posts DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm
No new posts RULES(NOEVENPACK) in cobol jackzhang75 COBOL Programming 5 Wed Mar 29, 2017 12:47 am
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm


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