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

Cobol-DB2 program


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Oct 18, 2013 9:00 pm
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
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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Oct 20, 2013 9:20 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top