Page 1 of 1

Declare same Cursor more than once in a program?

Posted: Tue Jun 03, 2014 5:16 pm
by Abhishek Dimri
Hi,

In a COBOL program, I have to fecth data from more than one table.The tables, we need to refer, are cahnged dynamically based upon a column value m say COL1. We have different tables defined for each COL1. Using some mechanism, we'd calculate the value for COL1 in theprogram and based on that, we need to call one or many tables.

To do that, do you think, is it possible to declare the same cursor multiple times, each time for differet value of COl1 to refer to that tabless?

Re: Declare same Cursor more than once in a program?

Posted: Tue Jun 03, 2014 5:40 pm
by zprogrammer
Based on COL1 , You could have different cursor

Re: Declare same Cursor more than once in a program?

Posted: Wed Jun 04, 2014 4:31 pm
by Abhishek Dimri
Thanks but that does not seem to answer the question I've asked and the question is "is it possible to declare the same cursor multiple times"?

Re: Declare same Cursor more than once in a program?

Posted: Wed Jun 04, 2014 4:48 pm
by nicc
"same cursor" - why waste time coding it more than once? And you would probably choke the pre-processor but if you didn't then when duplicates appear it is usually, but not always, the last occurrence that is taken.

Why not just code up a dummy program that exhibits the characteristics you want and try compiling it?