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
 

 

Cobol-DB2 program

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

New User


Joined: 08 Dec 2011
Posts: 10
Location: India

PostPosted: Fri Oct 18, 2013 7:58 pm    Post subject: Cobol-DB2 program
Reply with quote

Hi,
I am facing an issue in my cobol-Db2 program.
The scenario is like-
1. I have a table T1 in which columns are C1 and C2.
C1 column contains data like 'AB1AB2AB3AB4.....'
2. T2 table contains columns as C3 and C4
C3 column have value like 'AB1','AB2',.....

Now I want a cursor which will give me a values like-
'AB1','AB2','AB3','AB4'.......

I am confused how to get the values from first table,becuase Union will give me the proper data once i get data as 'AB1,AB2 from table C1

Substr function,Array in cobol is coming in my mind.but not getting how to proceed.
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 Oct 18, 2013 9:00 pm    Post subject:
Reply with quote

Hello,

It is not clear what you are trying to accomplish. Keep in mind that what you want to do is completely clear to you, but might not be so clear to people reading your topic.

Is there some relationship between table T1 and table T2. What do you want the cursor to do for this process?
Back to top
View user's profile Send private message
Dibyendu Mandal

New User


Joined: 08 Dec 2011
Posts: 10
Location: India

PostPosted: Sun Oct 20, 2013 5:44 pm    Post subject: Reply to: Cobol-DB2 program
Reply with quote

Hi Dick,
There is no relation between table T1 and T2 tables.
Only one relation I can see is-
1. Column C1 of table T1 is the concatenation of column C3 of table T2.
Like C1 contains value 'AB1AB2AB3AB4.....'
Column C3 contains value like 'AB1','AB2'......
So my cursor should return value like 'AB1','AB2','AB3','AB4'.....

Cursor I am using as I have to send the result set to front end through Stored Procedure.

Hope I am a little bit clear now
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: Sun Oct 20, 2013 9:20 pm    Post subject:
Reply with quote

Hello,

No, not so clear . . .

If all you want is the AB1, ab2, etc why is the first table even used?

Why not read only table 1 and break out the "pieces"?

If there is no relationship between the tables why use both?

Maybe if you use more realistic data values, this would be more clear.
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
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm


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