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

Cobol- DB2 Array


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Prasanthhere

Active User


Joined: 03 Aug 2005
Posts: 306

PostPosted: Thu Jul 17, 2008 5:40 pm
Reply with quote

I have a condition like this

I am using a query to pass values to an array. The array is occuring 10 times. The query may return 100 records . The array varibales are all inside a
copybook so i cannot change the copy book value

Is there any way we can pass the first 10 values to array first then the next 10 values and so on...
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Thu Jul 17, 2008 6:50 pm
Reply with quote

Prasanth,

First of all you must be aware of the fact that after populating the array with first 10 values if you do it again then initial 10 values will be overridden by the new values ... so here assuming you have to do some kinda processing on the fetched values ....

fetch the first 10 values to the array .. maintain a counter ... when the count touches 10 stop fetching and process the array values ..once its done again go for the fetch ...fetch next 10 rows ... make sure your cursor does not get closed ... note that at any point of time only 10 values will be available thru your arrays ...

but if this is the case is there any problem in fetching rows one by one and then processing each record ????

im not sure abt your requirement ... [/code]
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jul 17, 2008 7:27 pm
Reply with quote

What is your SQL?
Back to top
View user's profile Send private message
Prasanthhere

Active User


Joined: 03 Aug 2005
Posts: 306

PostPosted: Fri Jul 18, 2008 12:33 pm
Reply with quote

Code done through Scrollable cursor ..

Thanks for the response
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
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
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top