Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Way to remove unused variables from a program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
xenomorph

New User


Joined: 27 Jul 2007
Posts: 9
Location: Europe

PostPosted: Tue Sep 23, 2008 3:23 pm    Post subject: Way to remove unused variables from a program
Reply with quote

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
View user's profile Send private message

agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Tue Sep 23, 2008 3:37 pm    Post subject:
Reply with quote

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
View user's profile Send private message
hchinnam

New User


Joined: 18 Oct 2006
Posts: 73

PostPosted: Tue Sep 23, 2008 3:46 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Tue Sep 23, 2008 4:23 pm    Post subject:
Reply with quote

or if you delete a group item (that is not referenced) that contains an elementary item that is.
Back to top
View user's profile Send private message
xenomorph

New User


Joined: 27 Jul 2007
Posts: 9
Location: Europe

PostPosted: Tue Sep 23, 2008 11:47 pm    Post subject: Reply to: Way to remove unused variables from a program
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Sep 24, 2008 12:31 am    Post subject:
Reply with quote

Hi,

You might like to check these links..

http://www.ibmmainframes.com/viewtopic.php?t=25745&highlight=unused
http://www.ibmmainframes.com/viewtopic.php?t=23268&highlight=unused
http://www.ibmmainframes.com/viewtopic.php?t=20057&highlight=unused
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Compiling program in endeavor for tra... RALAKKAL Compuware & Other Tools 4 Mon Jun 05, 2017 8:27 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us