View previous topic :: View next topic
|
Author |
Message |
Mind
New User
Joined: 04 Nov 2010 Posts: 9 Location: bangalore
|
|
|
|
Hello Folks,
I have a requirement, please share your ideas and comments on it.
The objective of this requirement is to develop a pl/1 program which automates the analysis of variables and parameters used in a program. The program should identify the used variables and parameters in the given pl/1 program.
please advise on the ways to fulfill above requirement. Thanks a lot |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
isn' t the XREF provided by PL/I enough ? |
|
Back to top |
|
|
Mind
New User
Joined: 04 Nov 2010 Posts: 9 Location: bangalore
|
|
|
|
Hello Enrico,
I am a beginner in Pl/I, can you please be more specific on "XREF" .
I appreciate for you help. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
XREF ==> cross reference, is the part of the compilation listing which tells where the variables are used
the manuals will tell You all about it
start here to look at the manuals for the pl/i version You are using
www-03.ibm.com/systems/z/os/zos/bkserv/zappls2.html |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Is it a "real" requirement, or an exercise to get you into PL/I?
Even if you have some orther purpose with the data, the XREF will still be your best starting point, and saves you having to do all the work the compiler has done/will do with the text. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
if it a real requirement there are tools to do it...
if it is an exercise it is too difficult for a trainee |
|
Back to top |
|
|
Mind
New User
Joined: 04 Nov 2010 Posts: 9 Location: bangalore
|
|
|
|
Enrico,
It is a real requirement for an automation process,
Requirement is to develop a pl/1 program to identify a program’s used variables and parameters for easy analysis. We are having pl/1 programs using plincls(file structures) which are common for many programs. In that program only few fields will be used for validation and of the many table parameters only few will be used in the program. So to analyze the program it will take time to identify the few variables that are used in the program by checking the large plincl structure and many table parameters .So this pl/1 program should reduce user effort for identifying those used variables(fields) and parameters |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
There are many change management products which include this type of functionality. This type of analysis is way beyond 'beginner' level.
IBM Rational Asset analyzer is one such product and a look at the product (trial download) would give an idea of the complexity involved.
Garry. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Have you looked at an XREF yet? Check in your manual, there may be options available for it.
What, of your requirement, would using the XREF not cover? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
since You had to ask about the XREF meaning You certainly lack the skills for such a task
mediate please, meditate
and the INCLUDES for file structures should be left alone
they describe the record layout and the fact there are unreferenced fields/variables is normal and accepted behavior |
|
Back to top |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
Brute force it!
-Copy each program that needs to be analyzed into a temporary PDS.
-Change each one to comment out the plincl statements you are checking.
-Run compiles on each program and place the listing into ANOTHER PDS.
-Find the "FIELD NOT DEFINED" error messages in the listing PDS.
Of course this is satire. But you may need to recompile the programs anyway to get that XREF, so some sort of set up like this may work for you.
The more I think about it, the better this approach sounds. You could even save a step by building a copybook library that contains everything BUT the plincs you are studying. Then change you compile to only look at that library for them. That way, you wouldn't have to comment out the plincl in the code.
Frankly, I could probably set this up faster than I could find, install, configure and run a real tool. But in my case, we aren't already set up for it. |
|
Back to top |
|
|
|