Focal Point
[CLOSED] Quickly Find TABLENAME for Medata/Synonym

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9547096076

May 14, 2014, 03:14 PM
ChadSS
[CLOSED] Quickly Find TABLENAME for Medata/Synonym
I am looking for a way to quickly look through 1500+ synonym files to locate any reference to a specific table name (TABLENAME). Is there a WebFOCUS system table that stores this type of information?

Reason: When creating metadata/synonym on our mainframe we are limited to an 8-character length. Any DB2 table names longer than 8-characters have to be shortened. Unfortunately, in the past we did not have a naming convention so it was user’s choice.

This message has been edited. Last edited by: ChadSS,
May 14, 2014, 03:55 PM
susannah
ona mainframe, i don't know.
If you were on windows, you can use TEXTPAD, which is a free/cheap text editor and rocks.
the feature under the Search option is 'Find in files' which lets you search all files, by filetype or not, with or w/o wildcards in names, and subdirectories or not.
its companion, WILDEDIT, lets you change strings in a bunch of files at once. for a geek, that's about as uber-dangerous as it gets.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
May 14, 2014, 04:02 PM
Francis Mariani
You might be able to write a fex for this.

There is a WebFOCUS system table called SYSTABLE that has some columns that describe all the masters in the app folders. The columns you're interested in are NAME (master names) and REALNAME (db table name). This, unfortunately, does not tell you which app folder the master is located in.

TABLE FILE SYSTABLE
PRINT
SEG.NAME

WHERE READLIMIT EQ 100
WHERE NAME LIKE 'mytables_%'
END



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
May 14, 2014, 04:14 PM
ChadSS
Thanks Francis, I'm glad to see you reply to the question. I borrow from your code examples all the time...

I'll give it a try and get back to everyone.
May 14, 2014, 04:24 PM
ChadSS
Worked perfectly. Thanks Francis!
May 14, 2014, 04:31 PM
Francis Mariani
here's a fex that uses two system tables to determine the master name, db name, app name:

-SET &ECHO=ALL;

SET ASNAMES=ON
SET HOLDFORMAT=ALPHA
SET HOLDLIST=PRINTONLY
SET ALL=ON
-RUN

TABLE FILE SYSTABLE
PRINT *
BY NAME
ON TABLE HOLD AS HSYSTABLE
END
-RUN

DEFINE FILE SYSFILES
APPNAME/A20 = GETTOK(PHNAME, 80, 1, '/', 20, 'A20');
END

TABLE FILE SYSFILES
PRINT
APPNAME
*
BY FILENAME
ON TABLE HOLD AS HSYSFILES
END
-RUN

JOIN NAME IN HSYSTABLE TO ALL FILENAME IN HSYSFILES AS J1
-RUN

TABLE FILE HSYSTABLE
PRINT
NAME
FILENAME
APPNAME
REALNAME

SEG.NAME
SEG.FILENAME
END

This message has been edited. Last edited by: Francis Mariani,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
May 14, 2014, 05:37 PM
Waz
Also remember that SYSTABLE only works on the current APP PATH, so if you have other folders not in the path, you may have to add them with an APP APPENDPATH/PREPENDPATH
May 15, 2014, 07:35 AM
dhagen
Run this procedure from the DMC:

EX IMPCTSYN SEND_TO=WCF, SYN_NAME=ggorder

Or you can just use the Impact Analysis from the DMC <== way easier!


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott