View previous topic :: View next topic
|
Author |
Message |
vidyaa
New User
Joined: 02 May 2008 Posts: 77 Location: chennai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
vidyaa
New User
Joined: 02 May 2008 Posts: 77 Location: chennai
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
vidyaa
New User
Joined: 02 May 2008 Posts: 77 Location: chennai
|
|
|
|
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 |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
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 |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
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 |
|
|
vidyaa
New User
Joined: 02 May 2008 Posts: 77 Location: chennai
|
|
|
|
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 |
|
|
|