47%macro mm_createapplication(
48 tree=/User Folders/sasdemo
50 ,ClassIdentifier=mcore
51 ,desc=Created by mm_createapplication
52 ,params= param1=1
param2=blah
60%
if &mDebug=1 %then %let mD=;
62%&mD.put Executing &sysmacroname..sas;
65%mp_abort(iftrue= (%mf_verifymacvars(tree name)=0)
67 ,msg=%str(Empty inputs: tree name)
76 rc=metadata_pathobj(
"",
"&tree",
"Folder",type,uri);
77 call symputx(
'type',type,
'l');
78 call symputx(
'treeuri',uri,
'l');
82 iftrue= (&type ne Tree)
83 ,mac=mm_createapplication.sas
84 ,msg=Tree &tree does not exist!
92 rc=metadata_pathobj("","&tree/&name","Application",type,uri);
93 call symputx('type',type,'l');
98 iftrue= (&type = SoftwareComponent)
99 ,mac=mm_createapplication.sas
100 ,msg=Application &name already exists in &tree!
107filename &frefin temp;
112 name=quote(symget('name'));
113 desc=quote(symget('desc'));
114 ClassIdentifier=quote(symget('ClassIdentifier'));
115 version=quote(symget('version'));
116 params=quote(symget('params'));
117 treeuri=quote(symget('treeuri'));
119 put "<AddMetadata><Reposid>$METAREPOSITORY</Reposid><Metadata> "/
120 '<SoftwareComponent IsHidden="0" Name=' name ' ProductName=' name /
121 ' ClassIdentifier=' ClassIdentifier ' Desc=' desc /
122 ' SoftwareVersion=' version ' SpecVersion=' version /
123 ' Major="1" Minor="1" UsageVersion="1000000" PublicType="Application" >' /
125 ' <TextStore Name="Public Configuration Properties" IsHidden="0" ' /
126 ' UsageVersion="0" StoredText=' params '/>' /
128 "<Trees><Tree ObjRef=" treeuri "/></Trees>"/
129 "</SoftwareComponent></Metadata><NS>SAS</NS>"/
130 "<Flags>268435456</Flags></AddMetadata>";
133filename &frefout temp;
135proc metadata in= &frefin out=&frefout verbose;
138%if &mdebug=1 %then %do;
141 infile &frefout lrecl=1048576;
147%put NOTE: Checking to ensure application (&name) was created;
149 length type uri $256;
150 rc=metadata_pathobj("","&tree/&name","Application",type,uri);
151 call symputx('apptype',type,'l');
152 %if &mdebug=1 %then putlog (_all_)(=);;
154%if &apptype ne SoftwareComponent %then %do;
155 %put %str(ERR)OR: Could not find (&name) at (&tree)!!;
158%else %put NOTE: Application (&name) successfully created in (&tree)!;
161%mend mm_createapplication;