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
 

 

Getting the PARA name using rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
vidyaa

New User


Joined: 02 May 2008
Posts: 70
Location: chennai

PostPosted: Tue Aug 12, 2014 2:24 pm    Post subject: Getting the PARA name using rexx
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: 8593
Location: Back in jolly old England

PostPosted: Tue Aug 12, 2014 3:13 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Aug 12, 2014 3:54 pm    Post subject: Reply to: Getting the PARA name using rexx
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: 70
Location: chennai

PostPosted: Tue Aug 12, 2014 5:10 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Aug 12, 2014 5:16 pm    Post subject: Reply to: Getting the PARA name using rexx
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: 70
Location: chennai

PostPosted: Tue Aug 12, 2014 5:25 pm    Post subject:
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: 1218
Location: Israel

PostPosted: Tue Aug 12, 2014 6:16 pm    Post subject:
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: 641
Location: Whitby, ON, Canada

PostPosted: Wed Aug 13, 2014 12:10 am    Post subject:
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: 70
Location: chennai

PostPosted: Wed Aug 13, 2014 3:02 pm    Post subject: Reply to: Getting the PARA name using rexx
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm


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