mirror of
https://github.com/sasjs/core.git
synced 2026-01-09 02:10:06 +00:00
fix: linting
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
**/
|
||||
|
||||
%macro mm_assigndirectlib(
|
||||
libref /* libref to assign from metadata */
|
||||
libref /* libref to assign from metadata */
|
||||
,open_passthrough= /* provide an alias to produce the
|
||||
CONNECT TO statement for the
|
||||
relevant external database */
|
||||
@@ -107,7 +107,7 @@ run;
|
||||
run;
|
||||
|
||||
%if %sysevalf(&sysver<9.4) %then %do;
|
||||
libname &libref &filepath;
|
||||
libname &libref &filepath;
|
||||
%end;
|
||||
%else %do;
|
||||
/* apply the new filelocks option to cater for temporary locks */
|
||||
@@ -117,7 +117,8 @@ run;
|
||||
%end;
|
||||
%else %if &engine=REMOTE %then %do;
|
||||
data x;
|
||||
length rcCon rcProp rc k 3 uriCon uriProp PropertyValue PropertyName Delimiter $256 properties $2048;
|
||||
length rcCon rcProp rc k 3 uriCon uriProp PropertyValue PropertyName
|
||||
Delimiter $256 properties $2048;
|
||||
retain properties;
|
||||
rcCon = metadata_getnasn("&liburi", "LibraryConnection", 1, uriCon);
|
||||
|
||||
@@ -129,8 +130,9 @@ run;
|
||||
rc = metadata_getattr(uriProp , "DefaultValue",PropertyValue);
|
||||
rc = metadata_getattr(uriProp , "PropertyName",PropertyName);
|
||||
rc = metadata_getattr(uriProp , "Delimiter",Delimiter);
|
||||
properties = trim(properties) !! " " !! trim(PropertyName) !! trim(Delimiter) !! trim(PropertyValue);
|
||||
output;
|
||||
properties = trim(properties) !! " " !! trim(PropertyName)
|
||||
!! trim(Delimiter) !! trim(PropertyValue);
|
||||
output;
|
||||
k+1;
|
||||
rcProp = metadata_getnasn(uriCon, "Properties", k, uriProp);
|
||||
end;
|
||||
@@ -165,13 +167,14 @@ run;
|
||||
rc=metadata_getnasn(connx_uri,'Properties',i,conprop_uri);
|
||||
rc2=metadata_getattr(conprop_uri,'Name',value);
|
||||
if value='Connection.OLE.Property.DATASOURCE.Name.xmlKey.txt' then do;
|
||||
rc3=metadata_getattr(conprop_uri,'DefaultValue',datasource);
|
||||
rc3=metadata_getattr(conprop_uri,'DefaultValue',datasource);
|
||||
end;
|
||||
else if value='Connection.OLE.Property.PROVIDER.Name.xmlKey.txt' then do;
|
||||
rc4=metadata_getattr(conprop_uri,'DefaultValue',provider);
|
||||
rc4=metadata_getattr(conprop_uri,'DefaultValue',provider);
|
||||
end;
|
||||
else if value='Connection.OLE.Property.PROPERTIES.Name.xmlKey.txt' then do;
|
||||
rc5=metadata_getattr(conprop_uri,'DefaultValue',properties);
|
||||
else if value='Connection.OLE.Property.PROPERTIES.Name.xmlKey.txt' then
|
||||
do;
|
||||
rc5=metadata_getattr(conprop_uri,'DefaultValue',properties);
|
||||
end;
|
||||
end;
|
||||
&mD.putlog 'NOTE- dsn/provider/properties: ' /
|
||||
@@ -194,8 +197,8 @@ run;
|
||||
/* need additional properties to make this work */
|
||||
properties=('Integrated Security'=SSPI
|
||||
'Persist Security Info'=True
|
||||
%sysfunc(compress(%str(&SQL_properties),%str(())))
|
||||
)
|
||||
%sysfunc(compress(%str(&SQL_properties),%str(())))
|
||||
)
|
||||
DATASOURCE=&sql_dsn PROMPT=NO
|
||||
PROVIDER=&sql_provider SCHEMA=&sql_schema CONNECTION = GLOBAL);
|
||||
%end;
|
||||
@@ -203,9 +206,9 @@ run;
|
||||
LIBNAME &libref OLEDB PROPERTIES=&sql_properties
|
||||
DATASOURCE=&sql_dsn PROVIDER=&sql_provider SCHEMA=&sql_schema
|
||||
%if %length(&sql_domain)>0 %then %do;
|
||||
authdomain="&sql_domain"
|
||||
authdomain="&sql_domain"
|
||||
%end;
|
||||
connection=shared;
|
||||
connection=shared;
|
||||
%end;
|
||||
%end;
|
||||
%else %if &engine=ODBC %then %do;
|
||||
@@ -222,8 +225,8 @@ run;
|
||||
rc2=metadata_getnasn(connx_uri,'Properties',i,conprop_uri);
|
||||
rc3=metadata_getattr(conprop_uri,'Name',value);
|
||||
if value='Connection.ODBC.Property.DATASRC.Name.xmlKey.txt' then do;
|
||||
rc4=metadata_getattr(conprop_uri,'DefaultValue',datasource);
|
||||
rc2=-1;
|
||||
rc4=metadata_getattr(conprop_uri,'DefaultValue',datasource);
|
||||
rc2=-1;
|
||||
end;
|
||||
end;
|
||||
/* get SCHEMA */
|
||||
@@ -280,7 +283,7 @@ run;
|
||||
|
||||
/* get PRESERVE_TAB_NAMES value */
|
||||
/* be careful with PRESERVE_TAB_NAMES=YES - it will mean your table will
|
||||
become case sensitive!! */
|
||||
become case sensitive!! */
|
||||
prop='Library.DBMS.Property.PreserveTabNames.Name.xmlKey.txt';
|
||||
rc=metadata_getprop("&liburi",prop,preserve_tab_names,"");
|
||||
if preserve_tab_names^='' then preserve_tab_names=
|
||||
@@ -357,7 +360,8 @@ run;
|
||||
call symputx('authdomain',authdomain,'l');
|
||||
|
||||
/* path */
|
||||
rc=metadata_getprop(assocuri1,'Connection.Oracle.Property.PATH.Name.xmlKey.txt',path);
|
||||
rc=metadata_getprop(assocuri1,
|
||||
'Connection.Oracle.Property.PATH.Name.xmlKey.txt',path);
|
||||
call symputx('path',path,'l');
|
||||
|
||||
/* schema */
|
||||
@@ -366,27 +370,30 @@ run;
|
||||
call symputx('schema',schema,'l');
|
||||
run;
|
||||
%put NOTE: Executing the following:/; %put NOTE-;
|
||||
%put NOTE- libname &libref ORACLE path=&path schema=&schema authdomain=&authdomain;
|
||||
%put NOTE- libname &libref ORACLE path=&path schema=&schema;
|
||||
%put NOTE- authdomain=&authdomain;
|
||||
%put NOTE-;
|
||||
libname &libref ORACLE path=&path schema=&schema authdomain=&authdomain;
|
||||
%end;
|
||||
%else %if &engine=SQLSVR %then %do;
|
||||
%put NOTE: Obtaining &engine library details;
|
||||
data _null;
|
||||
length assocuri1 assocuri2 assocuri3 authdomain path schema userid passwd $256;
|
||||
length assocuri1 assocuri2 assocuri3 authdomain path schema userid
|
||||
passwd $256;
|
||||
call missing (of _all_);
|
||||
|
||||
|
||||
rc=metadata_getnasn("&liburi",'DefaultLogin',1,assocuri1);
|
||||
rc=metadata_getattr(assocuri1,"UserID",userid);
|
||||
rc=metadata_getattr(assocuri1,"Password",passwd);
|
||||
call symputx('user',userid,'l');
|
||||
call symputx('pass',passwd,'l');
|
||||
|
||||
|
||||
/* path */
|
||||
rc=metadata_getnasn("&liburi",'LibraryConnection',1,assocuri2);
|
||||
rc=metadata_getprop(assocuri2,'Connection.SQL.Property.Datasrc.Name.xmlKey.txt',path);
|
||||
rc=metadata_getprop(assocuri2,
|
||||
'Connection.SQL.Property.Datasrc.Name.xmlKey.txt',path);
|
||||
call symputx('path',path,'l');
|
||||
|
||||
|
||||
/* schema */
|
||||
rc=metadata_getnasn("&liburi",'UsingPackages',1,assocuri3);
|
||||
rc=metadata_getattr(assocuri3,'SchemaName',schema);
|
||||
@@ -394,17 +401,19 @@ run;
|
||||
run;
|
||||
|
||||
%put NOTE: Executing the following:/; %put NOTE-;
|
||||
%put NOTE- libname &libref SQLSVR datasrc=&path schema=&schema user="&user" pass="XXX";
|
||||
%put NOTE- libname &libref SQLSVR datasrc=&path schema=&schema ;
|
||||
%put NOTE- user="&user" pass="XXX";
|
||||
%put NOTE-;
|
||||
|
||||
libname &libref SQLSVR datasrc=&path schema=&schema user="&user" pass="&pass" ;
|
||||
libname &libref SQLSVR datasrc=&path schema=&schema user="&user" pass="&pass";
|
||||
%end;
|
||||
%else %if &engine=TERADATA %then %do;
|
||||
%put NOTE: Obtaining &engine library details;
|
||||
data _null;
|
||||
length assocuri1 assocuri2 assocuri3 authdomain path schema userid passwd $256;
|
||||
length assocuri1 assocuri2 assocuri3 authdomain path schema userid
|
||||
passwd $256;
|
||||
call missing (of _all_);
|
||||
|
||||
|
||||
/* get auth domain */
|
||||
rc=metadata_getnasn("&liburi",'LibraryConnection',1,assocuri1);
|
||||
rc=metadata_getnasn(assocuri1,'Domain',1,assocuri2);
|
||||
@@ -421,9 +430,10 @@ run;
|
||||
|
||||
/* path */
|
||||
rc=metadata_getnasn("&liburi",'LibraryConnection',1,assocuri2);
|
||||
rc=metadata_getprop(assocuri2,'Connection.Teradata.Property.SERVER.Name.xmlKey.txt',path);
|
||||
rc=metadata_getprop(assocuri2,
|
||||
'Connection.Teradata.Property.SERVER.Name.xmlKey.txt',path);
|
||||
call symputx('path',path,'l');
|
||||
|
||||
|
||||
/* schema */
|
||||
rc=metadata_getnasn("&liburi",'UsingPackages',1,assocuri3);
|
||||
rc=metadata_getattr(assocuri3,'SchemaName',schema);
|
||||
@@ -431,7 +441,8 @@ run;
|
||||
run;
|
||||
|
||||
%put NOTE: Executing the following:/; %put NOTE-;
|
||||
%put NOTE- libname &libref TERADATA server=&path schema=&schema authdomain=&authdomain;
|
||||
%put NOTE- libname &libref TERADATA server=&path schema=&schema ;
|
||||
%put NOTe- authdomain=&authdomain;
|
||||
%put NOTE-;
|
||||
|
||||
libname &libref TERADATA server=&path schema=&schema authdomain=&authdomain;
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
@li mp_abort.sas
|
||||
|
||||
@param libref the libref (not name) of the metadata library
|
||||
@param mAbort= If not assigned, HARD will call %mp_abort(), SOFT will silently return
|
||||
@param mAbort= If not assigned, HARD will call %mp_abort(), SOFT will
|
||||
silently return
|
||||
|
||||
@returns libname statement
|
||||
|
||||
@@ -24,7 +25,7 @@
|
||||
**/
|
||||
|
||||
%macro mm_assignlib(
|
||||
libref
|
||||
libref
|
||||
,mAbort=HARD
|
||||
)/*/STORE SOURCE*/;
|
||||
|
||||
|
||||
@@ -13,7 +13,9 @@
|
||||
,params= name1=value1
name2=value2
emptyvalue=
|
||||
)
|
||||
|
||||
@warning application components do not get deleted when removing the container folder! be sure you have the administrative priviliges to remove this kind of metadata from the SMC plugin (or be ready to do to so programmatically).
|
||||
@warning application components do not get deleted when removing the container
|
||||
folder! be sure you have the administrative priviliges to remove this kind of
|
||||
metadata from the SMC plugin (or be ready to do to so programmatically).
|
||||
|
||||
<h4> SAS Macros </h4>
|
||||
@li mp_abort.sas
|
||||
@@ -60,8 +62,8 @@
|
||||
%mf_verifymacvars(tree name)
|
||||
|
||||
/**
|
||||
* check tree exists
|
||||
*/
|
||||
* check tree exists
|
||||
*/
|
||||
|
||||
data _null_;
|
||||
length type uri $256;
|
||||
@@ -77,8 +79,8 @@ run;
|
||||
)
|
||||
|
||||
/**
|
||||
* Check object does not exist already
|
||||
*/
|
||||
* Check object does not exist already
|
||||
*/
|
||||
data _null_;
|
||||
length type uri $256;
|
||||
rc=metadata_pathobj("","&tree/&name","Application",type,uri);
|
||||
@@ -94,8 +96,8 @@ run;
|
||||
|
||||
|
||||
/**
|
||||
* Now we can create the application
|
||||
*/
|
||||
* Now we can create the application
|
||||
*/
|
||||
filename &frefin temp;
|
||||
|
||||
/* write header XML */
|
||||
|
||||
@@ -50,8 +50,8 @@
|
||||
%mf_verifymacvars(tree name)
|
||||
|
||||
/**
|
||||
* check tree exists
|
||||
*/
|
||||
* check tree exists
|
||||
*/
|
||||
|
||||
data _null_;
|
||||
length type uri $256;
|
||||
@@ -67,8 +67,8 @@ run;
|
||||
)
|
||||
|
||||
/**
|
||||
* Check object does not exist already
|
||||
*/
|
||||
* Check object does not exist already
|
||||
*/
|
||||
data _null_;
|
||||
length type uri $256;
|
||||
rc=metadata_pathobj("","&tree/&name","Note",type,uri);
|
||||
@@ -83,8 +83,8 @@ run;
|
||||
%end;
|
||||
|
||||
/**
|
||||
* Now we can create the document
|
||||
*/
|
||||
* Now we can create the document
|
||||
*/
|
||||
filename &frefin temp;
|
||||
|
||||
/* write header XML */
|
||||
|
||||
@@ -55,7 +55,7 @@ data _null_;
|
||||
|
||||
* must have a starting slash ;
|
||||
if ( substr(folderPath,1,1) ne '/' ) then do;
|
||||
put "%str(ERR)OR: &sysmacroname PATH parameter value must have starting slash";
|
||||
put "%str(ERR)OR: &sysmacroname PATH param value must have starting slash";
|
||||
stop;
|
||||
end;
|
||||
|
||||
@@ -75,8 +75,8 @@ data _null_;
|
||||
* check that root folder exists ;
|
||||
root=cats('/',scan(folderpath,1,'/'),"(Folder)");
|
||||
if metadata_pathobj('',root,"",objType,parentId)<1 then do;
|
||||
put "%str(ERR)OR: " root " does not exist!";
|
||||
stop;
|
||||
put "%str(ERR)OR: " root " does not exist!";
|
||||
stop;
|
||||
end;
|
||||
|
||||
* check that parent folder exists ;
|
||||
@@ -86,21 +86,21 @@ data _null_;
|
||||
if rc<1 then do;
|
||||
putlog 'The following folders will be created:';
|
||||
/* folder does not exist - so start from top and work down */
|
||||
length newpath $1000;
|
||||
paths=0;
|
||||
do x=2 to countw(folderpath,'/');
|
||||
newpath='';
|
||||
do i=1 to x;
|
||||
newpath=cats(newpath,'/',scan(folderpath,i,'/'));
|
||||
end;
|
||||
rc=metadata_pathobj('',cats(newpath,"(Folder)"),"",objType,parentId);
|
||||
if rc<1 then do;
|
||||
paths+1;
|
||||
call symputx(cats('path',paths),newpath);
|
||||
putlog newpath;
|
||||
end;
|
||||
call symputx('paths',paths);
|
||||
end;
|
||||
length newpath $1000;
|
||||
paths=0;
|
||||
do x=2 to countw(folderpath,'/');
|
||||
newpath='';
|
||||
do i=1 to x;
|
||||
newpath=cats(newpath,'/',scan(folderpath,i,'/'));
|
||||
end;
|
||||
rc=metadata_pathobj('',cats(newpath,"(Folder)"),"",objType,parentId);
|
||||
if rc<1 then do;
|
||||
paths+1;
|
||||
call symputx(cats('path',paths),newpath);
|
||||
putlog newpath;
|
||||
end;
|
||||
call symputx('paths',paths);
|
||||
end;
|
||||
end;
|
||||
else putlog "parent " parent " exists";
|
||||
|
||||
@@ -115,7 +115,7 @@ run;
|
||||
|
||||
%if &paths>0 %then %do x=1 %to &paths;
|
||||
%put executing recursive call for &&path&x;
|
||||
%mm_createfolder(path=&&path&x)
|
||||
%mm_createfolder(path=&&path&x)
|
||||
%end;
|
||||
%else %do;
|
||||
filename __newdir temp;
|
||||
@@ -123,9 +123,10 @@ run;
|
||||
%local inmeta;
|
||||
%put creating: &path;
|
||||
%let inmeta=<AddMetadata><Reposid>$METAREPOSITORY</Reposid><Metadata>
|
||||
<Tree Name='&child' PublicType='Folder' TreeType='BIP Folder' UsageVersion='1000000'>
|
||||
<ParentTree><Tree ObjRef='&parentFolderObjId'/></ParentTree></Tree></Metadata>
|
||||
<NS>SAS</NS><Flags>268435456</Flags></AddMetadata>;
|
||||
<Tree Name='&child' PublicType='Folder' TreeType='BIP Folder'
|
||||
UsageVersion='1000000'><ParentTree><Tree ObjRef='&parentFolderObjId'/>
|
||||
</ParentTree></Tree></Metadata><NS>SAS</NS><Flags>268435456</Flags>
|
||||
</AddMetadata>;
|
||||
|
||||
proc metadata in="&inmeta" out=__newdir verbose;
|
||||
run ;
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
**/
|
||||
|
||||
%macro mm_createlibrary(
|
||||
libname=My New Library
|
||||
libname=My New Library
|
||||
,libref=mynewlib
|
||||
,libdesc=Created automatically using the mm_createlibrary macro
|
||||
,engine=BASE
|
||||
@@ -78,8 +78,8 @@
|
||||
%let libref=%upcase(&libref);
|
||||
|
||||
/**
|
||||
* Check Library does not exist already with this libname
|
||||
*/
|
||||
* Check Library does not exist already with this libname
|
||||
*/
|
||||
data _null_;
|
||||
length type uri $256;
|
||||
rc=metadata_resolve("omsobj:SASLibrary?@Name='&libname'",type,uri);
|
||||
@@ -93,8 +93,8 @@ run;
|
||||
%end;
|
||||
|
||||
/**
|
||||
* Check Library does not exist already with this libref
|
||||
*/
|
||||
* Check Library does not exist already with this libref
|
||||
*/
|
||||
data _null_;
|
||||
length type uri $256;
|
||||
rc=metadata_resolve("omsobj:SASLibrary?@Libref='&libref'",type,uri);
|
||||
@@ -109,13 +109,13 @@ run;
|
||||
|
||||
|
||||
/**
|
||||
* Attempt to create tree
|
||||
*/
|
||||
* Attempt to create tree
|
||||
*/
|
||||
%mm_createfolder(path=&tree)
|
||||
|
||||
/**
|
||||
* check tree exists
|
||||
*/
|
||||
* check tree exists
|
||||
*/
|
||||
data _null_;
|
||||
length type uri $256;
|
||||
rc=metadata_pathobj("","&tree","Folder",type,uri);
|
||||
@@ -128,8 +128,8 @@ run;
|
||||
%end;
|
||||
|
||||
/**
|
||||
* Create filerefs for proc metadata call
|
||||
*/
|
||||
* Create filerefs for proc metadata call
|
||||
*/
|
||||
filename &frefin temp;
|
||||
filename &frefout temp;
|
||||
|
||||
@@ -140,8 +140,8 @@ filename &frefout temp;
|
||||
|
||||
|
||||
/**
|
||||
* Check that the ServerContext exists
|
||||
*/
|
||||
* Check that the ServerContext exists
|
||||
*/
|
||||
data _null_;
|
||||
length type uri $256;
|
||||
rc=metadata_resolve("omsobj:ServerContext?@Name='&ServerContext'",type,uri);
|
||||
@@ -155,8 +155,8 @@ filename &frefout temp;
|
||||
%end;
|
||||
|
||||
/**
|
||||
* Get prototype info
|
||||
*/
|
||||
* Get prototype info
|
||||
*/
|
||||
data _null_;
|
||||
length type uri str $256;
|
||||
str="omsobj:Prototype?@Name='Library.SAS.Prototype.Name.xmlKey.txt'";
|
||||
@@ -166,21 +166,21 @@ filename &frefout temp;
|
||||
putlog (_all_)(=);
|
||||
run;
|
||||
%if &checktype ne Prototype %then %do;
|
||||
%put %str(ERR)OR: Prototype (Library.SAS.Prototype.Name.xmlKey.txt) not found!;
|
||||
%put %str(ERR)OR: Prototype Library.SAS.Prototype.Name.xmlKey.txt not found;
|
||||
%return;
|
||||
%end;
|
||||
|
||||
/**
|
||||
* Check that Physical location exists
|
||||
*/
|
||||
* Check that Physical location exists
|
||||
*/
|
||||
%if %sysfunc(fileexist(&directory))=0 %then %do;
|
||||
%put %str(ERR)OR: Physical directory (&directory) does not appear to exist!;
|
||||
%return;
|
||||
%end;
|
||||
|
||||
/**
|
||||
* Check that Directory Object exists in metadata
|
||||
*/
|
||||
* Check that Directory Object exists in metadata
|
||||
*/
|
||||
data _null_;
|
||||
length type uri $256;
|
||||
rc=metadata_resolve("omsobj:Directory?@DirectoryRole='LibraryPath'"
|
||||
@@ -228,16 +228,16 @@ filename &frefout temp;
|
||||
%end;
|
||||
|
||||
/**
|
||||
* check SAS version
|
||||
*/
|
||||
* check SAS version
|
||||
*/
|
||||
%if %sysevalf(&sysver lt 9.3) %then %do;
|
||||
%put WARNING: Version 9.3 or later required;
|
||||
%return;
|
||||
%end;
|
||||
|
||||
/**
|
||||
* Prepare the XML and create the library
|
||||
*/
|
||||
* Prepare the XML and create the library
|
||||
*/
|
||||
data _null_;
|
||||
file &frefin;
|
||||
treeuri=quote(symget('treeuri'));
|
||||
@@ -311,8 +311,8 @@ filename &frefout temp;
|
||||
|
||||
|
||||
/**
|
||||
* Wrap up
|
||||
*/
|
||||
* Wrap up
|
||||
*/
|
||||
%if &mdebug ne 1 %then %do;
|
||||
filename &frefin clear;
|
||||
filename &frefout clear;
|
||||
|
||||
@@ -72,10 +72,10 @@
|
||||
foundation repo then select a different one here
|
||||
|
||||
@returns outds dataset containing the following columns:
|
||||
- stpuri
|
||||
- prompturi
|
||||
- fileuri
|
||||
- texturi
|
||||
- stpuri
|
||||
- prompturi
|
||||
- fileuri
|
||||
- texturi
|
||||
|
||||
@version 9.2
|
||||
@author Allan Bowe
|
||||
@@ -83,7 +83,7 @@
|
||||
**/
|
||||
|
||||
%macro mm_createstp(
|
||||
stpname=Macro People STP
|
||||
stpname=Macro People STP
|
||||
,stpdesc=This stp was created automatically by the mm_createstp macro
|
||||
,filename=mm_createstp.sas
|
||||
,directory=SASEnvironment/SASCode
|
||||
@@ -109,8 +109,8 @@
|
||||
%mp_dropmembers(%scan(&outds,2,.))
|
||||
|
||||
/**
|
||||
* check tree exists
|
||||
*/
|
||||
* check tree exists
|
||||
*/
|
||||
data _null_;
|
||||
length type uri $256;
|
||||
rc=metadata_pathobj("","&tree","Folder",type,uri);
|
||||
@@ -123,8 +123,8 @@ run;
|
||||
%end;
|
||||
|
||||
/**
|
||||
* Check STP does not exist already
|
||||
*/
|
||||
* Check STP does not exist already
|
||||
*/
|
||||
%local cmtype;
|
||||
data _null_;
|
||||
length type uri $256;
|
||||
@@ -138,8 +138,8 @@ run;
|
||||
%end;
|
||||
|
||||
/**
|
||||
* Check that the physical file exists
|
||||
*/
|
||||
* Check that the physical file exists
|
||||
*/
|
||||
%if %sysfunc(fileexist(&directory/&filename)) ne 1 %then %do;
|
||||
%put WARNING: FILE *&directory/&filename* NOT FOUND!;
|
||||
%return;
|
||||
@@ -210,7 +210,8 @@ run;
|
||||
rc3=METADATA_SETATTR(prompturi, 'GroupType','2');
|
||||
rc4=METADATA_SETATTR(prompturi, 'Name','Parameters');
|
||||
rc5=METADATA_SETATTR(prompturi, 'PublicType','Embedded:PromptGroup');
|
||||
GroupInfo="<PromptGroup promptId='PromptGroup_%sysfunc(datetime())_&sysprocessid'"
|
||||
GroupInfo=
|
||||
"<PromptGroup promptId='PromptGroup_%sysfunc(datetime())_&sysprocessid'"
|
||||
!!" version='1.0'><Label><Text xml:lang='en-GB'>Parameters</Text>"
|
||||
!!"</Label></PromptGroup>";
|
||||
rc6 = METADATA_SETATTR(prompturi, 'GroupInfo',groupinfo);
|
||||
@@ -315,8 +316,8 @@ run;
|
||||
%end;
|
||||
|
||||
/**
|
||||
* First, create a Hello World type 2 stored process
|
||||
*/
|
||||
* First, create a Hello World type 2 stored process
|
||||
*/
|
||||
filename &frefin temp;
|
||||
data _null_;
|
||||
file &frefin;
|
||||
@@ -371,8 +372,8 @@ run;
|
||||
%end;
|
||||
|
||||
/**
|
||||
* Next, add the source code
|
||||
*/
|
||||
* Next, add the source code
|
||||
*/
|
||||
%mm_updatestpsourcecode(stp=&tree/&stpname
|
||||
,stpcode="&directory/&filename"
|
||||
,frefin=&frefin.
|
||||
|
||||
@@ -22,7 +22,7 @@ Usage:
|
||||
%webout(OBJ,example2) * Object format, easier to work with ;
|
||||
%webout(CLOSE)
|
||||
;;;;
|
||||
%mm_createwebservice(path=/Public/app/common,name=appInit,code=ft15f001,replace=YES)
|
||||
%mm_createwebservice(path=/Public/app/common,name=appInit)
|
||||
|
||||
<h4> SAS Macros </h4>
|
||||
@li mm_createstp.sas
|
||||
@@ -76,10 +76,10 @@ Usage:
|
||||
%let path=%substr(&path,1,%length(&path)-1);
|
||||
|
||||
/**
|
||||
* Add webout macro
|
||||
* These put statements are auto generated - to change the macro, change the
|
||||
* source (mm_webout) and run `build.py`
|
||||
*/
|
||||
* Add webout macro
|
||||
* These put statements are auto generated - to change the macro, change the
|
||||
* source (mm_webout) and run `build.py`
|
||||
*/
|
||||
filename sasjs temp;
|
||||
data _null_;
|
||||
file sasjs lrecl=3000 ;
|
||||
@@ -119,7 +119,8 @@ data _null_;
|
||||
put ' %end; ';
|
||||
put ' data _null_;file &jref mod ; ';
|
||||
put ' put "["; call symputx(''cols'',0,''l''); ';
|
||||
put ' proc sort data=sashelp.vcolumn(where=(libname=''WORK'' & memname="%upcase(&ds)")) ';
|
||||
put ' proc sort ';
|
||||
put ' data=sashelp.vcolumn(where=(libname=''WORK'' & memname="%upcase(&ds)")) ';
|
||||
put ' out=_data_; ';
|
||||
put ' by varnum; ';
|
||||
put ' ';
|
||||
@@ -158,7 +159,8 @@ data _null_;
|
||||
put ' %end; ';
|
||||
put ' %end; ';
|
||||
put ' run; ';
|
||||
put ' /* write to temp loc to avoid _webout truncation - https://support.sas.com/kb/49/325.html */ ';
|
||||
put ' /* write to temp loc to avoid _webout truncation ';
|
||||
put ' - https://support.sas.com/kb/49/325.html */ ';
|
||||
put ' filename _sjs temp lrecl=131068 encoding=''utf-8''; ';
|
||||
put ' data _null_; file _sjs lrecl=131068 encoding=''utf-8'' mod; ';
|
||||
put ' set &tempds; ';
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
**/
|
||||
|
||||
%macro mm_deletedocument(
|
||||
target=
|
||||
target=
|
||||
)/*/STORE SOURCE*/;
|
||||
|
||||
/**
|
||||
* Check document exist
|
||||
*/
|
||||
* Check document exist
|
||||
*/
|
||||
%local type;
|
||||
data _null_;
|
||||
length type uri $256;
|
||||
@@ -39,10 +39,10 @@ run;
|
||||
filename __in temp lrecl=10000;
|
||||
filename __out temp lrecl=10000;
|
||||
data _null_ ;
|
||||
file __in ;
|
||||
put "<DeleteMetadata><Metadata><Document Id='&stpuri'/>";
|
||||
put "</Metadata><NS>SAS</NS><Flags>268436480</Flags><Options/>";
|
||||
put "</DeleteMetadata>";
|
||||
file __in ;
|
||||
put "<DeleteMetadata><Metadata><Document Id='&stpuri'/>";
|
||||
put "</Metadata><NS>SAS</NS><Flags>268436480</Flags><Options/>";
|
||||
put "</DeleteMetadata>";
|
||||
run ;
|
||||
proc metadata in=__in out=__out verbose;run;
|
||||
|
||||
@@ -53,8 +53,8 @@ filename __in clear;
|
||||
filename __out clear;
|
||||
|
||||
/**
|
||||
* Check deletion
|
||||
*/
|
||||
* Check deletion
|
||||
*/
|
||||
%local isgone;
|
||||
data _null_;
|
||||
length type uri $256;
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
**/
|
||||
|
||||
%macro mm_deletestp(
|
||||
target=
|
||||
target=
|
||||
)/*/STORE SOURCE*/;
|
||||
|
||||
/**
|
||||
* Check STP does exist
|
||||
*/
|
||||
* Check STP does exist
|
||||
*/
|
||||
%local cmtype;
|
||||
data _null_;
|
||||
length type uri $256;
|
||||
@@ -38,10 +38,10 @@ run;
|
||||
filename __in temp lrecl=10000;
|
||||
filename __out temp lrecl=10000;
|
||||
data _null_ ;
|
||||
file __in ;
|
||||
put "<DeleteMetadata><Metadata><ClassifierMap Id='&stpuri'/>";
|
||||
put "</Metadata><NS>SAS</NS><Flags>268436480</Flags><Options/>";
|
||||
put "</DeleteMetadata>";
|
||||
file __in ;
|
||||
put "<DeleteMetadata><Metadata><ClassifierMap Id='&stpuri'/>";
|
||||
put "</Metadata><NS>SAS</NS><Flags>268436480</Flags><Options/>";
|
||||
put "</DeleteMetadata>";
|
||||
run ;
|
||||
proc metadata in=__in out=__out verbose;run;
|
||||
|
||||
@@ -52,8 +52,8 @@ filename __in clear;
|
||||
filename __out clear;
|
||||
|
||||
/**
|
||||
* Check deletion
|
||||
*/
|
||||
* Check deletion
|
||||
*/
|
||||
%local isgone;
|
||||
data _null_;
|
||||
length type uri $256;
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
)/*/STORE SOURCE*/;
|
||||
|
||||
%if %length(&outds)>30 %then %do;
|
||||
%put %str(ERR)OR: Temp tables are created with the &outds prefix, which therefore
|
||||
needs to be 30 characters or less;
|
||||
%put %str(ERR)OR: Temp tables are created with the &outds prefix, which
|
||||
therefore needs to be 30 characters or less;
|
||||
%return;
|
||||
%end;
|
||||
%if %index(&outds,'.')>0 %then %do;
|
||||
@@ -58,11 +58,11 @@ data _null_;
|
||||
put str;
|
||||
if last then do;
|
||||
/* collate attributes */
|
||||
str=cats("data &outds._logat; set &outds.da1-&outds.da",_n_,";run;");
|
||||
put str;
|
||||
str=cats("data &outds._logat; set &outds.da1-&outds.da",_n_,";run;");
|
||||
put str;
|
||||
/* collate associations */
|
||||
str=cats("data &outds._logas; set &outds.a1-&outds.a",_n_,";run;");
|
||||
put str;
|
||||
str=cats("data &outds._logas; set &outds.a1-&outds.a",_n_,";run;");
|
||||
put str;
|
||||
/* tidy up */
|
||||
str=cats("proc delete data=&outds.da1-&outds.da",_n_,";run;");
|
||||
put str;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
**/
|
||||
|
||||
%macro mm_getcols(
|
||||
tableuri=
|
||||
tableuri=
|
||||
,outds=work.mm_getcols
|
||||
)/*/STORE SOURCE*/;
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
@param mDebug= set to 1 to show debug messages in the log
|
||||
|
||||
@returns outds dataset containing the following columns:
|
||||
- directoryuri
|
||||
- groupname
|
||||
- groupdesc
|
||||
- directoryuri
|
||||
- groupname
|
||||
- groupdesc
|
||||
|
||||
@version 9.2
|
||||
@author Allan Bowe
|
||||
@@ -20,7 +20,7 @@
|
||||
**/
|
||||
|
||||
%macro mm_getDirectories(
|
||||
path=
|
||||
path=
|
||||
,outds=work.mm_getDirectories
|
||||
,mDebug=0
|
||||
)/*/STORE SOURCE*/;
|
||||
@@ -39,8 +39,10 @@ data &outds (keep=directoryuri name directoryname directorydesc );
|
||||
do while
|
||||
(metadata_getnobj("omsobj:Directory?@Id contains '.'",__i,directoryuri)>0);
|
||||
%end; %else %do;
|
||||
do while
|
||||
(metadata_getnobj("omsobj:Directory?@DirectoryName='&path'",__i,directoryuri)>0);
|
||||
do while(
|
||||
metadata_getnobj("omsobj:Directory?@DirectoryName='&path'",__i,directoryuri)
|
||||
>0
|
||||
);
|
||||
%end;
|
||||
__rc1=metadata_getattr(directoryuri, "Name", name);
|
||||
__rc2=metadata_getattr(directoryuri, "DirectoryName", directoryname);
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
%&mD.put _local_;
|
||||
|
||||
/**
|
||||
* check tree exists
|
||||
*/
|
||||
* check tree exists
|
||||
*/
|
||||
|
||||
data _null_;
|
||||
length type uri $256;
|
||||
@@ -54,8 +54,8 @@ run;
|
||||
)
|
||||
|
||||
/**
|
||||
* Check object exists
|
||||
*/
|
||||
* Check object exists
|
||||
*/
|
||||
data _null_;
|
||||
length type docuri tsuri tsid $256 ;
|
||||
rc1=metadata_pathobj("","&tree/&name","Note",type,docuri);
|
||||
@@ -73,14 +73,14 @@ run;
|
||||
)
|
||||
|
||||
/**
|
||||
* Now we can extract the textstore
|
||||
*/
|
||||
* Now we can extract the textstore
|
||||
*/
|
||||
filename __getdoc temp lrecl=10000000;
|
||||
proc metadata
|
||||
in="<GetMetadata><Reposid>$METAREPOSITORY</Reposid>
|
||||
<Metadata><TextStore Id='&tsid'/></Metadata>
|
||||
<Ns>SAS</Ns><Flags>1</Flags><Options/></GetMetadata>"
|
||||
out=__getdoc ;
|
||||
in="<GetMetadata><Reposid>$METAREPOSITORY</Reposid>
|
||||
<Metadata><TextStore Id='&tsid'/></Metadata>
|
||||
<Ns>SAS</Ns><Flags>1</Flags><Options/></GetMetadata>"
|
||||
out=__getdoc ;
|
||||
run;
|
||||
|
||||
/* find the beginning of the text */
|
||||
@@ -98,47 +98,47 @@ data _null_;
|
||||
/* read the content, byte by byte, resolving escaped chars */
|
||||
filename __outdoc "&outref" lrecl=100000;
|
||||
data _null_;
|
||||
length filein 8 fileid 8;
|
||||
filein = fopen("__getdoc","I",1,"B");
|
||||
fileid = fopen("__outdoc","O",1,"B");
|
||||
rec = "20"x;
|
||||
length entity $6;
|
||||
do while(fread(filein)=0);
|
||||
x+1;
|
||||
if x>&start then do;
|
||||
rc = fget(filein,rec,1);
|
||||
if rec='"' then leave;
|
||||
else if rec="&" then do;
|
||||
entity=rec;
|
||||
do until (rec=";");
|
||||
if fread(filein) ne 0 then goto getout;
|
||||
rc = fget(filein,rec,1);
|
||||
entity=cats(entity,rec);
|
||||
length filein 8 fileid 8;
|
||||
filein = fopen("__getdoc","I",1,"B");
|
||||
fileid = fopen("__outdoc","O",1,"B");
|
||||
rec = "20"x;
|
||||
length entity $6;
|
||||
do while(fread(filein)=0);
|
||||
x+1;
|
||||
if x>&start then do;
|
||||
rc = fget(filein,rec,1);
|
||||
if rec='"' then leave;
|
||||
else if rec="&" then do;
|
||||
entity=rec;
|
||||
do until (rec=";");
|
||||
if fread(filein) ne 0 then goto getout;
|
||||
rc = fget(filein,rec,1);
|
||||
entity=cats(entity,rec);
|
||||
end;
|
||||
select (entity);
|
||||
when ('&' ) rec='&' ;
|
||||
when ('<' ) rec='<' ;
|
||||
when ('>' ) rec='>' ;
|
||||
when (''') rec="'" ;
|
||||
when ('"') rec='"' ;
|
||||
when ('
') rec='0A'x;
|
||||
when ('
') rec='0D'x;
|
||||
when ('$' ) rec='$' ;
|
||||
when ('	') rec='09'x;
|
||||
otherwise putlog "WARNING: missing value for " entity=;
|
||||
end;
|
||||
rc =fput(fileid, substr(rec,1,1));
|
||||
rc =fwrite(fileid);
|
||||
end;
|
||||
select (entity);
|
||||
when ('&' ) rec='&' ;
|
||||
when ('<' ) rec='<' ;
|
||||
when ('>' ) rec='>' ;
|
||||
when (''') rec="'" ;
|
||||
when ('"') rec='"' ;
|
||||
when ('
') rec='0A'x;
|
||||
when ('
') rec='0D'x;
|
||||
when ('$' ) rec='$' ;
|
||||
when ('	') rec='09'x;
|
||||
otherwise putlog "WARNING: missing value for " entity=;
|
||||
else do;
|
||||
rc =fput(fileid,rec);
|
||||
rc =fwrite(fileid);
|
||||
end;
|
||||
rc =fput(fileid, substr(rec,1,1));
|
||||
rc =fwrite(fileid);
|
||||
end;
|
||||
else do;
|
||||
rc =fput(fileid,rec);
|
||||
rc =fwrite(fileid);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
getout:
|
||||
rc=fclose(filein);
|
||||
rc=fclose(fileid);
|
||||
end;
|
||||
getout:
|
||||
rc=fclose(filein);
|
||||
rc=fclose(fileid);
|
||||
run;
|
||||
filename __getdoc clear;
|
||||
filename __outdoc clear;
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
%mm_getfoldermembers(root=/User Folders/&sysuserid, outds=usercontent)
|
||||
|
||||
@param [in] root= the parent folder under which to return all contents
|
||||
@param [out] outds= the dataset to create that contains the list of directories
|
||||
@param [out] outds= the dataset to create that contains the list of
|
||||
directories
|
||||
@param [in] mDebug= set to 1 to show debug messages in the log
|
||||
|
||||
<h4> Data Outputs </h4>
|
||||
@@ -20,11 +21,11 @@
|
||||
|
||||
|metauri $17|metaname $256|metatype $32|
|
||||
|---|---|---|
|
||||
|A5XLSNXI.AA000001|Products |Folder|
|
||||
|A5XLSNXI.AA000002|Shared Data |Folder|
|
||||
|A5XLSNXI.AA000003|User Folders |Folder|
|
||||
|A5XLSNXI.AA000004|System |Folder|
|
||||
|A5XLSNXI.AA00003K|30.SASApps |Folder|
|
||||
|A5XLSNXI.AA000001|Products |Folder|
|
||||
|A5XLSNXI.AA000002|Shared Data |Folder|
|
||||
|A5XLSNXI.AA000003|User Folders |Folder|
|
||||
|A5XLSNXI.AA000004|System |Folder|
|
||||
|A5XLSNXI.AA00003K|30.SASApps |Folder|
|
||||
|A5XLSNXI.AA00006A|Public|Folder|
|
||||
|
||||
<h4> SAS Macros </h4>
|
||||
@@ -37,7 +38,7 @@
|
||||
|
||||
**/
|
||||
%macro mm_getfoldermembers(
|
||||
root=
|
||||
root=
|
||||
,outds=work.mm_getfoldertree
|
||||
)/*/STORE SOURCE*/;
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
options notes source;
|
||||
|
||||
@param [in] root= the parent folder under which to return all contents
|
||||
@param [out] outds= the dataset to create that contains the list of directories
|
||||
@param [out] outds= the dataset to create that contains the list of
|
||||
directories
|
||||
@param [in] mDebug= set to 1 to show debug messages in the log
|
||||
|
||||
<h4> SAS Macros </h4>
|
||||
@@ -23,7 +24,7 @@
|
||||
|
||||
**/
|
||||
%macro mm_getfoldertree(
|
||||
root=
|
||||
root=
|
||||
,outds=work.mm_getfoldertree
|
||||
,mDebug=0
|
||||
,depth=50 /* how many nested folders to query */
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
@file
|
||||
@brief Creates dataset with all members of a metadata group
|
||||
@details
|
||||
|
||||
|
||||
usage:
|
||||
|
||||
|
||||
%mm_getgroupmembers(someGroupName
|
||||
,outds=work.mm_getgroupmembers
|
||||
,outds=work.mm_getgroupmembers
|
||||
,emails=YES)
|
||||
|
||||
@param group metadata group for which to bring back members
|
||||
|
||||
@@ -11,14 +11,15 @@
|
||||
|
||||
@param [in] user= the metadata user to return groups for. Leave blank for all
|
||||
groups.
|
||||
@param [in] repo= the metadata repository that contains the user/group information
|
||||
@param [in] repo= the metadata repository that contains the user/group
|
||||
information
|
||||
@param [in] mDebug= set to 1 to show debug messages in the log
|
||||
@param [out] outds= the dataset to create that contains the list of groups
|
||||
|
||||
@returns outds dataset containing all groups in a column named "metagroup"
|
||||
- groupuri
|
||||
- groupname
|
||||
- groupdesc
|
||||
- groupuri
|
||||
- groupname
|
||||
- groupdesc
|
||||
|
||||
@version 9.2
|
||||
@author Allan Bowe
|
||||
@@ -26,7 +27,7 @@
|
||||
**/
|
||||
|
||||
%macro mm_getGroups(
|
||||
user=
|
||||
user=
|
||||
,outds=work.mm_getGroups
|
||||
,repo=foundation
|
||||
,mDebug=0
|
||||
@@ -39,7 +40,8 @@
|
||||
%&mD.put Executing mm_getGroups.sas;
|
||||
%&mD.put _local_;
|
||||
|
||||
/* on some sites, user / group info is in a different metadata repo to the default */
|
||||
/* on some sites, user / group info is in a different metadata repo to the
|
||||
default */
|
||||
%if &oldrepo ne &repo %then %do;
|
||||
options metarepository=&repo;
|
||||
%end;
|
||||
|
||||
@@ -46,7 +46,7 @@ run;
|
||||
filename response temp;
|
||||
/* get list of libraries */
|
||||
proc metadata in=
|
||||
'<GetMetadataObjects>
|
||||
'<GetMetadataObjects>
|
||||
<Reposid>$METAREPOSITORY</Reposid>
|
||||
<Type>SASLibrary</Type>
|
||||
<Objects/>
|
||||
|
||||
@@ -28,10 +28,10 @@
|
||||
filename response temp;
|
||||
/* get list of libraries */
|
||||
proc metadata in=
|
||||
"<GetMetadataObjects><Reposid>$METAREPOSITORY</Reposid>
|
||||
<Type>&type</Type><Objects/><NS>SAS</NS>
|
||||
<Flags>0</Flags><Options/></GetMetadataObjects>"
|
||||
out=response;
|
||||
"<GetMetadataObjects><Reposid>$METAREPOSITORY</Reposid>
|
||||
<Type>&type</Type><Objects/><NS>SAS</NS>
|
||||
<Flags>0</Flags><Options/></GetMetadataObjects>"
|
||||
out=response;
|
||||
run;
|
||||
|
||||
/* write the response to the log for debugging */
|
||||
@@ -46,7 +46,8 @@ filename sxlemap temp;
|
||||
data _null_;
|
||||
file sxlemap;
|
||||
put '<SXLEMAP version="1.2" name="SASObjects"><TABLE name="SASObjects">';
|
||||
put "<TABLE-PATH syntax='XPath'>/GetMetadataObjects/Objects/&type</TABLE-PATH>";
|
||||
put "<TABLE-PATH syntax='XPath'>/GetMetadataObjects/Objects/&type";
|
||||
put "</TABLE-PATH>";
|
||||
put '<COLUMN name="id">';
|
||||
put "<PATH syntax='XPath'>/GetMetadataObjects/Objects/&type/@Id</PATH>";
|
||||
put "<TYPE>character</TYPE><DATATYPE>string</DATATYPE><LENGTH>200</LENGTH>";
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/**
|
||||
@file mm_getpublictypes.sas
|
||||
@brief Creates a dataset with all deployable public types
|
||||
@details More info: https://support.sas.com/documentation/cdl/en/bisag/65422/HTML/default/viewer.htm#n1nkrdzsq5iunln18bk2236istkb.htm
|
||||
|
||||
@details More info:
|
||||
https://support.sas.com/documentation/cdl/en/bisag/65422/HTML/default/viewer.htm#n1nkrdzsq5iunln18bk2236istkb.htm
|
||||
|
||||
Usage:
|
||||
|
||||
* dataset will contain one column - publictype ($64);
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
filename response temp;
|
||||
/* get list of libraries */
|
||||
proc metadata in=
|
||||
"<GetRepositories><Repositories/><Flags>1</Flags><Options/></GetRepositories>"
|
||||
out=response;
|
||||
"<GetRepositories><Repositories/><Flags>1</Flags><Options/></GetRepositories>"
|
||||
out=response;
|
||||
run;
|
||||
|
||||
/* write the response to the log for debugging */
|
||||
@@ -44,61 +44,76 @@ filename sxlemap temp;
|
||||
data _null_;
|
||||
file sxlemap;
|
||||
put '<SXLEMAP version="1.2" name="SASRepos"><TABLE name="SASRepos">';
|
||||
put "<TABLE-PATH syntax='XPath'>/GetRepositories/Repositories/Repository</TABLE-PATH>";
|
||||
put "<TABLE-PATH syntax='XPath'>/GetRepositories/Repositories/Repository";
|
||||
put "</TABLE-PATH>";
|
||||
put '<COLUMN name="id">';
|
||||
put "<PATH syntax='XPath'>/GetRepositories/Repositories/Repository/@Id</PATH>";
|
||||
put "<PATH syntax='XPath'>/GetRepositories/Repositories/Repository/@Id";
|
||||
put "</PATH>";
|
||||
put "<TYPE>character</TYPE><DATATYPE>string</DATATYPE><LENGTH>200</LENGTH>";
|
||||
put '</COLUMN>';
|
||||
put '<COLUMN name="name">';
|
||||
put "<PATH syntax='XPath'>/GetRepositories/Repositories/Repository/@Name</PATH>";
|
||||
put "<PATH syntax='XPath'>/GetRepositories/Repositories/Repository/@Name";
|
||||
put "</PATH>";
|
||||
put "<TYPE>character</TYPE><DATATYPE>string</DATATYPE><LENGTH>200</LENGTH>";
|
||||
put '</COLUMN>';
|
||||
put '<COLUMN name="desc">';
|
||||
put "<PATH syntax='XPath'>/GetRepositories/Repositories/Repository/@Desc</PATH>";
|
||||
put "<PATH syntax='XPath'>/GetRepositories/Repositories/Repository/@Desc";
|
||||
put "</PATH>";
|
||||
put "<TYPE>character</TYPE><DATATYPE>string</DATATYPE><LENGTH>200</LENGTH>";
|
||||
put '</COLUMN>';
|
||||
put '<COLUMN name="DefaultNS">';
|
||||
put "<PATH syntax='XPath'>/GetRepositories/Repositories/Repository/@DefaultNS</PATH>";
|
||||
put "<PATH syntax='XPath'>";
|
||||
put "/GetRepositories/Repositories/Repository/@DefaultNS</PATH>";
|
||||
put "<TYPE>character</TYPE><DATATYPE>string</DATATYPE><LENGTH>200</LENGTH>";
|
||||
put '</COLUMN>';
|
||||
put '<COLUMN name="RepositoryType">';
|
||||
put "<PATH syntax='XPath'>/GetRepositories/Repositories/Repository/@RepositoryType</PATH>";
|
||||
put "<PATH syntax='XPath'>";
|
||||
put "/GetRepositories/Repositories/Repository/@RepositoryType</PATH>";
|
||||
put "<TYPE>character</TYPE><DATATYPE>string</DATATYPE><LENGTH>20</LENGTH>";
|
||||
put '</COLUMN>';
|
||||
put '<COLUMN name="RepositoryFormat">';
|
||||
put "<PATH syntax='XPath'>/GetRepositories/Repositories/Repository/@RepositoryFormat</PATH>";
|
||||
put "<PATH syntax='XPath'>";
|
||||
put "/GetRepositories/Repositories/Repository/@RepositoryFormat</PATH>";
|
||||
put "<TYPE>character</TYPE><DATATYPE>string</DATATYPE><LENGTH>10</LENGTH>";
|
||||
put '</COLUMN>';
|
||||
put '<COLUMN name="Access">';
|
||||
put "<PATH syntax='XPath'>/GetRepositories/Repositories/Repository/@Access</PATH>";
|
||||
put "<PATH syntax='XPath'>";
|
||||
put "/GetRepositories/Repositories/Repository/@Access</PATH>";
|
||||
put "<TYPE>character</TYPE><DATATYPE>string</DATATYPE><LENGTH>16</LENGTH>";
|
||||
put '</COLUMN>';
|
||||
put '<COLUMN name="CurrentAccess">';
|
||||
put "<PATH syntax='XPath'>/GetRepositories/Repositories/Repository/@CurrentAccess</PATH>";
|
||||
put "<PATH syntax='XPath'>";
|
||||
put "/GetRepositories/Repositories/Repository/@CurrentAccess</PATH>";
|
||||
put "<TYPE>character</TYPE><DATATYPE>string</DATATYPE><LENGTH>16</LENGTH>";
|
||||
put '</COLUMN>';
|
||||
put '<COLUMN name="PauseState">';
|
||||
put "<PATH syntax='XPath'>/GetRepositories/Repositories/Repository/@PauseState</PATH>";
|
||||
put "<PATH syntax='XPath'>";
|
||||
put "/GetRepositories/Repositories/Repository/@PauseState</PATH>";
|
||||
put "<TYPE>character</TYPE><DATATYPE>string</DATATYPE><LENGTH>16</LENGTH>";
|
||||
put '</COLUMN>';
|
||||
put '<COLUMN name="Path">';
|
||||
put "<PATH syntax='XPath'>/GetRepositories/Repositories/Repository/@Path</PATH>";
|
||||
put "<PATH syntax='XPath'>/GetRepositories/Repositories/Repository/@Path";
|
||||
put "</PATH>";
|
||||
put "<TYPE>character</TYPE><DATATYPE>string</DATATYPE><LENGTH>256</LENGTH>";
|
||||
put '</COLUMN>';
|
||||
put '<COLUMN name="Engine">';
|
||||
put "<PATH syntax='XPath'>/GetRepositories/Repositories/Repository/@Engine</PATH>";
|
||||
put "<PATH syntax='XPath'>/GetRepositories/Repositories/Repository/@Engine";
|
||||
put "</PATH>";
|
||||
put "<TYPE>character</TYPE><DATATYPE>string</DATATYPE><LENGTH>8</LENGTH>";
|
||||
put '</COLUMN>';
|
||||
put '<COLUMN name="Options">';
|
||||
put "<PATH syntax='XPath'>/GetRepositories/Repositories/Repository/@Options</PATH>";
|
||||
put "<PATH syntax='XPath'>/GetRepositories/Repositories/Repository/@Options";
|
||||
put "</PATH>";
|
||||
put "<TYPE>character</TYPE><DATATYPE>string</DATATYPE><LENGTH>32</LENGTH>";
|
||||
put '</COLUMN>';
|
||||
put '<COLUMN name="MetadataCreated">';
|
||||
put "<PATH syntax='XPath'>/GetRepositories/Repositories/Repository/@MetadataCreated</PATH>";
|
||||
put "<PATH syntax='XPath'>";
|
||||
put "/GetRepositories/Repositories/Repository/@MetadataCreated</PATH>";
|
||||
put "<TYPE>character</TYPE><DATATYPE>string</DATATYPE><LENGTH>24</LENGTH>";
|
||||
put '</COLUMN>';
|
||||
put '<COLUMN name="MetadataUpdated">';
|
||||
put "<PATH syntax='XPath'>/GetRepositories/Repositories/Repository/@MetadataUpdated</PATH>";
|
||||
put "<PATH syntax='XPath'>";
|
||||
put "/GetRepositories/Repositories/Repository/@MetadataUpdated</PATH>";
|
||||
put "<TYPE>character</TYPE><DATATYPE>string</DATATYPE><LENGTH>24</LENGTH>";
|
||||
put '</COLUMN>';
|
||||
put '</TABLE></SXLEMAP>';
|
||||
|
||||
@@ -31,28 +31,32 @@
|
||||
filename response temp;
|
||||
options noquotelenmax;
|
||||
proc metadata in= '<GetMetadataObjects><Reposid>$METAREPOSITORY</Reposid>
|
||||
<Type>IdentityGroup</Type><NS>SAS</NS><Flags>388</Flags>
|
||||
<Options>
|
||||
<Templates><IdentityGroup Name="" Desc="" PublicType=""/></Templates>
|
||||
<XMLSelect search="@PublicType=''Role''"/>
|
||||
</Options>
|
||||
</GetMetadataObjects>'
|
||||
out=response;
|
||||
<Type>IdentityGroup</Type><NS>SAS</NS><Flags>388</Flags>
|
||||
<Options>
|
||||
<Templates><IdentityGroup Name="" Desc="" PublicType=""/></Templates>
|
||||
<XMLSelect search="@PublicType=''Role''"/>
|
||||
</Options>
|
||||
</GetMetadataObjects>'
|
||||
out=response;
|
||||
run;
|
||||
|
||||
filename sxlemap temp;
|
||||
data _null_;
|
||||
file sxlemap;
|
||||
put '<SXLEMAP version="1.2" name="roles"><TABLE name="roles">';
|
||||
put "<TABLE-PATH syntax='XPath'>/GetMetadataObjects/Objects/IdentityGroup</TABLE-PATH>";
|
||||
put "<TABLE-PATH syntax='XPath'>/GetMetadataObjects/Objects/IdentityGroup";
|
||||
put "</TABLE-PATH>";
|
||||
put '<COLUMN name="roleuri">';
|
||||
put "<PATH syntax='XPath'>/GetMetadataObjects/Objects/IdentityGroup/@Id</PATH>";
|
||||
put "<PATH syntax='XPath'>/GetMetadataObjects/Objects/IdentityGroup/@Id";
|
||||
put "</PATH>";
|
||||
put "<TYPE>character</TYPE><DATATYPE>string</DATATYPE><LENGTH>32</LENGTH>";
|
||||
put '</COLUMN><COLUMN name="rolename">';
|
||||
put "<PATH syntax='XPath'>/GetMetadataObjects/Objects/IdentityGroup/@Name</PATH>";
|
||||
put "<PATH syntax='XPath'>/GetMetadataObjects/Objects/IdentityGroup/@Name";
|
||||
put "</PATH>";
|
||||
put "<TYPE>character</TYPE><DATATYPE>string</DATATYPE><LENGTH>256</LENGTH>";
|
||||
put '</COLUMN><COLUMN name="roledesc">';
|
||||
put "<PATH syntax='XPath'>/GetMetadataObjects/Objects/IdentityGroup/@Desc</PATH>";
|
||||
put "<PATH syntax='XPath'>/GetMetadataObjects/Objects/IdentityGroup/@Desc";
|
||||
put "</PATH>";
|
||||
put "<TYPE>character</TYPE><DATATYPE>string</DATATYPE><LENGTH>500</LENGTH>";
|
||||
put '</COLUMN></TABLE></SXLEMAP>';
|
||||
run;
|
||||
|
||||
@@ -69,14 +69,14 @@ run;
|
||||
|
||||
|
||||
/**
|
||||
* Now we can extract the textstore
|
||||
*/
|
||||
* Now we can extract the textstore
|
||||
*/
|
||||
filename __getdoc temp lrecl=10000000;
|
||||
proc metadata
|
||||
in="<GetMetadata><Reposid>$METAREPOSITORY</Reposid>
|
||||
<Metadata><TextStore Id='&tsuri'/></Metadata>
|
||||
<Ns>SAS</Ns><Flags>1</Flags><Options/></GetMetadata>"
|
||||
out=__getdoc ;
|
||||
in="<GetMetadata><Reposid>$METAREPOSITORY</Reposid>
|
||||
<Metadata><TextStore Id='&tsuri'/></Metadata>
|
||||
<Ns>SAS</Ns><Flags>1</Flags><Options/></GetMetadata>"
|
||||
out=__getdoc ;
|
||||
run;
|
||||
|
||||
/* find the beginning of the text */
|
||||
@@ -97,47 +97,47 @@ data _null_;
|
||||
/* read the content, byte by byte, resolving escaped chars */
|
||||
filename __outdoc &outeng lrecl=100000;
|
||||
data _null_;
|
||||
length filein 8 fileid 8;
|
||||
filein = fopen("__getdoc","I",1,"B");
|
||||
fileid = fopen("__outdoc","O",1,"B");
|
||||
rec = "20"x;
|
||||
length entity $6;
|
||||
do while(fread(filein)=0);
|
||||
x+1;
|
||||
if x>&start then do;
|
||||
rc = fget(filein,rec,1);
|
||||
if rec='"' then leave;
|
||||
else if rec="&" then do;
|
||||
entity=rec;
|
||||
do until (rec=";");
|
||||
if fread(filein) ne 0 then goto getout;
|
||||
rc = fget(filein,rec,1);
|
||||
entity=cats(entity,rec);
|
||||
length filein 8 fileid 8;
|
||||
filein = fopen("__getdoc","I",1,"B");
|
||||
fileid = fopen("__outdoc","O",1,"B");
|
||||
rec = "20"x;
|
||||
length entity $6;
|
||||
do while(fread(filein)=0);
|
||||
x+1;
|
||||
if x>&start then do;
|
||||
rc = fget(filein,rec,1);
|
||||
if rec='"' then leave;
|
||||
else if rec="&" then do;
|
||||
entity=rec;
|
||||
do until (rec=";");
|
||||
if fread(filein) ne 0 then goto getout;
|
||||
rc = fget(filein,rec,1);
|
||||
entity=cats(entity,rec);
|
||||
end;
|
||||
select (entity);
|
||||
when ('&' ) rec='&' ;
|
||||
when ('<' ) rec='<' ;
|
||||
when ('>' ) rec='>' ;
|
||||
when (''') rec="'" ;
|
||||
when ('"') rec='"' ;
|
||||
when ('
') rec='0A'x;
|
||||
when ('
') rec='0D'x;
|
||||
when ('$' ) rec='$' ;
|
||||
when ('	') rec='09'x;
|
||||
otherwise putlog "%str(WARN)ING: missing value for " entity=;
|
||||
end;
|
||||
rc =fput(fileid, substr(rec,1,1));
|
||||
rc =fwrite(fileid);
|
||||
end;
|
||||
select (entity);
|
||||
when ('&' ) rec='&' ;
|
||||
when ('<' ) rec='<' ;
|
||||
when ('>' ) rec='>' ;
|
||||
when (''') rec="'" ;
|
||||
when ('"') rec='"' ;
|
||||
when ('
') rec='0A'x;
|
||||
when ('
') rec='0D'x;
|
||||
when ('$' ) rec='$' ;
|
||||
when ('	') rec='09'x;
|
||||
otherwise putlog "%str(WARN)ING: missing value for " entity=;
|
||||
else do;
|
||||
rc =fput(fileid,rec);
|
||||
rc =fwrite(fileid);
|
||||
end;
|
||||
rc =fput(fileid, substr(rec,1,1));
|
||||
rc =fwrite(fileid);
|
||||
end;
|
||||
else do;
|
||||
rc =fput(fileid,rec);
|
||||
rc =fwrite(fileid);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
getout:
|
||||
rc=fclose(filein);
|
||||
rc=fclose(fileid);
|
||||
end;
|
||||
getout:
|
||||
rc=fclose(filein);
|
||||
rc=fclose(fileid);
|
||||
run;
|
||||
|
||||
%if &outeng=TEMP %then %do;
|
||||
|
||||
@@ -23,16 +23,17 @@
|
||||
combine with the <code>tree=</code> parameter.
|
||||
@param outds= the dataset to create that contains the list of stps.
|
||||
@param mDebug= set to 1 to show debug messages in the log
|
||||
@param showDesc= provide a non blank value to return stored process descriptions
|
||||
@param showUsageVersion= provide a non blank value to return the UsageVersion. This
|
||||
is either 1000000 (type 1, 9.2) or 2000000 (type2, 9.3 onwards).
|
||||
@param showDesc= provide a non blank value to return stored process
|
||||
descriptions
|
||||
@param showUsageVersion= provide a non blank value to return the UsageVersion.
|
||||
This is either 1000000 (type 1, 9.2) or 2000000 (type2, 9.3 onwards).
|
||||
|
||||
@returns outds dataset containing the following columns
|
||||
- stpuri
|
||||
- stpname
|
||||
- treeuri
|
||||
- stpdesc (if requested)
|
||||
- usageversion (if requested)
|
||||
- stpuri
|
||||
- stpname
|
||||
- treeuri
|
||||
- stpdesc (if requested)
|
||||
- usageversion (if requested)
|
||||
|
||||
@version 9.2
|
||||
@author Allan Bowe
|
||||
@@ -40,7 +41,7 @@
|
||||
**/
|
||||
|
||||
%macro mm_getstps(
|
||||
tree=
|
||||
tree=
|
||||
,name=
|
||||
,outds=work.mm_getstps
|
||||
,mDebug=0
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
@file mm_gettableid.sas
|
||||
@brief Get the metadata id for a particular table
|
||||
@details Provide a libref and table name to return the corresponding metadata id
|
||||
@details Provide a libref and table name to return the corresponding metadata
|
||||
in an output datataset.
|
||||
|
||||
Usage:
|
||||
@@ -22,7 +22,7 @@
|
||||
**/
|
||||
|
||||
%macro mm_gettableid(
|
||||
libref=
|
||||
libref=
|
||||
,ds=
|
||||
,outds=work.mm_gettableid
|
||||
,mDebug=0
|
||||
@@ -52,7 +52,7 @@ data &outds;
|
||||
|
||||
if type='DatabaseSchema' then tmpuri=usingpkguri;
|
||||
else tmpuri=uri;
|
||||
|
||||
|
||||
t=1;
|
||||
do while(metadata_getnasn(tmpuri, "Tables", t, tableuri)>0);
|
||||
t+1;
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
@param mDebug= set to 1 to show debug messages in the log
|
||||
|
||||
@returns outds dataset containing the following columns:
|
||||
- treeuri
|
||||
- treepath
|
||||
- treeuri
|
||||
- treepath
|
||||
|
||||
@version 9.2
|
||||
@author Allan Bowe
|
||||
@@ -25,7 +25,7 @@
|
||||
**/
|
||||
|
||||
%macro mm_getTree(
|
||||
tree=
|
||||
tree=
|
||||
,inds=
|
||||
,outds=work.mm_getTree
|
||||
,mDebug=0
|
||||
|
||||
@@ -26,16 +26,16 @@
|
||||
filename response temp;
|
||||
/* get list of libraries */
|
||||
proc metadata in=
|
||||
'<GetTypes>
|
||||
<Types/>
|
||||
<NS>SAS</NS>
|
||||
<!-- specify the OMI_SUCCINCT flag -->
|
||||
<Flags>2048</Flags>
|
||||
<Options>
|
||||
<!-- include <REPOSID> XML element and a repository identifier -->
|
||||
<Reposid>$METAREPOSITORY</Reposid>
|
||||
</Options>
|
||||
</GetTypes>'
|
||||
'<GetTypes>
|
||||
<Types/>
|
||||
<NS>SAS</NS>
|
||||
<!-- specify the OMI_SUCCINCT flag -->
|
||||
<Flags>2048</Flags>
|
||||
<Options>
|
||||
<!-- include <REPOSID> XML element and a repository identifier -->
|
||||
<Reposid>$METAREPOSITORY</Reposid>
|
||||
</Options>
|
||||
</GetTypes>'
|
||||
out=response;
|
||||
run;
|
||||
|
||||
|
||||
@@ -31,16 +31,16 @@
|
||||
|
||||
filename response temp;
|
||||
proc metadata in= '<GetMetadataObjects>
|
||||
<Reposid>$METAREPOSITORY</Reposid>
|
||||
<Type>Person</Type>
|
||||
<NS>SAS</NS>
|
||||
<Flags>0</Flags>
|
||||
<Options>
|
||||
<Templates>
|
||||
<Person Name=""/>
|
||||
</Templates>
|
||||
</Options>
|
||||
</GetMetadataObjects>'
|
||||
<Reposid>$METAREPOSITORY</Reposid>
|
||||
<Type>Person</Type>
|
||||
<NS>SAS</NS>
|
||||
<Flags>0</Flags>
|
||||
<Options>
|
||||
<Templates>
|
||||
<Person Name=""/>
|
||||
</Templates>
|
||||
</Options>
|
||||
</GetMetadataObjects>'
|
||||
out=response;
|
||||
run;
|
||||
|
||||
@@ -48,7 +48,8 @@ filename sxlemap temp;
|
||||
data _null_;
|
||||
file sxlemap;
|
||||
put '<SXLEMAP version="1.2" name="SASObjects"><TABLE name="SASObjects">';
|
||||
put "<TABLE-PATH syntax='XPath'>/GetMetadataObjects/Objects/Person</TABLE-PATH>";
|
||||
put "<TABLE-PATH syntax='XPath'>/GetMetadataObjects/Objects/Person";
|
||||
put "</TABLE-PATH>";
|
||||
put '<COLUMN name="uri">';
|
||||
put "<PATH syntax='XPath'>/GetMetadataObjects/Objects/Person/@Id</PATH>";
|
||||
put "<TYPE>character</TYPE><DATATYPE>string</DATATYPE><LENGTH>32</LENGTH>";
|
||||
|
||||
@@ -33,23 +33,23 @@ filename __in temp lrecl=10000;
|
||||
filename __out temp lrecl=10000;
|
||||
filename __shake temp lrecl=10000;
|
||||
data _null_ ;
|
||||
file __in ;
|
||||
put '<GetMetadataObjects>' ;
|
||||
put '<Reposid>$METAREPOSITORY</Reposid>' ;
|
||||
put '<Type>TextStore</Type>' ;
|
||||
put '<NS>SAS</NS>' ;
|
||||
put '<Flags>388</Flags>' ;
|
||||
put '<Options>' ;
|
||||
put '<XMLSelect search="TextStore[@Name='@@;
|
||||
put "'Public Configuration Properties']" @@;
|
||||
put '[Objects/SoftwareComponent[@ClassIdentifier=''webappsrv'']]' ;
|
||||
put '"/>';
|
||||
put '<Templates>' ;
|
||||
put '<TextStore StoredText="">' ;
|
||||
put '</TextStore>' ;
|
||||
put '</Templates>' ;
|
||||
put '</Options>' ;
|
||||
put '</GetMetadataObjects>' ;
|
||||
file __in ;
|
||||
put '<GetMetadataObjects>' ;
|
||||
put '<Reposid>$METAREPOSITORY</Reposid>' ;
|
||||
put '<Type>TextStore</Type>' ;
|
||||
put '<NS>SAS</NS>' ;
|
||||
put '<Flags>388</Flags>' ;
|
||||
put '<Options>' ;
|
||||
put '<XMLSelect search="TextStore[@Name='@@;
|
||||
put "'Public Configuration Properties']" @@;
|
||||
put '[Objects/SoftwareComponent[@ClassIdentifier=''webappsrv'']]' ;
|
||||
put '"/>';
|
||||
put '<Templates>' ;
|
||||
put '<TextStore StoredText="">' ;
|
||||
put '</TextStore>' ;
|
||||
put '</Templates>' ;
|
||||
put '</Options>' ;
|
||||
put '</GetMetadataObjects>' ;
|
||||
run ;
|
||||
proc metadata in=__in out=__out verbose;run;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
@file mm_spkexport.sas
|
||||
@brief Creates an batch spk export command
|
||||
@details Creates a script that will export everything in a metadata folder to
|
||||
@details Creates a script that will export everything in a metadata folder to
|
||||
a specified location.
|
||||
If you have XCMD enabled, then you can use mmx_spkexport (which performs
|
||||
the actual export)
|
||||
@@ -12,7 +12,8 @@
|
||||
Usage:
|
||||
|
||||
%* import the macros (or make them available some other way);
|
||||
filename mc url "https://raw.githubusercontent.com/sasjs/core/main/all.sas";
|
||||
filename mc url
|
||||
"https://raw.githubusercontent.com/sasjs/core/main/all.sas";
|
||||
%inc mc;
|
||||
|
||||
%* create sample text file as input to the macro;
|
||||
@@ -34,7 +35,7 @@
|
||||
|
||||
filename myref "/tmp/mmscript.sh";
|
||||
%mm_spkexport(metaloc=%str(/my/meta/loc)
|
||||
outref=myref
|
||||
outref=myref
|
||||
,cmdoutloc=%str(/tmp)
|
||||
,cmdoutname=mmx
|
||||
)
|
||||
@@ -56,9 +57,9 @@
|
||||
@param secureref= fileref containing the username / password (should point to
|
||||
a file in a secure location). Leave blank to substitute $bash type vars.
|
||||
@param outref= fileref to which to write the command
|
||||
@param cmdoutloc= the directory to which the command will write the SPK
|
||||
@param cmdoutloc= the directory to which the command will write the SPK
|
||||
(default=WORK)
|
||||
@param cmdoutname= the name of the spk / log files to create (will be
|
||||
@param cmdoutname= the name of the spk / log files to create (will be
|
||||
identical just with .spk or .log extension)
|
||||
|
||||
@version 9.4
|
||||
@@ -92,7 +93,8 @@
|
||||
%let port=%sysfunc(getoption(metaport));
|
||||
%let platform_object_path=%mf_loc(POF);
|
||||
|
||||
%let connx_string=%str(-host &host -port &port -user &mmxuser -password &mmxpass);
|
||||
%let connx_string=%str(-host &host -port &port -user &mmxuser %trim(
|
||||
)-password &mmxpass);
|
||||
|
||||
%mm_tree(root=%str(&metaloc) ,types=EXPORTABLE ,outds=exportable)
|
||||
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
Usage:
|
||||
|
||||
%* load macros;
|
||||
filename mc url "https://raw.githubusercontent.com/sasjs/core/main/all.sas";
|
||||
filename mc url
|
||||
"https://raw.githubusercontent.com/sasjs/core/main/all.sas";
|
||||
%inc mc;
|
||||
|
||||
%* export everything;
|
||||
@@ -32,16 +33,16 @@
|
||||
|
||||
%* with specific types;
|
||||
%mm_tree(root=%str(/my/folder)
|
||||
,types=
|
||||
DeployedJob
|
||||
ExternalFile
|
||||
Folder
|
||||
Folder.SecuredData
|
||||
GeneratedTransform
|
||||
InformationMap.Relational
|
||||
Job
|
||||
Library
|
||||
Prompt
|
||||
,types=
|
||||
DeployedJob
|
||||
ExternalFile
|
||||
Folder
|
||||
Folder.SecuredData
|
||||
GeneratedTransform
|
||||
InformationMap.Relational
|
||||
Job
|
||||
Library
|
||||
Prompt
|
||||
StoredProcess
|
||||
Table
|
||||
,outds=morestuff)
|
||||
@@ -53,8 +54,8 @@
|
||||
|
||||
@param root= the parent folder under which to return all contents
|
||||
@param outds= the dataset to create that contains the list of directories
|
||||
@param types= Space-seperated, unquoted list of types for filtering the
|
||||
output. Special types:
|
||||
@param types= Space-seperated, unquoted list of types for filtering the
|
||||
output. Special types:
|
||||
|
||||
* ALl - return all types (the default)
|
||||
* EXPORTABLE - return only the content types that can be exported in an SPK
|
||||
@@ -64,7 +65,7 @@
|
||||
|
||||
**/
|
||||
%macro mm_tree(
|
||||
root=
|
||||
root=
|
||||
,types=ALL
|
||||
,outds=work.mm_tree
|
||||
)/*/STORE SOURCE*/;
|
||||
@@ -84,12 +85,12 @@ options noquotelenmax;
|
||||
filename response temp;
|
||||
/* get list of libraries */
|
||||
proc metadata in=
|
||||
'<GetMetadataObjects><Reposid>$METAREPOSITORY</Reposid>
|
||||
<Type>Tree</Type><Objects/><NS>SAS</NS>
|
||||
<Flags>384</Flags>
|
||||
<XMLSelect search="*[@TreeType='BIP Folder']"/>
|
||||
<Options/></GetMetadataObjects>'
|
||||
out=response;
|
||||
'<GetMetadataObjects><Reposid>$METAREPOSITORY</Reposid>
|
||||
<Type>Tree</Type><Objects/><NS>SAS</NS>
|
||||
<Flags>384</Flags>
|
||||
<XMLSelect search="*[@TreeType='BIP Folder']"/>
|
||||
<Options/></GetMetadataObjects>'
|
||||
out=response;
|
||||
run;
|
||||
/*
|
||||
data _null_;
|
||||
@@ -104,7 +105,8 @@ filename sxlemap temp;
|
||||
data _null_;
|
||||
file sxlemap;
|
||||
put '<SXLEMAP version="1.2" name="SASObjects"><TABLE name="SASObjects">';
|
||||
put "<TABLE-PATH syntax='XPath'>/GetMetadataObjects/Objects/Tree</TABLE-PATH>";
|
||||
put "<TABLE-PATH syntax='XPath'>/GetMetadataObjects/Objects/Tree";
|
||||
put "</TABLE-PATH>";
|
||||
put '<COLUMN name="pathuri">';
|
||||
put "<PATH syntax='XPath'>/GetMetadataObjects/Objects/Tree/@Id</PATH>";
|
||||
put "<TYPE>character</TYPE><DATATYPE>string</DATATYPE><LENGTH>64</LENGTH>";
|
||||
@@ -130,7 +132,7 @@ data &outds;
|
||||
path=cats('/',pname,path);
|
||||
tmpuri=parenturi;
|
||||
end;
|
||||
|
||||
|
||||
if path=:"&root";
|
||||
|
||||
%if "&types"="ALL" or ("&types" ne "ALL" and "&types" ne "Folder") %then %do;
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
|
||||
@param target= full path to the STP being deleted
|
||||
@param type= Either WKS or STP depending on whether Workspace or Stored Process
|
||||
type required
|
||||
@param type= Either WKS or STP depending on whether Workspace or
|
||||
Stored Process type required
|
||||
|
||||
@version 9.4
|
||||
@author Allan Bowe
|
||||
@@ -24,8 +24,8 @@
|
||||
)/*/STORE SOURCE*/;
|
||||
|
||||
/**
|
||||
* Check STP does exist
|
||||
*/
|
||||
* Check STP does exist
|
||||
*/
|
||||
%local cmtype;
|
||||
data _null_;
|
||||
length type uri $256;
|
||||
@@ -51,7 +51,8 @@ data _null_;
|
||||
n+1;
|
||||
rc=metadata_getattr(uri,"Name",name);
|
||||
if name='Stored Process' then do;
|
||||
rc = METADATA_SETATTR(uri,'StoredText','<?xml version="1.0" encoding="UTF-8"?>'
|
||||
rc = METADATA_SETATTR(uri,'StoredText'
|
||||
,'<?xml version="1.0" encoding="UTF-8"?>'
|
||||
!!'<StoredProcess><ServerContext LogicalServerType="'!!"&newtype"
|
||||
!!'" OtherAllowed="false"/><ResultCapabilities Package="false" '
|
||||
!!' Streaming="true"/><OutputParameters/></StoredProcess>');
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
**/
|
||||
%macro mm_webout(action,ds,dslabel=,fref=_webout,fmt=Y);
|
||||
%global _webin_file_count _webin_fileref1 _webin_name1 _program _debug
|
||||
%global _webin_file_count _webin_fileref1 _webin_name1 _program _debug
|
||||
sasjs_tables;
|
||||
%local i tempds;
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
i+1;
|
||||
call symputx('wt'!!left(i),name,'l');
|
||||
call symputx('wtcnt',i,'l');
|
||||
data _null_; file &fref encoding='utf-8';
|
||||
data _null_; file &fref encoding='utf-8';
|
||||
put ",""WORK"":{";
|
||||
%do i=1 %to &wtcnt;
|
||||
%let wt=&&wt&i;
|
||||
|
||||
Reference in New Issue
Block a user