You can find the unused variables from the compiler listing and think about removing those from the cobol program but I have a feeling that this may not solve your purpose. Tell us what is exact business requirement, then we may be able to offer better solution.
@agkshirsagar : it's not a request from the business but more a code tuning.
It appears that one of our shared copybook that was supposed to be stable
is not and the dev. team decided to remove it from all sources in order to
facilitate the application management.
@hchinnam : it involves a lot of sources but that's a way.