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?
Declare same Cursor more than once in a program?
-
- New Member
- Posts: 7
- Joined: Mon May 26, 2014 10:58 am
-
- Global Moderator
- Posts: 588
- Joined: Wed Nov 20, 2013 11:53 am
- Location: Mars
Re: Declare same Cursor more than once in a program?
Based on COL1 , You could have different cursor
zprogrammer
-
- New Member
- Posts: 7
- Joined: Mon May 26, 2014 10:58 am
Re: Declare same Cursor more than once in a program?
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?
"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?
Why not just code up a dummy program that exhibits the characteristics you want and try compiling it?
Regards
Nic
Nic
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute