Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to identify Unused working storage variables

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
sand
Warnings : 1

New User


Joined: 20 Nov 2005
Posts: 19

PostPosted: Tue Jan 30, 2007 2:46 pm    Post subject: How to identify Unused working storage variables
Reply with quote

How efficiently (not by manually searching in actual code of a Cobol program) we can identify unused variables in the program which are defined in working storage section and not used anywhere in the procedure division? These variables are not part of any copybook.

Thanks,
Sand
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Jan 30, 2007 2:54 pm    Post subject:
Reply with quote

The compiler (used to?) creates a listing of all data names and which line of the procedure division that they were referenced. I have used that list, comparing the unused data names against the actual data division listing to identify unused data names. Watch out for redefined names.....
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Tue Jan 30, 2007 3:16 pm    Post subject:
Reply with quote

William Thompson wrote:
The compiler (used to?) creates a listing of all data names and which line of the procedure division that they were referenced.


You can flag XREF option to indicate the compiler to create a listing...
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Wed Jan 31, 2007 7:37 am    Post subject:
Reply with quote

Be careful. Consider the following:

01 grp-var.
05 el-var1 pic....
05 el-var2 pic....

el-var1 is never used. Do you take it out?

If you're doing it for 1 or 2 pgms, no big deal. A couple of hundred or thousand - tough job.
Back to top
View user's profile Send private message
Jude_Moss

New User


Joined: 07 Feb 2006
Posts: 1

PostPosted: Wed Jan 31, 2007 11:34 am    Post subject:
Reply with quote

In my previous project , we used SmartDoc ( ASG Tools) which produces a report in .HTML format. which tells us
1.Dead code (working storage variable/code)
2.Cyclomatic complexity of the program etc.


Regards,
Jude
Back to top
View user's profile Send private message
Santoshdorge

New User


Joined: 27 Jun 2006
Posts: 48
Location: Pune

PostPosted: Wed Jan 31, 2007 1:50 pm    Post subject:
Reply with quote

I have one way to do it manually.It's not a efficient way to do it but
would work for you.Use find all commad for group level in descending order(eg first for 01 then 02 so on ) and accordingly remove the ws section entry if any item is not used by group name or individualy.
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Wed Jan 31, 2007 4:44 pm    Post subject:
Reply with quote

Jude_Moss wrote:
In my previous project , we used SmartDoc ( ASG Tools) which produces a report in .HTML format. which tells us
1.Dead code (working storage variable/code)
2.Cyclomatic complexity of the program etc.


Regards,
Jude


or you can browse it in host as the VIASDRPT is the input to the html conversion step.
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need to identify top 10 costly or tim... ashek15 DB2 4 Wed Feb 14, 2018 3:20 am
No new posts Using indexed variables in EZPLUS SRIDEVI TANTRY CA Products 1 Thu Feb 01, 2018 12:15 pm
No new posts INSUFFICIENT VIRTUAL STORAGE!! Vignesh Sid SYNCSORT 1 Thu Dec 28, 2017 3:45 pm
No new posts COMP Variables Mismatch gayu7 COBOL Programming 5 Wed Dec 20, 2017 5:06 pm
No new posts REXX LISTDSI () SMSINFO is not working upendrasri CLIST & REXX 4 Fri Nov 17, 2017 11:33 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us