On 09/20/2013 08:13 AM, Elardus Engelbrecht wrote:
> Ron Thomas wrote:
> 
>> Hello. We have cobol programs where we are seeing lots of unused variables. 
>> Is there a way we get  all the unused variables from the program?
> 
> Beside eating up valuable storage during execution, is this a problem?
> 
> You need to use Two Tools: XREF(FULL) and your eyes.
> 
> But, be careful. Some of those vars could be referred by a higher up program 
> or called program only, not by the program(s) you're now evaluating.
> 
> Groete / Greetings
> Elardus Engelbrecht
> 

It is a common and good practice to use Copy Books to define identical
record layouts for record structures that are accessed by multiple
programs, even if some of the programs only need to access a single
field in the record or just reference the whole record as a group item.
 You wouldn't want to dicker with a copybook definition because that may
be the authoritative definition for the record structure.

Even if Copy books have not been used, it is possible that someone
unfamiliar with their usage has simulated that usage by cut-and-paste to
be certain that record layouts are consistent from program to program
and any "cleanup" that would make definitions unique to each program
might introduce errors and would also greatly complicate correct
propagation of any future changes in record structure.

Extra variables won't affect efficiency or size of the executable code,
but it could mean that a program object with debugging information
present would take up more library space than without the variables.
Still, if there are documentation or cross-program-consistency reasons
for the variables, I would leave them alone.


-- 
Joel C. Ewing,    Bentonville, AR       [email protected] 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to