by BillyBoyo » Fri May 06, 2011 10:36 pm
Prino is certainly correct, there is no difference in the copybook itself that would prevent you using it anywhere in the Data Division if all it contains is Cobol level numbers defining data.
Ronald expands, noting that they are differences between working-storage and linkage data, rather than being in a copybook.
If you have a copybook, I found it handy not to include the 01-level in it. This gives you more flexibility in using the copybook. Avoid values, except for 88's, unless the data is "static".
01-levels in the linkage section have to have an address aisgned to them before you can access the data. Most commonly, this is done by the USING on the PROCEDURE DIVISION. You can, these days, use methods like pointers to give addresses to tables in the LINKAGE SECTION. Any reference to something in LINKAGE that does not have an address asigned to it will give you S0C4 (there are many other ways of getting S0C4 as well). In LINKAGE, your copybook/definition is a "map" which can be assigned to start at a particular address. In WORKING-STORAGE, the copybook/definition is not only a map, but also causes storage to be set aside right there is your program which matches the map.