View previous topic :: View next topic
|
Author |
Message |
xenomorph
New User
Joined: 27 Jul 2007 Posts: 9 Location: Europe
|
|
|
|
Hi all,
Do you know a way to remove unused variables from a cobol source pgm automaticlly ?
Thank's in advance !
Xeno. |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
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. |
|
Back to top |
|
|
hchinnam
New User
Joined: 18 Oct 2006 Posts: 73
|
|
|
|
I doubt if there is any automated tool/method to remove unused variables.
But there is a section in compile listing, where usage of variables is displayed.
it looks as below in my shop
Code: |
PP 5655-G53 IBM Enterprise COBOL for z/OS 3.4.1 OMA TESTPGM Date 09/23/2008 Time 11:11:15 Page 4
An "M" preceding a data-name reference indicates that the data-name is modified by this reference.
Defined Cross-reference of data names References
18 LOLLOL
19 PDVAL. . . . . . . . . . . . . 20 26
21 PDVALUE. . . . . . . . . . . . M25 27
20 PDVALX
|
You can identify the unused variables using this listing and remove them. However this is not accurate when you use redefines. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
or if you delete a group item (that is not referenced) that contains an elementary item that is. |
|
Back to top |
|
|
xenomorph
New User
Joined: 27 Jul 2007 Posts: 9 Location: Europe
|
|
|
|
Thank you all for your comments.
@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.
@dbzTHEdinosauer : okay. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
Back to top |
|
|
|