32 _GET_SUBTYPES_ Chapter 2l_types=dellistl_types; /* returns list */ l_types WHDETAIL=’Detail Table’ WHLDETL=’Detail Logical Table’ WHSUMTBL=’Summary Table’ WHODDTBL=’Operational Data D
Trang 132 _GET_SUBTYPES_ Chapter 2
l_types=dellist(l_types);
/* returns list */
l_types(
WHDETAIL=’Detail Table’
WHLDETL=’Detail Logical Table’
WHSUMTBL=’Summary Table’
WHODDTBL=’Operational Data Definition’
WHODTTBL=’Operational Data Table’
WHTBLPRC=’Process Output Tables’
WHDATTBL=’Data Table’
WHOLPSTR=’OLAP Structure’
WHTBLPRC=’Process Output Table’ )[47]
Example 2: Get Subtypes—Expanded
/*
* Get all Subtypes of Tables
*/
l_types=makelist();
call send(i_api,’_GET_SUBTYPES_’,l_rc,’WHTABLE’,l_types,1);
num_types=listlen(l_types);
if l_rc = 0 then do;
call putlist(l_types);
end; /* if */
else do;
msg=getnitemc(l_rc,’MSG’,1,1,’ERROR:
_GET_SUBTYPES_ Failed.’);
list_rc=dellist(l_rc);
end; /* else */
l_types=dellist(l_types);
/* returns list */
L_types(
WHDETAIL=’Detail Table’
WHLDETL=’Detail Logical Table’
WHSUMTBL=’Summary Table’
WHODDTBL=’Operational Data Definition’
WHODTTBL=’Operational Data Table’
WHTBLPRC=’Process Output Tables’
WHDATTBL=’Data Table’
WHTBLMAP=’Mapping Process Table’
WHTBLUSR=’User Exit Process Table’
Trang 2Metadata API Class _GET_TYPES_ 33
WHTBLXFR=’Data Transfer Process Table’
WHTBLREC=’Record Selector Process Table’
WHOLPSTR=’OLAP Structure’
WHGRPOLP=’OLAP Group’
WHOLPTBL=’OLAP Table’
WHOLPMDD=’OLAP MDDB’
)[47]
_GET_TYPES_
Lists metadata types that are in the metadata API Category: Management Methods
Syntax
CALL SEND(i_api, ’_GET_TYPES_’, l_rc, l_types, < component>);
Parameters
Parameter Type Description
i_api Class specifies the passed instance of METAAPI.CLASS See “Using the
Metadata API Class” on page 14
l_rc N specifies the return codes for the method A nonzero code indicates
failure and means that l_rc is an error list identifier For the error
list format, see “Error Codes” on page 14
l_types L specifies the returned list of metadata types List format:
type_id=type_name.
component C specifies the passed component name Optional Can limit the
returned list to the metadata types within a specific component
Details
component
specifies the passed component name, such as WHOUSE for the SAS/Warehouse Administrator component Optional Can limit the returned list to the metadata types within a specific component The default is _ALL_ (all components).
Components are discussed in “How the Metadata API Works” on page 5 Use _GET_COMPONENTS_ to return a list of components that are available at your site.
Example: Get All Types for the WHOUSE Component
l_types=makelist();
Trang 334 _GET_TYPES_ Chapter 2
call send(i_api,’_GET_TYPES_’,l_rc,l_types,’WHOUSE’);
num_types=listlen(l_types);
if l_rc = 0 then do;
call putlist(l_types);
end; /* if */
else do;
msg=getnitemc(l_rc,’MSG’,1,1,’ERROR:
_GET_TYPES_ Failed.’);
list_rc=dellist(l_rc);
end; /* else */
l_types=dellist(l_types);
/* returns list - types
* (removed for brevity of example)
*/
l_types(
(WHROOT=’Warehouse Root Metadata Type’
WHDWENV=’Warehouse Environment’
WHDW=’Data Warehouse’
WHTFILE=’Text File’
WHTXTCAT=’Catalog Text File’
WHTXTFIL=’External Text File’
WHSCRFIL=’SAS/Connect Script File’
WHEFILE=’External File’
WHTABLE=’Table’
WHDETAIL=’Detail Table’
WHLDETL=’Detail Logical Table’
: WHTBLPRC=’Process Output Tables’
WHTBLMAP=’Mapping Process Table’
WHTBLUSR=’User Exit Process Table’
:
) [47]
See Also
_GET_COMPONENTS_
Trang 4Metadata API Class _GET_TYPE_NAME_ 35
_GET_TYPE_NAME_
Returns metadata type name when it is passed a type ID Category: Management Methods
Syntax
CALL SEND(i_api, ’_GET_TYPE_NAME_’, l_rc, type_id, type_name);
Parameters
Parameter Type Description
i_api Class specifies the passed instance of METAAPI.CLASS See “Using the
Metadata API Class” on page 14
l_rc N specifies the return codes for the method A nonzero code indicates
failure and means that l_rc is an error list identifier For the error
list format, see “Error Codes” on page 14
type_id C specifies the passed type ID of the metadata type for which you
want the name For more information on type ID, see “Identifying Metadata” on page 7
type_name C specifies the returned name of the specified metadata type
Details
type_id
specifies the passed type ID of the metadata type for which you want the name For example, SAS/Warehouse Administrator has the WHDETAIL type If an invalid type ID is passed, the returned type name is set to blank, and a nonzero return code is returned.
type_name
specifies the returned name of the specified metadata type For example, if you pass the type ID WHDETAIL, the name “Detail Table” would be returned A blank value is returned if an invalid metadata type name is supplied.
Example: Get Type Name for WHDETAIL
type_id=’WHDETAIL’;
type_name = _blank_;
call send(i_api,’_GET_TYPE_NAME_’, l_rc,type_id,type_name);
if l_rc = 0 then do;
put type_id= type_name=;
Trang 536 _GET_TYPE_PROPERTIES_ Chapter 2
end; /* if */
else do;
msg=getnitemc(l_rc,’MSG’,1,1,
’ERROR: _GET_TYPE_NAME_ Failed.’);
list_rc=dellist(l_rc);
/* Output in log */
WHDETAIL=Detail Table
_GET_TYPE_PROPERTIES_
Returns all possible properties for a metadata type Category: Management Methods
Syntax
CALL SEND(i_api, ’_GET_TYPE_PROPERTIES_’, l_rc, type_id, l_props, <format>);
Parameters
Parameter Type Description
i_api Class specifies the passed instance of METAAPI.CLASS See “Using the
Metadata API Class” on page 14
l_rc N specifies the return codes for the method A nonzero code indicates
failure and means that l_rc is an error list identifier For the error
list format, see “Error Codes” on page 14
type_id C specifies the passed type ID of the metadata type for which you
want a list of properties For more information on type IDs, see
“Identifying Metadata” on page 7
l_props L specifies the returned list of all possible properties for the specified
metadata type
format C specifies the passed indicator Optional Specifies the format of the
returned property list
Details
type_id
specifies the passed type ID of the metadata type for which you want a list of properties For example, SAS/Warehouse Administrator has the WHDETAIL type.
If an invalid type ID is passed, the returned list is blank.