Previous Page | Next Page

Metadata Export Reference

Add-In Metadata Exporters

The Export Metadata Facility allows user-supplied add-in exporters to be called from inside SAS/Warehouse Administrator. A SAS Metadata API application can be registered and subsequently called from the SAS/Warehouse Administrator Export Format Selection window. The application can access the metadata through the API and export that metadata using the desired method.

The Add-In Exporter feature is designed much like the Add-In Tools Registry. The Add-In Exporter Registry is contained in a SAS data set. The default data set contains the entries that register the existing SAS supplied exporter tools. This data set resides in the SASHELP library and has a name of WAEXPRT. Any site-specific add-ins can be installed into SASHELP.WAEXPRT, or can be installed as _SASWA.WAEXPRT. If the _SASWA.WAEXPRT data set is found, its entries are used and not those of the SASHELP.WAEXPRT data set.


Usage

The Add-In Exporter Registry has the following format:

MNEMONIC

is an indicator of which frame the export tool is being called from:

USERTOOL -- called from the Explorer

USERSETP -- called from the Setup Frame

ENTRY

is the four-level name of the entry to call. This entry can be of any type that can be called using the SCL CALL DISPLAY function.

NAME

is the name of the exporter tool. This is the name shown as a selection option in the Export Format Selection window.

ACTIVE

is an integer variable, which indicates whether this exporter is currently active. A value of zero or missing indicates that the exporter is currently inactive. Any other value indicates the tool is active. This is provided so entries can remain in the table even though deactivated.

DESC

is a 200-character field that contains a description of the entry in this row. It will not be shown in the user interface but is merely for information purposes when editing the table.

The Add-In Exporter uses the SAS Metadata API and will pass the following three parameters to the entry specified in the registry when that exporter is selected:

ID

is the Metadata ID of the object that is currently selected in the active SAS/Warehouse Administrator frame. If no object is currently active, this field contains a blank value.

I_API

is an initialized instance of the Metadata API object.

Note:   The called application should not terminate the API object passed to it. The API object will be terminated when control is returned to the SAS/Warehouse Administrator.  [cautionend]

L_PARMS

is an empty SCL list that can be used to pass return code information from the called application back to SAS/Warehouse Administrator. The L_PARMS list is designed to contain named items that pass information back and forth between SAS/Warehouse Administrator and the called application. The only named item in the list that SAS/Warehouse Administrator currently processes is RC, which is expected to be a list.

If you choose to pass return code information back to SAS/Warehouse Administrator (which will produce a pop-up error message), your application should create a list with two named items, 'RC' and 'MSG'. The 'RC' item is a numeric return code, the 'MSG' item is a character string that will become the message in the pop-up error message. Add this list you create to L_PARMS as the named item 'RC' to return the value to SAS/Warehouse Administrator. A non-zero RC value will signal an error to SAS/Warehouse Administrator.

The entry statement for the called tool should be coded as follows:

entry id $ 26 i_api 8 l_parms 8;

Example Add-In Application

Suppose you have written a Metadata API application that uses the API to access information about a Detail Table, and the application writes the pertinent metadata about that Detail Table and its process to an external file. You want to make this tool available from the Explorer in SAS/Warehouse Administrator, and you want to disable the SAS data set exporter that is provided for the Explorer. To do this, you add the necessary information to the SASHELP.WAEXPRT data set, as follows:

Example Add-In Exporter Registry
Mnemonic Entry Name Active Desc
USERTOOL SASHELP.DW.EXPAEIS.SCL SAS/EIS Metabase 1
USERTOOL SASHELP.DW.EXPASAS.SCL SAS Datasets 0
USERSETP SASHELP.DW.EXPASASG.SCL SAS Datasets 1
USERTOOL YOURLIB.YOURAPI.APP.FRAME My Exporter 1

After this modification is made to the SASHELP.WAEXPRT data set, your changes will be reflected in the Export Format Selection window. When you select an item in the Explorer and choose to Export Metadata, you will have the option of selecting SAS/EIS Metabase or My Exporter. The SAS Datasets option will no longer appear because you have set active=0.

If you were to choose My Explorer, SAS/Warehouse Administrator will invoke YOURLIB.YOURAPI.APP.FRAME with a CALL DISPLAY SCL statement. If the entry is not found, an error message will be displayed.

Previous Page | Next Page | Top of Page