Type : EXTERNE
Abfrage des SAS Metadatenservers über die Funktionen metadata_resolve, metadata_getnobj usw.
| 1 | options |
| 2 | metaserver="<hostname>" |
| 3 | metaport=8561 |
| 4 | metauser="sasadm @saspw" |
| 5 | metapass="<password>" |
| 6 | metarepository=Foundation |
| 7 | metaprotocol=BRIDGE; |
| 1 | DATA work.prompts; |
| 2 | |
| 3 | /* define and initialize variables */ |
| 4 | |
| 5 | LENGTH |
| 6 | type $ 13 |
| 7 | id $ 17 |
| 8 | stp_uri $ 39 |
| 9 | stp_name $ 255 |
| 10 | pge_uri $ 37 |
| 11 | p_uri $ 50 |
| 12 | p_name $ 50 |
| 13 | ; |
| 14 | |
| 15 | call missing(type,id,stp_uri,stp_name,pge_uri,p_uri,p_name); |
| 16 | |
| 17 | /* Query definition: ClassifierMap of type "StoredProcess" */ |
| 18 | |
| 19 | stp_obj="omsobj:ClassifierMap?ClassifierMap[ @PublicType='StoredProcess']"; |
| 20 | |
| 21 | /* Count the number of stored processes defined in Metadata. */ |
| 22 | |
| 23 | stp_count=metadata_resolve(stp_obj,type,id); |
| 24 | |
| 25 | put "Found " stp_count "Stored Processes."; |
| 26 | |
| 27 | IF stp_count > 0 THEN DO n=1 to stp_count; |
| 28 | |
| 29 | rc1=metadata_getnobj(stp_obj,n,stp_uri); |
| 30 | /* Get the name of the stored process. */ |
| 31 | rc2=metadata_getattr(stp_uri,"Name",stp_name); |
| 32 | /* Get the stored process' associated embedded prompt group. */ |
| 33 | rc3=metadata_getnasn(stp_uri,"Prompts",1,pge_uri); |
| 34 | /* Count the number of prompts in that prompt group. */ |
| 35 | prompt_count=metadata_getnasn(pge_uri,"ReferencedPrompts",1,p_uri); |
| 36 | /* If any prompts are in the group, pull the name of them. */ |
| 37 | IF prompt_count > 0 THEN DO m=1 to prompt_count; |
| 38 | rc4=metadata_getnasn(pge_uri,"ReferencedPrompts",m,p_uri); |
| 39 | rc5=metadata_getattr(p_uri,"Name",p_name); |
| 40 | OUTPUT; |
| 41 | END; |
| 42 | ELSE put "No prompts found, nothing to do."; |
| 43 | END; |
| 44 | ELSE put "No stored processes found, nothing to do."; |
| 45 | keep stp_name p_name; |
| 46 | RUN; |