View previous topic :: View next topic
|
Author |
Message |
Suja.Sai
New User
Joined: 26 Sep 2008 Posts: 12 Location: Bangalore
|
|
|
|
Hi,
We have the below requirement.
The input request container has the count of number of records passed in the input request array container. For each input record fetched, we have to query the table and if the record is found in the table, then we have to put it in the response array container.
The response array container is declared as an unbounded dynamic array.
We do not have the count of the output records until we process the final input record. For each input record, there may/maynot be an output record.
Please suggest if the below approach is ok to populate the dynamic response array container?
Do the below processing for each record fetched from the table...
1) Calculate the dynamic response array length for the fetched record
2) GetMain
3) Populate the response array container
4) Put the response array container
5) FreeMain
I doubt if it is a good practice to use getmain and freemain frequently in a loop. Please let me know if there are other better ways to achieve this.
Please help.
Thanks,
Suja |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
|
|
How if you build the output of all into cobol array and from there then into the response array containers? |
|
Back to top |
|
|
Suja.Sai
New User
Joined: 26 Sep 2008 Posts: 12 Location: Bangalore
|
|
|
|
Is there any other way to do this other than using a cobol internal array? |
|
Back to top |
|
|
|