mirror of
https://github.com/sasjs/core.git
synced 2026-01-15 04:20:05 +00:00
fix: adding all.sas also
This commit is contained in:
72
all.sas
72
all.sas
@@ -5374,6 +5374,60 @@ alter table &libds modify &var char(&len);
|
|||||||
|
|
||||||
%mend;
|
%mend;
|
||||||
/**
|
/**
|
||||||
|
@file
|
||||||
|
@brief Validates a filter clause
|
||||||
|
@details Validates a filter to avoid SQL injection. Works by removing string
|
||||||
|
literals, then ensuring that none of the following characters remain: &,%,;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%mp_setkeyvalue(someindex,22,type=N)
|
||||||
|
%mp_setkeyvalue(somenewindex,somevalue)
|
||||||
|
|
||||||
|
<h4> SAS Macros </h4>
|
||||||
|
@li mf_existds.sas
|
||||||
|
|
||||||
|
@param key Provide a key on which to perform the lookup
|
||||||
|
@param value Provide a value
|
||||||
|
@param type= either C or N will populate valc and valn respectively. C is
|
||||||
|
default.
|
||||||
|
@param libds= define the target table to hold the parameters
|
||||||
|
|
||||||
|
@version 9.2
|
||||||
|
@author Allan Bowe
|
||||||
|
@source https://github.com/sasjs/core
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
%macro mp_setkeyvalue(key,value,type=C,libds=work.mp_setkeyvalue
|
||||||
|
)/*/STORE SOURCE*/;
|
||||||
|
|
||||||
|
%if not (%mf_existds(&libds)) %then %do;
|
||||||
|
data &libds (index=(key/unique));
|
||||||
|
length key $64 valc $2048 valn 8 type $1;
|
||||||
|
call missing(of _all_);
|
||||||
|
stop;
|
||||||
|
run;
|
||||||
|
%end;
|
||||||
|
|
||||||
|
proc sql;
|
||||||
|
delete from &libds
|
||||||
|
where key=symget('key');
|
||||||
|
insert into &libds
|
||||||
|
set key=symget('key')
|
||||||
|
%if &type=C %then %do;
|
||||||
|
,valc=symget('value')
|
||||||
|
,type='C'
|
||||||
|
%end;
|
||||||
|
%else %do;
|
||||||
|
,valn=symgetn('value')
|
||||||
|
,type='N'
|
||||||
|
%end;
|
||||||
|
;
|
||||||
|
|
||||||
|
quit;
|
||||||
|
|
||||||
|
%mend;/**
|
||||||
@file
|
@file
|
||||||
@brief Creates a zip file
|
@brief Creates a zip file
|
||||||
@details For DIRECTORY usage, will ignore subfolders. For DATASET usage,
|
@details For DIRECTORY usage, will ignore subfolders. For DATASET usage,
|
||||||
@@ -11752,9 +11806,10 @@ run;
|
|||||||
needs to be attached to the beginning of the service
|
needs to be attached to the beginning of the service
|
||||||
@param code= Fileref(s) of the actual code to be added
|
@param code= Fileref(s) of the actual code to be added
|
||||||
@param access_token_var= The global macro variable to contain the access token
|
@param access_token_var= The global macro variable to contain the access token
|
||||||
@param grant_type= valid values are "password" or "authorization_code" (unquoted).
|
@param grant_type= valid values are "password" or "authorization_code"
|
||||||
The default is authorization_code.
|
(unquoted). The default is authorization_code.
|
||||||
@param replace= select NO to avoid replacing any existing service in that location
|
@param replace= select NO to avoid replacing any existing service in that
|
||||||
|
location
|
||||||
@param adapter= the macro uses the sasjs adapter by default. To use another
|
@param adapter= the macro uses the sasjs adapter by default. To use another
|
||||||
adapter, add a (different) fileref here.
|
adapter, add a (different) fileref here.
|
||||||
@param contextname= Choose a specific context on which to run the Job. Leave
|
@param contextname= Choose a specific context on which to run the Job. Leave
|
||||||
@@ -11851,7 +11906,8 @@ libname &libref1 JSON fileref=&fname1;
|
|||||||
|
|
||||||
data _null_;
|
data _null_;
|
||||||
set &libref1..links;
|
set &libref1..links;
|
||||||
if rel='members' then call symputx('membercheck',quote("&base_uri"!!trim(href)),'l');
|
if rel='members' then
|
||||||
|
call symputx('membercheck',quote("&base_uri"!!trim(href)),'l');
|
||||||
else if rel='self' then call symputx('parentFolderUri',href,'l');
|
else if rel='self' then call symputx('parentFolderUri',href,'l');
|
||||||
run;
|
run;
|
||||||
data _null_;
|
data _null_;
|
||||||
@@ -12298,6 +12354,14 @@ run;
|
|||||||
rc =fput(fileid,'\');rc =fwrite(fileid);
|
rc =fput(fileid,'\');rc =fwrite(fileid);
|
||||||
rc =fput(fileid,'\');rc =fwrite(fileid);
|
rc =fput(fileid,'\');rc =fwrite(fileid);
|
||||||
end;
|
end;
|
||||||
|
else if rec='01'x then do; /* Unprintable */
|
||||||
|
rc =fput(fileid,'\');rc =fwrite(fileid);
|
||||||
|
rc =fput(fileid,'u');rc =fwrite(fileid);
|
||||||
|
rc =fput(fileid,'0');rc =fwrite(fileid);
|
||||||
|
rc =fput(fileid,'0');rc =fwrite(fileid);
|
||||||
|
rc =fput(fileid,'0');rc =fwrite(fileid);
|
||||||
|
rc =fput(fileid,'1');rc =fwrite(fileid);
|
||||||
|
end;
|
||||||
else do;
|
else do;
|
||||||
rc =fput(fileid,rec);
|
rc =fput(fileid,rec);
|
||||||
rc =fwrite(fileid);
|
rc =fwrite(fileid);
|
||||||
|
|||||||
Reference in New Issue
Block a user