Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Cobol- DB2 Array

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
Prasanthhere

Active User


Joined: 03 Aug 2005
Posts: 295

PostPosted: Thu Jul 17, 2008 5:40 pm    Post subject: Cobol- DB2 Array
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
References
ashimer

Senior Member


Joined: 13 Feb 2004
Posts: 360
Location: Bangalore

PostPosted: Thu Jul 17, 2008 6:50 pm    Post subject:
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

Senior Member


Joined: 20 Oct 2006
Posts: 1641
Location: germany

PostPosted: Thu Jul 17, 2008 7:27 pm    Post subject:
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: 295

PostPosted: Fri Jul 18, 2008 12:33 pm    Post subject: Reply to: Cobol- DB2 Array
Reply with quote

Code done through Scrollable cursor ..

Thanks for the response
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1