Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Process to parse a Masterfile
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Process to parse a Masterfile
 Login/Join
 
Member
posted
Does anyone have a process written to parse a masterfile to extract field names, descriptions, defined fields, and filters?

This message has been edited. Last edited by: FP Mod Chuck,


All WebFOCUS Releases
 
Posts: 4 | Registered: November 14, 2012Reply With QuoteReport This Post
Expert
posted Hide Post
Umm, SYSTABLE and SYSCOLUM will help, as they read the masters and access files.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6252 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Roger

This is some code that Marcy Miller created to expose the metadata into a hold file and use for different functions with her 'Fasttrack' application. It is pretty complex and probably isn't exactly what you need but you will see how to get the info you are wanting.


-* File Extend Metadata
-SET &FOLDERPATH='fasttrack';
-RUN
TABLE FILE SYSAPPS
SUM FNAME
BY FNAME NOPRINT
WHERE FEXT EQ 'mas';
WHERE APPNAME CONTAINS '&FOLDERPATH.EVAL';
WHERE FDESCR NE '';
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS TBLIST
END

-* BUILD METADATA
DEFINE FILE SYSCOLUM
JOINKEY/A60=EDIT(TBNAME,'999999999999999999999999999999')||EDIT(NAME,'999999999999999999999999999999');
DSPLYLBL/A1000=STRREP (1000, TITLE, 1000, ',', 1, ' ', 1000, 'A1000');
NFILENAME/A100=IF FILENAME EQ '' THEN '' ELSE (FILENAME || '.');
NSEGNAME/A100=IF SEGNAME EQ '' THEN '' ELSE (SEGNAME || '.');
NEWNAME/A1000=IF DEFINE EQ 'C' THEN ('COMPUTE ' | NAME || ';') ELSE (NFILENAME || NSEGNAME || NAME);
GROUPSORT/A2=DECODE DEFINE ('Y' '2' 'C' '3' 'F' '4' ELSE '1');
GROUPING/A40=DECODE DEFINE ('Y' 'Virtual Row Calculations' 'C' 'Virtual Aggregation Calculations' 'F' 'Filters' ELSE 'Database Columns');
USAGE1/A1=EDIT(USAGE,'9');
USAGE2/I4=IF USAGE CONTAINS 'V' THEN EDIT(EDIT(GETTOK(USAGE, 200, 1, 'V', 200, 'A50'),'$99')) ELSE EDIT(EDIT(USAGE,'$99'));
GA_COLTYPE/A2=IF IS_CUBE EQ 'Y' AND DIMEN_NAME GT '' THEN 'D' ELSE
IF IS_CUBE EQ 'Y' AND PROPERTY EQ 'MEASURE' THEN 'M' ELSE
IF IS_CUBE EQ 'Y' AND PROPERTY EQ 'CAPTION' THEN 'D' ELSE
IF IS_CUBE EQ 'Y' AND PROPERTY EQ 'ATTRIBUTE' THEN 'D' ELSE
IF IS_CUBE EQ 'Y' AND PROPERTY EQ 'FILTER' THEN 'F' ELSE
IF IS_CUBE EQ 'Y' AND DEFINE EQ 'F' THEN 'F' ELSE
IF IS_CUBE EQ 'Y' AND DIMEN_NAME NE '' THEN 'D' ELSE
IF IS_CUBE EQ 'Y' THEN '' ELSE
IF DEFINE EQ 'F' OR BV_DEFINE EQ 'F' THEN 'F' ELSE
IF DEFINE EQ 'C' OR BV_DEFINE EQ 'C' THEN 'M' ELSE
IF DEFINE EQ 'Y' AND USAGE EQ 'YMD' OR 'YYMD' OR 'YYMDy' OR 'YYMDm' OR 'YYMDq' OR 'MtDYYm' OR 'W' OR 'WT' OR 'WR' OR 'Wt' OR 'Wr' OR 'Mt' OR 'wt' THEN 'D' ELSE
IF USAGE1 EQ 'A' THEN 'D' ELSE
IF USAGE1 EQ 'P' THEN 'M' ELSE
IF USAGE1 EQ 'D' THEN 'M' ELSE
IF USAGE1 EQ 'I' THEN 'M' ELSE
IF DEFINE EQ 'Y' AND USAGE1 EQ 'I' THEN 'M' ELSE
IF DEFINE EQ 'Y' AND USAGE1 EQ 'P' THEN 'M' ELSE
IF DEFINE EQ 'Y' AND USAGE1 EQ 'D' THEN 'M' ELSE
'';
END
TABLE FILE SYSCOLUM
SUM
USAGE
DEFTEXT
GA_COLTYPE
LONGDESC
BY JOINKEY
BY TBNAME
BY NAME
BY DSPLYLBL AS 'TITLE'
BY NEWNAME AS 'PASSED_COLUMN'
BY ALIAS
BY USAGE1 NOPRINT
WHERE ACCESS_PROP NE 'INTERNAL';
WHERE TBNAME EQ '&TBNAME';
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS METAHOLD1 FORMAT FOCUS INDEX JOINKEY
END

-* GET DEFAULT MEASURES
TABLE FILE METAHOLD1
LIST NAME
JOINKEY
BY TBNAME
WHERE GA_COLTYPE EQ 'M';

ON TABLE HOLD AS METAMEAS
END

TABLE FILE METAMEAS
SUM COMPUTE VARNAME/A20='MEASURE' || EDIT(LIST,'$$$$9');
BY JOINKEY
ON TABLE HOLD AS HOLDMEAS FORMAT ALPHA
END


-* GET DEFAULT DIMENSIONS
TABLE FILE METAHOLD1
LIST NAME
JOINKEY
BY TBNAME
WHERE (GA_COLTYPE NE 'DX' OR 'M' OR 'F')
ON TABLE HOLD AS METADIM
END

TABLE FILE METADIM
SUM COMPUTE VARNAME/A20='DIMENSION' || EDIT(LIST,'$$$$9');
BY JOINKEY
ON TABLE HOLD AS HOLDDIM FORMAT ALPHA
END

TABLE FILE HOLDMEAS
SUM VARNAME
BY JOINKEY
ON TABLE HOLD AS METAVARS FORMAT FOCUS INDEX JOINKEY
MORE
FILE HOLDDIM
END


JOIN JOINKEY IN METAHOLD1 TO UNIQUE JOINKEY IN METAVARS AS J1
TABLE FILE METAHOLD1
PRINT
USAGE
TITLE
PASSED_COLUMN
DEFTEXT
GA_COLTYPE
LONGDESC
VARNAME
BY TBNAME
BY NAME
WHERE TITLE NE ''
ON TABLE HOLD AS METAHOLD2
END
-RUN

TABLE FILE METAHOLD2
PRINT *
ON TABLE HOLD AS EXTMETADATA FORMAT ALPHA
END


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
 
Posts: 1813 | Location: Customer Support | Registered: April 12, 2005Reply With QuoteReport This Post
Member
posted Hide Post
Thank you for the insight Chuck. I'll make a pot of coffee and look this over !!!

Hope you are doing great.


All WebFOCUS Releases
 
Posts: 4 | Registered: November 14, 2012Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Process to parse a Masterfile

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.