Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Automated Metadata creation and editing

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Automated Metadata creation and editing
 Login/Join
 
Member
posted
I am trying to automate the creation of synonyms based on stored procedures using the CREATE SYNONYM command. What I'm looking for is the ability to replace character strings inside the .mas and .acx files after they are created.

Since I can't use the ODBC adapter to create a stored procedure based synonym, but I can create one using a SQLMSS adapter and just edit the CONNECTION and SUFFIX afterward (I am doing this now when I create them through the Reporting Server Console), I just need to edit the files after creation.

I am also looking to change the USAGE for all of the date fields (i.e. changing USAGE=HYYMDS to USAGE=HMDYYS).


Any help would be greatly appreciated.


Tony
 
Posts: 9 | Registered: June 27, 2012Report This Post
Expert
posted Hide Post
Several ways you could this but my preference would be to have a master over the files and "table" a new version using defines etc to replace character strings.

I'm sure others will have other preferences.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Platinum Member
posted Hide Post
Hi, I think this is also what is Tony is suggesting. We have used something along these lines:

Firstly, create a Master file that will always be in your path, that looks something like this:

FILENAME=UTILDA80,SUFFIX=FIX ,$
SEGNAME=UTILDAT1 ,SEGTYPE=S0
FIELDNAME=DATA,,A80,A80,$

For my example I will call it util_txt_80.mas

My process then is as follows:
1) I make a copy of the file that I will "edit" e.g. the ACX file
2) I read this file and write out the new ACX file with the required name, using DEFINEs to manipulate the line
3) I delete the copy made in step 1 (optional!)

  
-DEFAULT &1 = 'baseapp'
-DEFAULT &2 = 'file_in'
-DEFAULT &3 = 'MASTER'

-SET &BAK_FILE = &2 || '_bak' ;

APP COPYFILE &1 &2 &3 &1 &BAK_FILE &3
-RUN

-SET &FILE_EXT = DECODE &3('MASTER'  '.mas'  
-                          'ACCESS'  '.acx'
-                          'FOCEXEC' '.fex'
-                          ELSE      '.txt') ;

-SET &FILE_IN  = &1 || '/' || &BAK_FILE || &FILE_EXT ;
-SET &FILE_OUT = &1 || '/' || &2        || &FILE_EXT ;

FI util_txt_80 DISK &FILE_IN
FI TTTXTOUT    DISK &FILE_OUT
-RUN

DEFINE FILE util_txt_80
LINE_OUT/A80 = IF DATA CONTAINS 'CONNECTION=' THEN 'CONNECTION=somethingnew' ELSE
               DATA ;
END
-RUN

TABLEF FILE util_txt_80
PRINT LINE_OUT
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS TTTXTOUT
END
-RUN



Obviously this is a very simple example - all the "hard work" will need to be in the DEFINE.

To call this routine, you could then run it with the following command as an example:

EX UTIL_TXT_EDIT baseapp,car,ACCESS

Something along those lines.


WebFOCUS 8.2.06 mostly Windows Server
 
Posts: 195 | Location: Johannesburg, South Africa | Registered: September 13, 2008Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Automated Metadata creation and editing

Copyright © 1996-2020 Information Builders