[SOLVED] Querying a List of All files in a Directory
Good afternoon guys:
I would like to know who I can generate a list of all fex or mas files. I will need to know when a file was created, by who and its name. Pretty straight forward. I have not found anything particularly useful on Focal Point thus far 'Controlling Web Focus Environment' alluded to in several post is a 404 page.
Any help would be appreciated. I need to know what to type so that I am returned the names of files in a all app folders.
Thanks,This message has been edited. Last edited by: FP Mod Chuck,
WebFOCUS 8 Windows, All Outputs
May 21, 2018, 01:26 PM
BabakNYC
The master files are in app directories on the server. Take a look at what's in SYSCOLUM.mas. Try something like
TABLE FILE SYSCOLUM
PRINT *
END
The fex's are in your repository which is usually an RDBMS. The information about fex's is located in a bunch of tables in the RDBMS. You'll probably have to have admin rights to query that data.
WebFOCUS 8206, Unix, Windows
May 21, 2018, 02:25 PM
Very Helpful
quote:
Originally posted by BabakNYC: The master files are in app directories on the server. Take a look at what's in SYSCOLUM.mas. Try something like
TABLE FILE SYSCOLUM
PRINT *
END
The fex's are in your repository which is usually an RDBMS. The information about fex's is located in a bunch of tables in the RDBMS. You'll probably have to have admin rights to query that data.
Thanks. I don't think I asked the question correctly.
Lets say I have 50 application folders on my test environment in App Studio. And I am asked to provide a list of ALL mas and fex files, their location, creation date, creator, tablename,with spname/connection name for mass files...
How do I actually get this information or where can I find some documentation on how to get this information.
Thanks,
WebFOCUS 8 Windows, All Outputs
May 21, 2018, 02:43 PM
BabakNYC
You'll have to start reading this part of the Doc.
TABLEF FILE _EDAHOME/CATALOG/SYSAPPS
PRINT APPFULL
ON TABLE HOLD AS DIRLIST
END
Then get the file specifics using a repeat loop:
TABLEF FILE _EDAHOME/CATALOG/SYSAPPS
PRINT APPFULL FNAME FEXT APPLOC FDATE FTIME FSIZE
WHERE APPFULL EQ 'baseapp/proto'
END
One last thing, this will show all columns that are available:
SET ALL=ON
TABLEF FILE _EDAHOME/CATALOG/SYSAPPS
PRINT *
WHERE APPFULL EQ 'baseapp'
END
This message has been edited. Last edited by: dhagen,
"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
May 29, 2018, 01:06 PM
Very Helpful
Thanks you guys. This was very helpful.
How do I get a list of the Adapters including properties.
The end result needs to show me the name of a mas file, the adapter name and the name of the server that the adapter is connected to.
The disconnect I am having is that I cannot get a table with adapter information.
WebFOCUS 8 Windows, All Outputs
May 29, 2018, 01:46 PM
BabakNYC
TABLE FILE SYSTABLE
BY TBTYPE
BY NAME
END
WebFOCUS 8206, Unix, Windows
May 29, 2018, 02:41 PM
Very Helpful
quote:
Originally posted by BabakNYC:
TABLE FILE SYSTABLE
BY TBTYPE
BY NAME
END
The code that you give me shows the files and their types.
The code I use is this: TABLE FILE SYSAPPS PRINT APPNAME AS App APPLOC AS Path FNAME AS 'File,Name' SUFFIX AS 'File,Type' CONNECT AS 'Server' TABNAME AS 'Data,Source' WHERE FEXT EQ 'mas' WHERE TABNAME IS NOT MISSING END
What I need, all I need, is the server names for those adapters that come up in the CONNECT column.
Again, I need the SERVER names for the adapters that come up under the CONNECT column in the sysapps file.
The following code will give you server names: TABLEF FILE sysservers PRINT SRVNAME AS 'Server Name' SRVPRODUCT AS 'Product' DATASOURCE AS 'Data Source' SCHEMADATE AS 'Date Added' END
I need to get from the sysservers table to the sysapps table. Where can I find a list of adapters? If I am using the wrong terminology, can someone please corret me? I am looking for the names of the adapters that the mas files use and then I need to say that the name of the server that the adapter uses.
WebFOCUS 8 Windows, All Outputs
May 29, 2018, 02:50 PM
Very Helpful
Okay I know an easy way to ask this question:
Similar to the 'systables' table, is there a table that stores information for the adapters that includes server names? Perhaps a sort of 'sysadapter' table?
WebFOCUS 8 Windows, All Outputs
May 29, 2018, 05:21 PM
FP Mod Chuck
Very Helpful
No table, you can see all of these listed in a single file on the reporting server console. Look under Workspace / Configuration Files / Server Profile edasprof.prf
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats
May 30, 2018, 10:26 AM
Clif
The server profile edasprof does indeed contain server names and while there is no master that describes it's possible to write one.
I wrote this for another customer. Try it in 8.2 although it not work perfectly for every possible adapter. Also remember that connection information can also be stored in user and group profiles.
-* Show adapters, connections and servers
-* Get location of edsprof.prf
-SET &EDACONF=FGETENV(7, 'EDACONF', 64, 'A64') ;
-SET &EDASPROF =&EDACONF || '\etc\edasprof.prf' ;
FILEDEF SYSCONN DISK &EDASPROF
-RUN
DEFINE FILE sysconn
RUN_DATE/A24 TITLE 'Run Date'='&DATEYYMD' || ' &TOD';
HOST_NAME/A80V TITLE 'Host Name'=RTRIM( FGETENV( 12, 'COMPUTERNAME', 15, 'A15' ) || FGETENV( 8, 'HOSTNAME', 64, 'A64' ) ) ;
END
TABLE FILE SYSCONN
PRINT
RUN_DATE
HOST_NAME
ENGINE
CONNECTION
SERVER
DEFAULT_DATABASE
USER_ID
IF _CONN_ATTR EQ 'CONNECTION_ATTRIBUTES'
END
Master:
FILENAME=SYSCONN, SUFFIX=DFIX ,
CODEPAGE=1252, $
SEGMENT=EDASPROF, SEGTYPE=S0, $
FIELDNAME=_ENGINE, USAGE=A69V, ACTUAL=A69VB,
MISSING=ON, ACCESS_PROPERTY=(INTERNAL), $
FIELDNAME=ENGINE, USAGE=A64, ACTUAL=A64B,
MISSING=ON, $
FIELDNAME=_SET, USAGE=A10V, ACTUAL=A10VB,
MISSING=ON, ACCESS_PROPERTY=(INTERNAL), $
FIELDNAME=_CONN_ATTR, USAGE=A64V, ACTUAL=A64VB,
MISSING=ON, ACCESS_PROPERTY=(INTERNAL), $
FIELDNAME=_CONNECTION, USAGE=A256V, ACTUAL=A256V,
MISSING=ON, $
FIELDNAME=_SERVER, USAGE=A212V, ACTUAL=A212VB,
MISSING=ON, ACCESS_PROPERTY=(INTERNAL), $
DEFINE CONNECTION/A16 MISSING ON ALL WITH _ENGINE=TOKEN(_CONNECTION,'/',1); $
DEFINE SERVER/A212V MISSING ON ALL=IF (EDIT( _SERVER, '9' ) EQ '''') THEN TOKEN( _SERVER, '''', 2 ) ELSE TOKEN( _SERVER, '/', 1 );
TITLE='SERVER', $
DEFINE DEFAULT_DATABASE/A64 MISSING ON ALL=IF POSITION (';' ,_SERVER) NE 0 AND POSITION ('''' ,_SERVER) NE 1
THEN TOKEN (_SERVER,';',-1) ELSE MISSING; $
DEFINE USER_ID/A64 MISSING ON ALL=IF POSITION( '''', _SERVER ) EQ 1 THEN TOKEN( TRIM_( LEADING, '/', TOKEN( _SERVER, '''', 3 ) ), ',', 1 ) ELSE TOKEN( TOKEN( _SERVER, '/', 2 ), ',', 1 ); $
Okay I am going to give this a try. I have created the masterfile using the metadata cavas and edited the access file as well. Web Focus says it can not validate DEFAULT_DATABASE and USER_ID. Also when I run the code above it says: (FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: SYSCONN
Just to let you know I am running 8.0.9
Also, should there be something under IF _CONN_ATTR EQ 'CONNECTION_ATTRIBUTES'?This message has been edited. Last edited by: Very Helpful,
WebFOCUS 8 Windows, All Outputs
May 31, 2018, 10:27 AM
Clif
As I said, try it in 8.2. It requires functionality introduced in that release (which was available in May 2017) to parse out the connection string.
A profile can contain other settings, the IF test which is complete as written, is so that only connections are processed.