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

SAS/Warehouse Administrator 2.3 Metadata API- P57 doc

5 89 0
Tài liệu đã được kiểm tra trùng lặp

Đ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 451,16 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Sample Metadata API Code Write Metadata Code Sample 277end; /* else */ return; term: /* * Make sure to _TERM_ the api object * so that an orderly clean up * is performed.. */ call sendi_

Trang 1

Sample Metadata API Code Write Metadata Code Sample 277

end; /* else */

return;

term:

/*

* Make sure to _TERM_ the api object

* so that an orderly clean up

* is performed

*/

call send(i_api,’_TERM_’);

return;

Write Metadata Code Sample

/* Sample Write Metadata Program

* for SAS/Warehouse Administrator

*/

/* Insert code to instantiate the metadata API

* and attach to the primary and secondary

* metadata repositories

*/

/*

* Add a new Detail Table

*/

l_meta=makelist();

/*

* Set which group to add this new table to

*/

l_groups=makelist();

l_group=makelist();

l_groups=insertl(l_groups,l_group,-1);

l_group=insertc(l_group,group_id,-1,’ID’);

l_meta=insertl(l_meta,l_groups,-1,’GROUP’);

/*

* Use the same repository id as the group

*/

repos_id=scan(group_id,1,’.’);

new_type=repos_id||’.WHDETAIL’;

l_meta=insertc(l_meta,new_type,-1,’ID’);

Trang 2

278 Write Metadata Code Sample Appendix 1

/*

* Set the name for the display

*/

l_meta=insertc(l_meta,’NEW TABLE’,-1,’NAME’); /*

* Set the desc for the display

*/

l_meta=insertc(l_meta,’New table added through API’,-1,’DESC’);

/*

* Set an icon for the display

*/

l_meta=insertc(l_meta,’SASHELP.I0808.ADD.IMAGE’, -1,’ICON’);

/*

* Define a column The COLUMNS property

* contains a sublist

* per column

*/

l_cols=makelist();

l_col=makelist();

l_cols=insertl(l_cols,l_col,-1);

l_meta=insertl(l_meta,l_cols,-1,’COLUMNS’); col_id=repos_id||’.’||’WHCOLUMN’;

l_col=insertc(l_col,col_id,-1,’ID’);

l_col=insertc(l_col,’CUSTOMER’,-1,’NAME’); l_col=insertc(l_col,’Name of Customer’,-1,

’DESC’);

l_col=insertc(l_col,’C’,-1,’TYPE’);

l_col=insertn(l_col,75,-1,’LENGTH’);

/*

* Add any additional properties

*/

/*

* Add the table

*/

Trang 3

Sample Metadata API Code Write Metadata Code Sample 279

call send(i_api,’_ADD_METADATA_’,

l_rc,l_meta);

if l_rc = 0 then do;

put ’Table Added successfully’;

end; /* if */

else do;

msg=getnitemc(l_rc,’MSG’,1,1,

’ERROR: _ADD_METADATA_ FAILED’);

put msg;

list_rc=dellist(l_rc);

end; /* else */

l_meta=dellist(l_meta,’Y’);

Trang 4

280

Trang 5

A P P E N D I X

2

Metadata Type Inheritance Tree

SAS/Warehouse Administrator Metadata Type Inheritance Tree 281

SAS/Warehouse Administrator Metadata Type Inheritance Tree

The following figures illustrate the inheritance tree for SAS/Warehouse Administrator metadata types.

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

TỪ KHÓA LIÊN QUAN