Universe variable "where used" list?

12 views
Skip to first unread message

Tony G

unread,
Feb 10, 2012, 8:07:24 PM2/10/12
to mvto...@googlegroups.com
The following was posted by Troy Buss in the U2 forum. Isn't
this something that mvToolbox does?

=============

The universe compiler (-xref) option is pretty useful for
tracking down variable usage. Specifically, I'd like to
eliminate assigned but unused variables, so I'm looking for
output that has single assignments only. It looks like the raw
compiler output from -X is from an intermediate file and then
captured using retrieve. Does anyone know if the intermediate
file is available for running my own reports?

On d3 it was the BSYM file and you could write your own reports
to find what you need. I'm looking for something similar on
universe because scanning for these variable assignments from
large programs is very tedious using the current data in the
captured cross reference listing that comes out of the source.L
file.

Worst case, I guess I could write another program to scan that
record for what I need.

-Troy

===============

Eugene Perry

unread,
Feb 10, 2012, 9:00:19 PM2/10/12
to mvToolbox
Tony,

Bro can correct me if I am wrong.

LX will allow you to find all exact mactches in a program. It will
not necessarily show you only a variable that is assigned but not
used.

If that variable is only assigned it is going to show up once. It can
even search the includes and all the called subroutines and all of the
subroutines those programs call.

Eugene

CLARENCE COPE, III

unread,
Feb 10, 2012, 11:30:55 PM2/10/12
to mvto...@googlegroups.com
There are two commands that address this need directly.  The XREF and UNREF commands.  The XREF displays a list of every BSU (a university buzzword short for Basic Syntactic Unit) and every place each is referenced in a program.  The UNREF command lists out only those BSU's that are defined but not referenced.  When I say every BSU, that includes all variables, files, and labels.  Each BSU is identified as to what it is, whether a variable, a file, or a label.
 
As in all mvToolbox commands, these two commands are fully integrated.  By that I mean all functionality is available from any prompt.  In the case of the UNREF display, putting the cursor on a line or clicking on any line takes you to that line in the program.

For searching includes and called programs for additional references to a BSU, the LX or LU commands with the -I switch (for includes), -C switch (for called subroutines), or -D switch (for both calls and includes) can be used.
 
One nice feature of the LX command is that when searching subbroutine calls, it is a smart search.  Say you are looking for all exact matches for a string in a root progam and all called subroutines.  LX CUSTOMER.FILE -C  If the search identifies the search string occurring in a subroutine calling sequence, it switches to searching for the new value when that subroutine is searched.
 
Example:
 
LX (locate all exact matches)::  LX CUSTOMER.FILE -C
 
...
 
CALL POSTING.SUBROUTINE(CUSTOMER.FILE,ORDER.INFORMATION, 'P')
 
...
 
SUBROUTINE POSTING.SUBROUTINE(CM.FILE, OINFO, POST.FLAG)
 
While looking for CUSTOMER.FILE in the root program, when the POSTING.SUBROUTINE is searched, the search switches to look for its local name - CM.FILE.
 
The display will contain all exact matches to the desired string and any other variable names that the search string is mapped to.
 
Bro


From: Eugene Perry <eppi...@yahoo.com>
To: mvToolbox <mvto...@googlegroups.com>
Sent: Fri, February 10, 2012 9:00:19 PM
Subject: Re: Universe variable "where used" list?
Reply all
Reply to author
Forward
0 new messages