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

Getting the PARA name using rexx


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vidyaa

New User


Joined: 02 May 2008
Posts: 77
Location: chennai

PostPosted: Tue Aug 12, 2014 2:24 pm
Reply with quote

CODE.........
SET GET-UNIQUE-ROW TO TRUE
PERFORM 9200-PR-MAST

CODE.............
SET PUT-MODIFY-ROW TO TRUE
PERFORM 9200-PR-MAST


9200-PR-MAST.
SET BATCH-ENV TO TRUE
CALL WS-Z28S0530 USING
WALT
AB12

From the above code my input to rexx will be the tbl name Z28S0530. Using this tbl name i need to find out if the table
is been used in the READ mode or MOdify mode or few other modes too. I will know its READ mode by using the KEY
GET-UNIQUE-ROW and modify by using PUT-MODIFY-ROW. For that i need to know the para name that table is called and then see from where
all these paras are called and get the flag GET-UNIQUE-ROW and PUT-MODIFY-ROW and send the report saying

Z28S0530 table was used for UPDATE & READ

how can we achieve this is rexx or this doable
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Tue Aug 12, 2014 3:13 pm
Reply with quote

What have you tried so far with your REXX code ?

Of course you may consider using SUPERC rather than reinventing the wheel
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: Tue Aug 12, 2014 3:54 pm
Reply with quote

Use the compile listing, ensure you have cross-reference and verb listing and data map. Print it. Look at the listing. Work out how to do it now that the compiler has prepared all the information for you. The answers may not be definitive anyway, depending on the source code.
Back to top
View user's profile Send private message
vidyaa

New User


Joined: 02 May 2008
Posts: 77
Location: chennai

PostPosted: Tue Aug 12, 2014 5:10 pm
Reply with quote

But seaching it manually will take more time and also they wanted the tool so they can reverify how many ever times they wanted..

I started my rexx to read the input file that has the pgm name and go to the PDS that contains all the pgm and pick that particual member that was in the input file and read all the lines into a stem variable.

Now am stuck to know how to
1. find the table name inside the pgm and get the line that also has the call stmt before it
2. Get the para name that is in
3. Find all the places that para is called and find the "SET" keyword bofore it
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: Tue Aug 12, 2014 5:16 pm
Reply with quote

I wasn't suggesting you do everything manually. I was suggesting you use the listing, and run your rexx on that.

However, if you want to do lots of work, carry on as you are. After all, it is, what, every 15 seconds that such things change so you need to know, isn't it? Er, no, not really, but if you're sure things are changing often enough for you to do part of the work of the compiler, then just carry on as you are.

Actually, if you search here, you'll find stuff. The tighter your local standards are, the more likely you are to get results.
Back to top
View user's profile Send private message
vidyaa

New User


Joined: 02 May 2008
Posts: 77
Location: chennai

PostPosted: Tue Aug 12, 2014 5:25 pm
Reply with quote

Also the SUPERc serach and compile list will just give the variables if present in the pgm or not and will expand the entire pgm to view. This is again involving manual work to serach in each pgm. Please correct me if am wrong
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Aug 12, 2014 6:16 pm
Reply with quote

You can also read the program sequentially, when you find a relevant SET command, keep it with the following perform name, so you have a table that looks like:
Code:
GET-UNIQUE-ROW / 9200-PR-MAST
PUT-MODIFY-ROW / 9200-PR-MAST

Once you reach a relevant paragraph (stored in the table), get the table name from the CALL command. 2nd table looks like:
Code:
9200-PR-MAST / Z28S0530

In your program, use the PARSE command to split the cobol line by columns.
Loop once to ignore all lines until you reach the PROCEDURE DIVISION.
Start a new loop from this point to the end of the file.
Ignore all commented lines
If the line is a SET, check if it relevant (GET / PUT...)
If it is a relevant SET, start to look for PERFORM.
If the line is a PERFORM and you're looking for PERFORMs, save it with the previous SET variable.
If the line is a paragraph name (starts in area A), check if it is relevant
If it is relevant, start looking for CALL.
If the line is a CALL and you're looking for CALLs, get the table name.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Wed Aug 13, 2014 12:10 am
Reply with quote

I might be going off on a tangent here, but if the tables you are referring to are DB2 tables, you can use the DB2 catalog table SYSTABAUTH to determine which tables the program has access to, and the type of access. (Insert, Delete, Update or Select).

It won't of course tell you which paragraph does the updating.
Back to top
View user's profile Send private message
vidyaa

New User


Joined: 02 May 2008
Posts: 77
Location: chennai

PostPosted: Wed Aug 13, 2014 3:02 pm
Reply with quote

I would have used SYSTABAUTH if they have used the DB2 table names inside the pgm. But here they have not used the table names or queries directly instead they have a subroutine which will have all the queries and the main pgm will call the subroutine each time to update/delete entries.
that is the problem here
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Run rexx with JCL Job CLIST & REXX 3
No new posts Run rexx in batch job CLIST & REXX 7
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
No new posts REXX/CMS How to place command console... CLIST & REXX 4
Search our Forums:

Back to Top