Posted: Mon Sep 29, 2014 12:08 pm Post subject: Set index in cobol copybook in program to 1
there is a copybook CIUAFFC1 in the program. It has a index CIUAFFC-IX-1 in this copybook with 99 occurrences. In the program there are two variables FUND-COMM-AREA and FLR-FUND-COMM-AREA having the same copybook CIUAFFC1.
SET CIUAFFC-IX-1 to 1.
I want to set the index for FUND-COMM-AREA to 1 using the above statement but when I am compiling the program it gives me the index is not uniquely defined. Also I cannot set the index to 1 using IN FUND-COMM-AREA or IN FLR-FUND-COMM-AREA.
Duplicate data-names with "qualification" (the IN or OF) is a fools game. Define the copybook so you can have different prefixes for the different usages, then you have no duplicate data-names.
We don't have "variables" in COBOL. In this case you have talking about "group items". In others you will be takling about "fields" or "individual items". Also an index does not have occurences. OCCURS on the definition defines occurences. An index is optional.
If you spend some time with the Language Reference and the Programming Guide you can clarify some of these things for yourself, which will help you to understand (and explain) things much better.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum