IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Identify variables used in the program


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Mind

New User


Joined: 04 Nov 2010
Posts: 9
Location: bangalore

PostPosted: Wed Nov 16, 2011 1:18 pm
Reply with quote

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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Nov 16, 2011 1:25 pm
Reply with quote

isn' t the XREF provided by PL/I enough ?
Back to top
View user's profile Send private message
Mind

New User


Joined: 04 Nov 2010
Posts: 9
Location: bangalore

PostPosted: Wed Nov 16, 2011 1:29 pm
Reply with quote

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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Nov 16, 2011 1:36 pm
Reply with quote

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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Nov 16, 2011 2:03 pm
Reply with quote

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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Nov 16, 2011 2:48 pm
Reply with quote

if it a real requirement there are tools to do it...
if it is an exercise it is too difficult for a trainee icon_biggrin.gif
Back to top
View user's profile Send private message
Mind

New User


Joined: 04 Nov 2010
Posts: 9
Location: bangalore

PostPosted: Wed Nov 16, 2011 3:43 pm
Reply with quote

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

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Wed Nov 16, 2011 3:51 pm
Reply with quote

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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Nov 16, 2011 3:52 pm
Reply with quote

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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Nov 16, 2011 4:03 pm
Reply with quote

since You had to ask about the XREF meaning You certainly lack the skills for such a task
mediate please, meditate icon_cool.gif

and the INCLUDES for file structures should be left alone icon_evil.gif
they describe the record layout and the fact there are unreferenced fields/variables is normal and accepted behavior
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Wed Nov 16, 2011 10:03 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts How to identify the transaction categ... IMS DB/DC 3
Search our Forums:

Back to Top