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
 

 

Identify variables used in the program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: Identify variables used in the program
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Nov 16, 2011 1:25 pm    Post subject: Reply to: Identify variables used in the program
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    Post subject: Reply to: Identify variables used in the program
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Nov 16, 2011 1:36 pm    Post subject: Reply to: Identify variables used in the program
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
http://www-03.ibm.com/systems/z/os/zos/bkserv/zappls2.html
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Wed Nov 16, 2011 2:03 pm    Post subject: Reply to: Identify variables used in the program
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Nov 16, 2011 2:48 pm    Post subject: Reply to: Identify variables used in the program
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    Post subject: Reply to: Identify variables used in the program
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

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Nov 16, 2011 3:51 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Wed Nov 16, 2011 3:52 pm    Post subject: Reply to: Identify variables used in the program
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Nov 16, 2011 4:03 pm    Post subject: Reply to: Identify variables used in the program
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts A sample of exit program for exit XMN... lind sh CICS 2 Mon Oct 03, 2016 5:07 pm
No new posts Need points to tune IMS Checkpoint Pr... satish.ms10 IMS DB/DC 2 Fri Sep 30, 2016 4:12 pm


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