1. Trang chủ
  2. » Công Nghệ Thông Tin

SAS/Warehouse Administrator 2.3 Metadata API- P6 pot

5 210 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 5
Dung lượng 448,41 KB

Nội dung

22 _GET_COMPONENTS_ Chapter 2 */ l_cols=getniteml(l_meta,’COLUMNS’); num_cols=listlen(l_cols); do i=1 to num_cols while (l_rc = 0); l_col=getiteml(l_cols,i); /* * Delete each column. */ call send(i_api,’_DELETE_METADATA_’,l_rc,l_col); if l_rc ne 0 then do; msg=getnitemc(l_rc,’MSG’,1,1,’ERROR: _DELETE_METADATA_ FAILED’); put msg; list_rc=dellist(l_rc); end; /* if */ end; /* do */ l_meta=dellist(l_meta,’Y’); See Also _ADD_METADATA_, _UPDATE_METADATA_ _GET_COMPONENTS_ Lists all components that are defined in the metadata API Category: Management Methods Syntax CALL SEND(i_api, ’_GET_COMPONENTS_’, l_rc, l_components); Metadata API Class _GET_CURRENT_REPOSITORIES_ 23 Parameters Parameter Type Description i_api Class specifies the passed instance of the 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 “Conventions” on page 14. l_components L specifies the returned list of all components that are defined in the metadata API. List format: comp_id=comp_name. Components are discussed in “How the Metadata API Works” on page 5. Using _GET_COMPONENTS_ A component is a group of related metadata types. One use for the _GET_COMPONENTS_ method is to get a component ID that you can pass to the _GET_TYPES_ method in order to list the metadata types for a particular component. Example: List All Components Defined for the Metadata API call send(i_api,’_GET_COMPONENTS_’,l_rc, l_components); /* A list of components is returned. */ l_components( WHOUSE=SAS/Warehouse Administrator )[3] See Also _GET_TYPES_ _GET_CURRENT_REPOSITORIES_ Lists all currently active primary metadata repositories Category: Repository Methods Syntax CALL SEND(i_api, ’_GET_CURRENT_REPOSITORIES_’, l_rc, l_reps,<type>); 24 _GET_CURRENT_REPOSITORIES_ Chapter 2 Parameters Parameter Type Description i_api Class specifies the passed instance of the 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_reps L specifies the returned list of repository IDs for the currently active primary metadata repositories. For details about repository IDs, see “Identifying Metadata” on page 7. type C specifies the passed repository type ID. Optional. Limits the l_reps list to primary repositories of this type. Details l_reps specifies the returned list of currently active primary metadata repositories, in the format: l_reps=(type=repository id type=repository id ) For details about primary and secondary repositories, see “Metadata Repositories” on page 10. type specifies the passed repository type ID. Optional. Limits the l_reps list to primary repositories of this type. If a type ID is not passed, all primary repositories will be returned (a value of _ALL_) is passed for type). Each component has one or more metadata repository types. See the metadata type documentation for a particular component for details. For example, for SAS/Warehouse Administrator metadata repository types, see Appendix 1, “Sample Metadata API Code,” on page 273. Using _GET_CURRENT_REPOSITORIES_ To return the list of active secondary repositories, use the _GET_METADATA_ method with the appropriate primary repository ID from the returned l_reps list. See the Usage notes under _GET_METADATA_ for details. See Also _GET_METADATA_ Metadata API Class _GET_METADATA_ 25 _GET_METADATA_ Reads specified metadata from a repository Category: Read Method Syntax CALL SEND(i_api, ’_GET_METADATA_’, l_rc, l_meta,<all>, <expand>); 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_meta L specifies the passed metadata property list for the object that is to be read. For the general format of this list, see “Metadata Property List” on page 14. all N specifies the passed indicator. Optional. Specifies whether the method should get all associated metadata for the object. expand N specifies the passed indicator. Optional. Specifies whether references to dependent objects should be expanded. Details l_meta specifies the passed metadata property list for the object that is to be read. At a minimum, you must supply a fully qualified ID in the l_meta list: reposid.typeid.instanceid. You can supply a formatted l_meta list as input to the _GET_METADATA_ call, as shown in Example 1. In this case, only the sublists (properties) whose names have been passed in the formatted list will be returned. This will allow for selective retrieval of pieces of metadata about an object. Alternatively, you could pass an l_meta list with only the ID property filled in and supply the all parameter to indicate to return all information about the requested object, as shown in Example 2. Getting all properties could take much longer than getting a select few. all specifies the passed indicator. Optional. Specifies whether the method should get all associated metadata for the object. 0 — (default) return only the metadata that is specified in l_meta. 1 — return all information known about the object that is specified in l_meta. However, if a sublist is returned that references another object, only the general identifying information for the referenced object will be returned. 26 _GET_METADATA_ Chapter 2 Note that it takes longer to return a query if you ask for more information. expand specifies the passed indicator. Optional. Specifies that any references to dependent objects should be expanded to include all properties for the referenced object (not only its general identifying information). For an explanation of dependent objects, see “Independent and Dependent Metadata Objects” on page 53. 0 — (default) return all property lists unexpanded. 1 — expand all dependent object references. Note that it takes longer to return a query if you ask for more information. Note: To understand which properties of a given metadata type will be expanded, see the property tables for each type in “Using the Metadata Type Dictionary” on page 73. Using _GET_METADATA_ It is possible that a sublist that is returned might contain identifiers of different types of objects, each with its own properties list format. Use the _IS_SUBTYPE_OF_ method to determine the type of the metadata identifier and thus the appropriate properties list format. CAUTION: The performance of this method is directly related to the number and content of the properties that are requested. The all and expand parameters can have an adverse effect on the performance of this method and should be used accordingly. In addition to reading metadata objects in a repository, you can use _GET_METADATA_ to return a list of secondary metadata repositories. Specify the REPOSITORIES property in the l_meta list, and use the returned metadata identifier from the _SET_PRIMARY_REPOSITORY_ method. See “Example: Set a Secondary Repository” on page 45 and Example 2 on page 42. Examples Example 1: Return Table Information id=’A000000E.WHDETAIL.A000002X’; l_meta=makelist(); l_meta=insertc(l_meta,id,-1,’ID’); /* * For now, retrieve only table properties. */ l_lib=makelist(); l_meta=insertl(l_meta,l_lib,-1,’LIBRARY’); l_cols=makelist(); l_meta=insertl(l_meta,l_cols,-1,’COLUMNS’); l_meta=insertc(l_meta,’ ’,-1,’TABLE NAME’); call send(i_api,’_GET_METADATA_’,l_rc,l_meta); /* returns list: */ L_META( ID=’A000000E.WHDETAIL.A000002X’ LIBRARY=( ID=’A0000001.WHLIBRY.A000000U’ NAME=’Warehouse Data Library’ DESC=’’ . l_reps list. See the Usage notes under _GET _METADATA_ for details. See Also _GET _METADATA_ Metadata API Class _GET _METADATA_ 25 _GET _METADATA_ Reads specified metadata from a repository Category: Read. component has one or more metadata repository types. See the metadata type documentation for a particular component for details. For example, for SAS/Warehouse Administrator metadata repository types,. l_components); Metadata API Class _GET_CURRENT_REPOSITORIES_ 23 Parameters Parameter Type Description i_api Class specifies the passed instance of the METAAPI.CLASS. See “Using the Metadata API

Ngày đăng: 05/07/2014, 07:20