mirror of
https://github.com/sasjs/core.git
synced 2026-01-05 00:20:05 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b884d165f | ||
|
|
5a2968e798 | ||
|
|
120ad9a7da | ||
|
|
67a81b2690 | ||
|
|
506cf1812f | ||
|
|
8cc0eb0dd7 | ||
|
|
4c1f69da3a | ||
|
|
f160ebe705 | ||
|
|
3f49925d01 | ||
|
|
53ed5dc916 | ||
|
|
808b24e31b | ||
|
|
c51c9c2ca9 |
208
all.sas
208
all.sas
@@ -67,7 +67,8 @@ options noquotelenmax;
|
|||||||
%if %sysfunc(exist(&libds)) ne 1 & %sysfunc(exist(&libds,VIEW)) ne 1 %then 0;
|
%if %sysfunc(exist(&libds)) ne 1 & %sysfunc(exist(&libds,VIEW)) ne 1 %then 0;
|
||||||
%else 1;
|
%else 1;
|
||||||
|
|
||||||
%mend;/**
|
%mend mf_existds;
|
||||||
|
/**
|
||||||
@file
|
@file
|
||||||
@brief Checks whether a feature exists
|
@brief Checks whether a feature exists
|
||||||
@details Check to see if a feature is supported in your environment.
|
@details Check to see if a feature is supported in your environment.
|
||||||
@@ -975,7 +976,8 @@ options noquotelenmax;
|
|||||||
%let rc=%sysfunc(close(&dsid));
|
%let rc=%sysfunc(close(&dsid));
|
||||||
%end;
|
%end;
|
||||||
%else %do;
|
%else %do;
|
||||||
%put unable to open &libds (rc=&dsid);
|
%put &sysmacroname: Unable to open &libds (rc=&dsid);
|
||||||
|
%put &sysmacroname: SYSMSG= %sysfunc(sysmsg());
|
||||||
%let rc=%sysfunc(close(&dsid));
|
%let rc=%sysfunc(close(&dsid));
|
||||||
%end;
|
%end;
|
||||||
&outvar
|
&outvar
|
||||||
@@ -9036,7 +9038,12 @@ data _null_;
|
|||||||
put '%macro mm_webout(action,ds,dslabel=,fref=_webout,fmt=Y); ';
|
put '%macro mm_webout(action,ds,dslabel=,fref=_webout,fmt=Y); ';
|
||||||
put '%global _webin_file_count _webin_fileref1 _webin_name1 _program _debug ';
|
put '%global _webin_file_count _webin_fileref1 _webin_name1 _program _debug ';
|
||||||
put ' sasjs_tables; ';
|
put ' sasjs_tables; ';
|
||||||
put '%local i tempds; ';
|
put '%local i tempds jsonengine; ';
|
||||||
|
put ' ';
|
||||||
|
put '/* see https://github.com/sasjs/core/issues/41 */ ';
|
||||||
|
put '%if "%upcase(&SYSENCODING)" ne "UTF-8" %then %let jsonengine=PROCJSON; ';
|
||||||
|
put '%else %let jsonengine=DATASTEP; ';
|
||||||
|
put ' ';
|
||||||
put ' ';
|
put ' ';
|
||||||
put '%if &action=FETCH %then %do; ';
|
put '%if &action=FETCH %then %do; ';
|
||||||
put ' %if %str(&_debug) ge 131 %then %do; ';
|
put ' %if %str(&_debug) ge 131 %then %do; ';
|
||||||
@@ -9071,7 +9078,7 @@ data _null_;
|
|||||||
put ' OPTIONS NOBOMFILE; ';
|
put ' OPTIONS NOBOMFILE; ';
|
||||||
put ' ';
|
put ' ';
|
||||||
put ' /** ';
|
put ' /** ';
|
||||||
put ' * check engine type to avoid the below err message: ';
|
put ' * check xengine type to avoid the below err message: ';
|
||||||
put ' * > Function is only valid for filerefs using the CACHE access method. ';
|
put ' * > Function is only valid for filerefs using the CACHE access method. ';
|
||||||
put ' */ ';
|
put ' */ ';
|
||||||
put ' data _null_; ';
|
put ' data _null_; ';
|
||||||
@@ -9093,7 +9100,7 @@ data _null_;
|
|||||||
put ' ';
|
put ' ';
|
||||||
put '%else %if &action=ARR or &action=OBJ %then %do; ';
|
put '%else %if &action=ARR or &action=OBJ %then %do; ';
|
||||||
put ' %mp_jsonout(&action,&ds,dslabel=&dslabel,fmt=&fmt,jref=&fref ';
|
put ' %mp_jsonout(&action,&ds,dslabel=&dslabel,fmt=&fmt,jref=&fref ';
|
||||||
put ' ,engine=DATASTEP,dbg=%str(&_debug) ';
|
put ' ,engine=&jsonengine,dbg=%str(&_debug) ';
|
||||||
put ' ) ';
|
put ' ) ';
|
||||||
put '%end; ';
|
put '%end; ';
|
||||||
put '%else %if &action=CLOSE %then %do; ';
|
put '%else %if &action=CLOSE %then %do; ';
|
||||||
@@ -9106,7 +9113,7 @@ data _null_;
|
|||||||
put ' %local wtcnt;%let wtcnt=0; ';
|
put ' %local wtcnt;%let wtcnt=0; ';
|
||||||
put ' data _null_; ';
|
put ' data _null_; ';
|
||||||
put ' set &tempds; ';
|
put ' set &tempds; ';
|
||||||
put ' if not (name =:"DATA"); ';
|
put ' if not (upcase(name) =:"DATA"); /* ignore temp datasets */ ';
|
||||||
put ' i+1; ';
|
put ' i+1; ';
|
||||||
put ' call symputx(''wt''!!left(i),name,''l''); ';
|
put ' call symputx(''wt''!!left(i),name,''l''); ';
|
||||||
put ' call symputx(''wtcnt'',i,''l''); ';
|
put ' call symputx(''wtcnt'',i,''l''); ';
|
||||||
@@ -9126,8 +9133,8 @@ data _null_;
|
|||||||
put ' put " ""&wt"" : {"; ';
|
put ' put " ""&wt"" : {"; ';
|
||||||
put ' put ''"nlobs":'' nlobs; ';
|
put ' put ''"nlobs":'' nlobs; ';
|
||||||
put ' put '',"nvars":'' nvars; ';
|
put ' put '',"nvars":'' nvars; ';
|
||||||
put ' %mp_jsonout(OBJ,&tempds,jref=&fref,dslabel=colattrs,engine=DATASTEP) ';
|
put ' %mp_jsonout(OBJ,&tempds,jref=&fref,dslabel=colattrs,engine=&jsonengine) ';
|
||||||
put ' %mp_jsonout(OBJ,&wt,jref=&fref,dslabel=first10rows,engine=DATASTEP) ';
|
put ' %mp_jsonout(OBJ,&wt,jref=&fref,dslabel=first10rows,engine=&jsonengine) ';
|
||||||
put ' data _null_; file &fref mod encoding=''utf-8''; ';
|
put ' data _null_; file &fref mod encoding=''utf-8''; ';
|
||||||
put ' put "}"; ';
|
put ' put "}"; ';
|
||||||
put ' %end; ';
|
put ' %end; ';
|
||||||
@@ -11762,7 +11769,8 @@ filename __shake clear;
|
|||||||
put '%let mmxpass="Mars321";';
|
put '%let mmxpass="Mars321";';
|
||||||
run;
|
run;
|
||||||
|
|
||||||
filename myref "%sysfunc(pathname(work))/mmxexport.sh";
|
filename myref "%sysfunc(pathname(work))/mmxexport.sh"
|
||||||
|
permission='A::u::rwx,A::g::r-x,A::o::---';
|
||||||
%mm_spkexport(metaloc=%str(/my/meta/loc)
|
%mm_spkexport(metaloc=%str(/my/meta/loc)
|
||||||
,outref=myref
|
,outref=myref
|
||||||
,secureref=tmp
|
,secureref=tmp
|
||||||
@@ -11771,7 +11779,8 @@ filename __shake clear;
|
|||||||
|
|
||||||
Alternatively, call without inputs to create a function style output
|
Alternatively, call without inputs to create a function style output
|
||||||
|
|
||||||
filename myref "/tmp/mmscript.sh";
|
filename myref "/tmp/mmscript.sh"
|
||||||
|
permission='A::u::rwx,A::g::r-x,A::o::---';
|
||||||
%mm_spkexport(metaloc=%str(/my/meta/loc)
|
%mm_spkexport(metaloc=%str(/my/meta/loc)
|
||||||
outref=myref
|
outref=myref
|
||||||
,cmdoutloc=%str(/tmp)
|
,cmdoutloc=%str(/tmp)
|
||||||
@@ -11857,7 +11866,7 @@ run;
|
|||||||
,msg=%str(syscc=&syscc)
|
,msg=%str(syscc=&syscc)
|
||||||
)
|
)
|
||||||
|
|
||||||
%mend;/**
|
%mend mm_spkexport;/**
|
||||||
@file mm_tree.sas
|
@file mm_tree.sas
|
||||||
@brief Returns all folders / subfolder content for a particular root
|
@brief Returns all folders / subfolder content for a particular root
|
||||||
@details Shows all members and SubTrees for a particular root.
|
@details Shows all members and SubTrees for a particular root.
|
||||||
@@ -12522,7 +12531,12 @@ run;
|
|||||||
%macro mm_webout(action,ds,dslabel=,fref=_webout,fmt=Y);
|
%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;
|
sasjs_tables;
|
||||||
%local i tempds;
|
%local i tempds jsonengine;
|
||||||
|
|
||||||
|
/* see https://github.com/sasjs/core/issues/41 */
|
||||||
|
%if "%upcase(&SYSENCODING)" ne "UTF-8" %then %let jsonengine=PROCJSON;
|
||||||
|
%else %let jsonengine=DATASTEP;
|
||||||
|
|
||||||
|
|
||||||
%if &action=FETCH %then %do;
|
%if &action=FETCH %then %do;
|
||||||
%if %str(&_debug) ge 131 %then %do;
|
%if %str(&_debug) ge 131 %then %do;
|
||||||
@@ -12557,7 +12571,7 @@ run;
|
|||||||
OPTIONS NOBOMFILE;
|
OPTIONS NOBOMFILE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check engine type to avoid the below err message:
|
* check xengine type to avoid the below err message:
|
||||||
* > Function is only valid for filerefs using the CACHE access method.
|
* > Function is only valid for filerefs using the CACHE access method.
|
||||||
*/
|
*/
|
||||||
data _null_;
|
data _null_;
|
||||||
@@ -12579,7 +12593,7 @@ run;
|
|||||||
|
|
||||||
%else %if &action=ARR or &action=OBJ %then %do;
|
%else %if &action=ARR or &action=OBJ %then %do;
|
||||||
%mp_jsonout(&action,&ds,dslabel=&dslabel,fmt=&fmt,jref=&fref
|
%mp_jsonout(&action,&ds,dslabel=&dslabel,fmt=&fmt,jref=&fref
|
||||||
,engine=DATASTEP,dbg=%str(&_debug)
|
,engine=&jsonengine,dbg=%str(&_debug)
|
||||||
)
|
)
|
||||||
%end;
|
%end;
|
||||||
%else %if &action=CLOSE %then %do;
|
%else %if &action=CLOSE %then %do;
|
||||||
@@ -12592,7 +12606,7 @@ run;
|
|||||||
%local wtcnt;%let wtcnt=0;
|
%local wtcnt;%let wtcnt=0;
|
||||||
data _null_;
|
data _null_;
|
||||||
set &tempds;
|
set &tempds;
|
||||||
if not (name =:"DATA");
|
if not (upcase(name) =:"DATA"); /* ignore temp datasets */
|
||||||
i+1;
|
i+1;
|
||||||
call symputx('wt'!!left(i),name,'l');
|
call symputx('wt'!!left(i),name,'l');
|
||||||
call symputx('wtcnt',i,'l');
|
call symputx('wtcnt',i,'l');
|
||||||
@@ -12612,8 +12626,8 @@ run;
|
|||||||
put " ""&wt"" : {";
|
put " ""&wt"" : {";
|
||||||
put '"nlobs":' nlobs;
|
put '"nlobs":' nlobs;
|
||||||
put ',"nvars":' nvars;
|
put ',"nvars":' nvars;
|
||||||
%mp_jsonout(OBJ,&tempds,jref=&fref,dslabel=colattrs,engine=DATASTEP)
|
%mp_jsonout(OBJ,&tempds,jref=&fref,dslabel=colattrs,engine=&jsonengine)
|
||||||
%mp_jsonout(OBJ,&wt,jref=&fref,dslabel=first10rows,engine=DATASTEP)
|
%mp_jsonout(OBJ,&wt,jref=&fref,dslabel=first10rows,engine=&jsonengine)
|
||||||
data _null_; file &fref mod encoding='utf-8';
|
data _null_; file &fref mod encoding='utf-8';
|
||||||
put "}";
|
put "}";
|
||||||
%end;
|
%end;
|
||||||
@@ -12689,6 +12703,98 @@ data _null_;
|
|||||||
run;
|
run;
|
||||||
|
|
||||||
%mend;/**
|
%mend;/**
|
||||||
|
@file
|
||||||
|
@brief Get metadata permissions for a particular folder
|
||||||
|
@details Uses the metadata batch tools to fetch the permissions for a
|
||||||
|
particular folder. For security, the username / password are expected to have
|
||||||
|
been provided in a protected directory.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
|
||||||
|
%* import the macros (or make them available some other way);
|
||||||
|
filename mc url "https://raw.githubusercontent.com/sasjs/core/main/all.sas";
|
||||||
|
%inc mc;
|
||||||
|
|
||||||
|
%* create sample text file as input to the macro;
|
||||||
|
%* password must be in single quotes if it has special chars;
|
||||||
|
|
||||||
|
filename creds temp;
|
||||||
|
data _null_;
|
||||||
|
file creds;
|
||||||
|
put " -user 'sasdemo' -password 'Mars321' ";
|
||||||
|
run;
|
||||||
|
|
||||||
|
filename outref "%sysfunc(pathname(work))";
|
||||||
|
%mmx_getmetaperms(
|
||||||
|
metaloc=/some/meta/folder
|
||||||
|
,secureref=creds
|
||||||
|
,outds=work.perms
|
||||||
|
)
|
||||||
|
|
||||||
|
<h4> SAS Macros </h4>
|
||||||
|
@li mf_loc.sas
|
||||||
|
@li mf_getuniquefileref.sas
|
||||||
|
@li mp_abort.sas
|
||||||
|
|
||||||
|
@param metaloc= the metadata folder for which to export permissions
|
||||||
|
@param secureref= fileref containing the username / password (should point to
|
||||||
|
a file in a secure location)
|
||||||
|
@param outds= (work.mmx_getmetaperms) The output table containing the perms
|
||||||
|
@param effective= (YES) Displays effective access. If set to NO, only direct
|
||||||
|
access controls are displayed. Effective access is the net effect of all
|
||||||
|
applicable permission settings (both direct access controls and inherited
|
||||||
|
permissions).
|
||||||
|
@param onlyGroup= (0) Display access for only the specified user group.
|
||||||
|
@param onlyUser= (0) Display access for only the specified user.
|
||||||
|
|
||||||
|
@version 9.4
|
||||||
|
@author Allan Bowe
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
%macro mmx_getmetaperms(metaloc=
|
||||||
|
,secureref=
|
||||||
|
,outds=work.mmx_getmetaperms
|
||||||
|
,effective=YES
|
||||||
|
,onlygroup=0
|
||||||
|
,onlyuser=0
|
||||||
|
);
|
||||||
|
|
||||||
|
%local host port path mmxuser mmxpass eff filt;
|
||||||
|
%let host=%sysfunc(getoption(metaserver));
|
||||||
|
%let port=%sysfunc(getoption(metaport));
|
||||||
|
%let path=%mf_loc(POF)/tools/sas-show-metadata-access;
|
||||||
|
|
||||||
|
%if &effective=YES %then %let eff=-effective;
|
||||||
|
%if "&onlygroup" ne "0" %then %let filt=-onlyGroup ""&onlygroup"";
|
||||||
|
%else %if "&onlyuser" ne "0" %then %let filt=-onlyUser ""&onlyuser"";
|
||||||
|
|
||||||
|
%local fref1;
|
||||||
|
%let fref1=%mf_getuniquefileref();
|
||||||
|
data _null_;
|
||||||
|
file &fref1 lrecl=32767;
|
||||||
|
infile &secureref;
|
||||||
|
input;
|
||||||
|
put 'data _null_;';
|
||||||
|
put "infile '&path -disableX11 -host &host -port &port " _infile_ @;
|
||||||
|
put " ""&metaloc"" &eff &filt 2>&1' pipe lrecl=10000;";
|
||||||
|
put 'input;putlog _infile_;run;';
|
||||||
|
run;
|
||||||
|
|
||||||
|
data _null_;
|
||||||
|
infile &fref1;
|
||||||
|
input;list;run;
|
||||||
|
|
||||||
|
%inc &fref1/nosource;
|
||||||
|
|
||||||
|
|
||||||
|
%mp_abort(iftrue= (&syscc ne 0)
|
||||||
|
,mac=&sysmacroname
|
||||||
|
,msg=%str(syscc=&syscc on exit)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
%mend mmx_getmetaperms;/**
|
||||||
@file mmx_spkexport.sas
|
@file mmx_spkexport.sas
|
||||||
@brief Exports everything in a particular metadata folder
|
@brief Exports everything in a particular metadata folder
|
||||||
@details Will export everything in a metadata folder to a specified location.
|
@details Will export everything in a metadata folder to a specified location.
|
||||||
@@ -12896,6 +13002,10 @@ run;
|
|||||||
@param [in] path= The parent folder in which to create the file
|
@param [in] path= The parent folder in which to create the file
|
||||||
@param [in] name= The name of the file to be created
|
@param [in] name= The name of the file to be created
|
||||||
@param [in] inref= The fileref pointing to the file to be uploaded
|
@param [in] inref= The fileref pointing to the file to be uploaded
|
||||||
|
@param [in] contentdisp= (inline) Content Disposition. Example values:
|
||||||
|
@li inline
|
||||||
|
@li attachment
|
||||||
|
|
||||||
@param [in] access_token_var= The global macro variable to contain the access
|
@param [in] access_token_var= The global macro variable to contain the access
|
||||||
token, if using authorization_code grant type.
|
token, if using authorization_code grant type.
|
||||||
@param [in] grant_type= (sas_services) Valid values are:
|
@param [in] grant_type= (sas_services) Valid values are:
|
||||||
@@ -12920,6 +13030,7 @@ run;
|
|||||||
%macro mv_createfile(path=
|
%macro mv_createfile(path=
|
||||||
,name=
|
,name=
|
||||||
,inref=
|
,inref=
|
||||||
|
,contentdisp=inline
|
||||||
,access_token_var=ACCESS_TOKEN
|
,access_token_var=ACCESS_TOKEN
|
||||||
,grant_type=sas_services
|
,grant_type=sas_services
|
||||||
,mdebug=0
|
,mdebug=0
|
||||||
@@ -12967,12 +13078,23 @@ run;
|
|||||||
/* create file with relevant options */
|
/* create file with relevant options */
|
||||||
%local fref;
|
%local fref;
|
||||||
%let fref=%mf_getuniquefileref();
|
%let fref=%mf_getuniquefileref();
|
||||||
filename &fref filesrvc folderPath="&path" filename="&name";
|
filename &fref filesrvc
|
||||||
|
folderPath="&path"
|
||||||
|
filename="&name"
|
||||||
|
cdisp="&contentdisp";
|
||||||
|
|
||||||
%mp_binarycopy(inref=&inref, outref=&fref)
|
%mp_binarycopy(inref=&inref, outref=&fref)
|
||||||
|
|
||||||
filename &fref clear;
|
filename &fref clear;
|
||||||
|
|
||||||
|
%local base_uri; /* location of rest apis */
|
||||||
|
%let base_uri=%mf_getplatform(VIYARESTAPI);
|
||||||
|
|
||||||
|
%put &sysmacroname: File &name successfully created in &path;
|
||||||
|
%put &sysmacroname:;%put;
|
||||||
|
%put &base_uri/SASJobExecution?_file=&path/&name;%put;
|
||||||
|
%put &sysmacroname:;
|
||||||
|
|
||||||
%mend mv_createfile;/**
|
%mend mv_createfile;/**
|
||||||
@file mv_createfolder.sas
|
@file mv_createfolder.sas
|
||||||
@brief Creates a viya folder if that folder does not already exist
|
@brief Creates a viya folder if that folder does not already exist
|
||||||
@@ -13395,6 +13517,30 @@ 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 if rec='07'x then do; /* Bell Char */
|
||||||
|
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,'7');rc =fwrite(fileid);
|
||||||
|
end;
|
||||||
|
else if rec='1B'x then do; /* escape char */
|
||||||
|
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,'1');rc =fwrite(fileid);
|
||||||
|
rc =fput(fileid,'B');rc =fwrite(fileid);
|
||||||
|
end;
|
||||||
else do;
|
else do;
|
||||||
rc =fput(fileid,rec);
|
rc =fput(fileid,rec);
|
||||||
rc =fwrite(fileid);
|
rc =fwrite(fileid);
|
||||||
@@ -14014,8 +14160,9 @@ data _null_;
|
|||||||
put ' ods output Members=&tempds; ';
|
put ' ods output Members=&tempds; ';
|
||||||
put ' proc datasets library=WORK memtype=data; ';
|
put ' proc datasets library=WORK memtype=data; ';
|
||||||
put ' %local wtcnt;%let wtcnt=0; ';
|
put ' %local wtcnt;%let wtcnt=0; ';
|
||||||
put ' data _null_; set &tempds; ';
|
put ' data _null_; ';
|
||||||
put ' if not (name =:"DATA"); ';
|
put ' set &tempds; ';
|
||||||
|
put ' if not (upcase(name) =:"DATA"); /* ignore temp datasets */ ';
|
||||||
put ' i+1; ';
|
put ' i+1; ';
|
||||||
put ' call symputx(''wt''!!left(i),name); ';
|
put ' call symputx(''wt''!!left(i),name); ';
|
||||||
put ' call symputx(''wtcnt'',i); ';
|
put ' call symputx(''wtcnt'',i); ';
|
||||||
@@ -14139,6 +14286,22 @@ run;
|
|||||||
rc =fput(fileid,'0');rc =fwrite(fileid);
|
rc =fput(fileid,'0');rc =fwrite(fileid);
|
||||||
rc =fput(fileid,'1');rc =fwrite(fileid);
|
rc =fput(fileid,'1');rc =fwrite(fileid);
|
||||||
end;
|
end;
|
||||||
|
else if rec='07'x then do; /* Bell Char */
|
||||||
|
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,'7');rc =fwrite(fileid);
|
||||||
|
end;
|
||||||
|
else if rec='1B'x then do; /* escape char */
|
||||||
|
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,'1');rc =fwrite(fileid);
|
||||||
|
rc =fput(fileid,'B');rc =fwrite(fileid);
|
||||||
|
end;
|
||||||
else do;
|
else do;
|
||||||
rc =fput(fileid,rec);
|
rc =fput(fileid,rec);
|
||||||
rc =fwrite(fileid);
|
rc =fwrite(fileid);
|
||||||
@@ -17814,8 +17977,9 @@ filename &fref1 clear;
|
|||||||
ods output Members=&tempds;
|
ods output Members=&tempds;
|
||||||
proc datasets library=WORK memtype=data;
|
proc datasets library=WORK memtype=data;
|
||||||
%local wtcnt;%let wtcnt=0;
|
%local wtcnt;%let wtcnt=0;
|
||||||
data _null_; set &tempds;
|
data _null_;
|
||||||
if not (name =:"DATA");
|
set &tempds;
|
||||||
|
if not (upcase(name) =:"DATA"); /* ignore temp datasets */
|
||||||
i+1;
|
i+1;
|
||||||
call symputx('wt'!!left(i),name);
|
call symputx('wt'!!left(i),name);
|
||||||
call symputx('wtcnt',i);
|
call symputx('wtcnt',i);
|
||||||
|
|||||||
@@ -23,4 +23,4 @@
|
|||||||
%if %sysfunc(exist(&libds)) ne 1 & %sysfunc(exist(&libds,VIEW)) ne 1 %then 0;
|
%if %sysfunc(exist(&libds)) ne 1 & %sysfunc(exist(&libds,VIEW)) ne 1 %then 0;
|
||||||
%else 1;
|
%else 1;
|
||||||
|
|
||||||
%mend;
|
%mend mf_existds;
|
||||||
|
|||||||
@@ -66,7 +66,8 @@
|
|||||||
%let rc=%sysfunc(close(&dsid));
|
%let rc=%sysfunc(close(&dsid));
|
||||||
%end;
|
%end;
|
||||||
%else %do;
|
%else %do;
|
||||||
%put unable to open &libds (rc=&dsid);
|
%put &sysmacroname: Unable to open &libds (rc=&dsid);
|
||||||
|
%put &sysmacroname: SYSMSG= %sysfunc(sysmsg());
|
||||||
%let rc=%sysfunc(close(&dsid));
|
%let rc=%sysfunc(close(&dsid));
|
||||||
%end;
|
%end;
|
||||||
&outvar
|
&outvar
|
||||||
|
|||||||
@@ -266,7 +266,12 @@ data _null_;
|
|||||||
put '%macro mm_webout(action,ds,dslabel=,fref=_webout,fmt=Y); ';
|
put '%macro mm_webout(action,ds,dslabel=,fref=_webout,fmt=Y); ';
|
||||||
put '%global _webin_file_count _webin_fileref1 _webin_name1 _program _debug ';
|
put '%global _webin_file_count _webin_fileref1 _webin_name1 _program _debug ';
|
||||||
put ' sasjs_tables; ';
|
put ' sasjs_tables; ';
|
||||||
put '%local i tempds; ';
|
put '%local i tempds jsonengine; ';
|
||||||
|
put ' ';
|
||||||
|
put '/* see https://github.com/sasjs/core/issues/41 */ ';
|
||||||
|
put '%if "%upcase(&SYSENCODING)" ne "UTF-8" %then %let jsonengine=PROCJSON; ';
|
||||||
|
put '%else %let jsonengine=DATASTEP; ';
|
||||||
|
put ' ';
|
||||||
put ' ';
|
put ' ';
|
||||||
put '%if &action=FETCH %then %do; ';
|
put '%if &action=FETCH %then %do; ';
|
||||||
put ' %if %str(&_debug) ge 131 %then %do; ';
|
put ' %if %str(&_debug) ge 131 %then %do; ';
|
||||||
@@ -301,7 +306,7 @@ data _null_;
|
|||||||
put ' OPTIONS NOBOMFILE; ';
|
put ' OPTIONS NOBOMFILE; ';
|
||||||
put ' ';
|
put ' ';
|
||||||
put ' /** ';
|
put ' /** ';
|
||||||
put ' * check engine type to avoid the below err message: ';
|
put ' * check xengine type to avoid the below err message: ';
|
||||||
put ' * > Function is only valid for filerefs using the CACHE access method. ';
|
put ' * > Function is only valid for filerefs using the CACHE access method. ';
|
||||||
put ' */ ';
|
put ' */ ';
|
||||||
put ' data _null_; ';
|
put ' data _null_; ';
|
||||||
@@ -323,7 +328,7 @@ data _null_;
|
|||||||
put ' ';
|
put ' ';
|
||||||
put '%else %if &action=ARR or &action=OBJ %then %do; ';
|
put '%else %if &action=ARR or &action=OBJ %then %do; ';
|
||||||
put ' %mp_jsonout(&action,&ds,dslabel=&dslabel,fmt=&fmt,jref=&fref ';
|
put ' %mp_jsonout(&action,&ds,dslabel=&dslabel,fmt=&fmt,jref=&fref ';
|
||||||
put ' ,engine=DATASTEP,dbg=%str(&_debug) ';
|
put ' ,engine=&jsonengine,dbg=%str(&_debug) ';
|
||||||
put ' ) ';
|
put ' ) ';
|
||||||
put '%end; ';
|
put '%end; ';
|
||||||
put '%else %if &action=CLOSE %then %do; ';
|
put '%else %if &action=CLOSE %then %do; ';
|
||||||
@@ -336,7 +341,7 @@ data _null_;
|
|||||||
put ' %local wtcnt;%let wtcnt=0; ';
|
put ' %local wtcnt;%let wtcnt=0; ';
|
||||||
put ' data _null_; ';
|
put ' data _null_; ';
|
||||||
put ' set &tempds; ';
|
put ' set &tempds; ';
|
||||||
put ' if not (name =:"DATA"); ';
|
put ' if not (upcase(name) =:"DATA"); /* ignore temp datasets */ ';
|
||||||
put ' i+1; ';
|
put ' i+1; ';
|
||||||
put ' call symputx(''wt''!!left(i),name,''l''); ';
|
put ' call symputx(''wt''!!left(i),name,''l''); ';
|
||||||
put ' call symputx(''wtcnt'',i,''l''); ';
|
put ' call symputx(''wtcnt'',i,''l''); ';
|
||||||
@@ -356,8 +361,8 @@ data _null_;
|
|||||||
put ' put " ""&wt"" : {"; ';
|
put ' put " ""&wt"" : {"; ';
|
||||||
put ' put ''"nlobs":'' nlobs; ';
|
put ' put ''"nlobs":'' nlobs; ';
|
||||||
put ' put '',"nvars":'' nvars; ';
|
put ' put '',"nvars":'' nvars; ';
|
||||||
put ' %mp_jsonout(OBJ,&tempds,jref=&fref,dslabel=colattrs,engine=DATASTEP) ';
|
put ' %mp_jsonout(OBJ,&tempds,jref=&fref,dslabel=colattrs,engine=&jsonengine) ';
|
||||||
put ' %mp_jsonout(OBJ,&wt,jref=&fref,dslabel=first10rows,engine=DATASTEP) ';
|
put ' %mp_jsonout(OBJ,&wt,jref=&fref,dslabel=first10rows,engine=&jsonengine) ';
|
||||||
put ' data _null_; file &fref mod encoding=''utf-8''; ';
|
put ' data _null_; file &fref mod encoding=''utf-8''; ';
|
||||||
put ' put "}"; ';
|
put ' put "}"; ';
|
||||||
put ' %end; ';
|
put ' %end; ';
|
||||||
|
|||||||
@@ -24,7 +24,8 @@
|
|||||||
put '%let mmxpass="Mars321";';
|
put '%let mmxpass="Mars321";';
|
||||||
run;
|
run;
|
||||||
|
|
||||||
filename myref "%sysfunc(pathname(work))/mmxexport.sh";
|
filename myref "%sysfunc(pathname(work))/mmxexport.sh"
|
||||||
|
permission='A::u::rwx,A::g::r-x,A::o::---';
|
||||||
%mm_spkexport(metaloc=%str(/my/meta/loc)
|
%mm_spkexport(metaloc=%str(/my/meta/loc)
|
||||||
,outref=myref
|
,outref=myref
|
||||||
,secureref=tmp
|
,secureref=tmp
|
||||||
@@ -33,7 +34,8 @@
|
|||||||
|
|
||||||
Alternatively, call without inputs to create a function style output
|
Alternatively, call without inputs to create a function style output
|
||||||
|
|
||||||
filename myref "/tmp/mmscript.sh";
|
filename myref "/tmp/mmscript.sh"
|
||||||
|
permission='A::u::rwx,A::g::r-x,A::o::---';
|
||||||
%mm_spkexport(metaloc=%str(/my/meta/loc)
|
%mm_spkexport(metaloc=%str(/my/meta/loc)
|
||||||
outref=myref
|
outref=myref
|
||||||
,cmdoutloc=%str(/tmp)
|
,cmdoutloc=%str(/tmp)
|
||||||
@@ -119,4 +121,4 @@ run;
|
|||||||
,msg=%str(syscc=&syscc)
|
,msg=%str(syscc=&syscc)
|
||||||
)
|
)
|
||||||
|
|
||||||
%mend;
|
%mend mm_spkexport;
|
||||||
@@ -36,7 +36,12 @@
|
|||||||
%macro mm_webout(action,ds,dslabel=,fref=_webout,fmt=Y);
|
%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;
|
sasjs_tables;
|
||||||
%local i tempds;
|
%local i tempds jsonengine;
|
||||||
|
|
||||||
|
/* see https://github.com/sasjs/core/issues/41 */
|
||||||
|
%if "%upcase(&SYSENCODING)" ne "UTF-8" %then %let jsonengine=PROCJSON;
|
||||||
|
%else %let jsonengine=DATASTEP;
|
||||||
|
|
||||||
|
|
||||||
%if &action=FETCH %then %do;
|
%if &action=FETCH %then %do;
|
||||||
%if %str(&_debug) ge 131 %then %do;
|
%if %str(&_debug) ge 131 %then %do;
|
||||||
@@ -71,7 +76,7 @@
|
|||||||
OPTIONS NOBOMFILE;
|
OPTIONS NOBOMFILE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check engine type to avoid the below err message:
|
* check xengine type to avoid the below err message:
|
||||||
* > Function is only valid for filerefs using the CACHE access method.
|
* > Function is only valid for filerefs using the CACHE access method.
|
||||||
*/
|
*/
|
||||||
data _null_;
|
data _null_;
|
||||||
@@ -93,7 +98,7 @@
|
|||||||
|
|
||||||
%else %if &action=ARR or &action=OBJ %then %do;
|
%else %if &action=ARR or &action=OBJ %then %do;
|
||||||
%mp_jsonout(&action,&ds,dslabel=&dslabel,fmt=&fmt,jref=&fref
|
%mp_jsonout(&action,&ds,dslabel=&dslabel,fmt=&fmt,jref=&fref
|
||||||
,engine=DATASTEP,dbg=%str(&_debug)
|
,engine=&jsonengine,dbg=%str(&_debug)
|
||||||
)
|
)
|
||||||
%end;
|
%end;
|
||||||
%else %if &action=CLOSE %then %do;
|
%else %if &action=CLOSE %then %do;
|
||||||
@@ -106,7 +111,7 @@
|
|||||||
%local wtcnt;%let wtcnt=0;
|
%local wtcnt;%let wtcnt=0;
|
||||||
data _null_;
|
data _null_;
|
||||||
set &tempds;
|
set &tempds;
|
||||||
if not (name =:"DATA");
|
if not (upcase(name) =:"DATA"); /* ignore temp datasets */
|
||||||
i+1;
|
i+1;
|
||||||
call symputx('wt'!!left(i),name,'l');
|
call symputx('wt'!!left(i),name,'l');
|
||||||
call symputx('wtcnt',i,'l');
|
call symputx('wtcnt',i,'l');
|
||||||
@@ -126,8 +131,8 @@
|
|||||||
put " ""&wt"" : {";
|
put " ""&wt"" : {";
|
||||||
put '"nlobs":' nlobs;
|
put '"nlobs":' nlobs;
|
||||||
put ',"nvars":' nvars;
|
put ',"nvars":' nvars;
|
||||||
%mp_jsonout(OBJ,&tempds,jref=&fref,dslabel=colattrs,engine=DATASTEP)
|
%mp_jsonout(OBJ,&tempds,jref=&fref,dslabel=colattrs,engine=&jsonengine)
|
||||||
%mp_jsonout(OBJ,&wt,jref=&fref,dslabel=first10rows,engine=DATASTEP)
|
%mp_jsonout(OBJ,&wt,jref=&fref,dslabel=first10rows,engine=&jsonengine)
|
||||||
data _null_; file &fref mod encoding='utf-8';
|
data _null_; file &fref mod encoding='utf-8';
|
||||||
put "}";
|
put "}";
|
||||||
%end;
|
%end;
|
||||||
|
|||||||
93
metax/mmx_getmetaperms.sas
Normal file
93
metax/mmx_getmetaperms.sas
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
/**
|
||||||
|
@file
|
||||||
|
@brief Get metadata permissions for a particular folder
|
||||||
|
@details Uses the metadata batch tools to fetch the permissions for a
|
||||||
|
particular folder. For security, the username / password are expected to have
|
||||||
|
been provided in a protected directory.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
|
||||||
|
%* import the macros (or make them available some other way);
|
||||||
|
filename mc url "https://raw.githubusercontent.com/sasjs/core/main/all.sas";
|
||||||
|
%inc mc;
|
||||||
|
|
||||||
|
%* create sample text file as input to the macro;
|
||||||
|
%* password must be in single quotes if it has special chars;
|
||||||
|
|
||||||
|
filename creds temp;
|
||||||
|
data _null_;
|
||||||
|
file creds;
|
||||||
|
put " -user 'sasdemo' -password 'Mars321' ";
|
||||||
|
run;
|
||||||
|
|
||||||
|
filename outref "%sysfunc(pathname(work))";
|
||||||
|
%mmx_getmetaperms(
|
||||||
|
metaloc=/some/meta/folder
|
||||||
|
,secureref=creds
|
||||||
|
,outds=work.perms
|
||||||
|
)
|
||||||
|
|
||||||
|
<h4> SAS Macros </h4>
|
||||||
|
@li mf_loc.sas
|
||||||
|
@li mf_getuniquefileref.sas
|
||||||
|
@li mp_abort.sas
|
||||||
|
|
||||||
|
@param metaloc= the metadata folder for which to export permissions
|
||||||
|
@param secureref= fileref containing the username / password (should point to
|
||||||
|
a file in a secure location)
|
||||||
|
@param outds= (work.mmx_getmetaperms) The output table containing the perms
|
||||||
|
@param effective= (YES) Displays effective access. If set to NO, only direct
|
||||||
|
access controls are displayed. Effective access is the net effect of all
|
||||||
|
applicable permission settings (both direct access controls and inherited
|
||||||
|
permissions).
|
||||||
|
@param onlyGroup= (0) Display access for only the specified user group.
|
||||||
|
@param onlyUser= (0) Display access for only the specified user.
|
||||||
|
|
||||||
|
@version 9.4
|
||||||
|
@author Allan Bowe
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
%macro mmx_getmetaperms(metaloc=
|
||||||
|
,secureref=
|
||||||
|
,outds=work.mmx_getmetaperms
|
||||||
|
,effective=YES
|
||||||
|
,onlygroup=0
|
||||||
|
,onlyuser=0
|
||||||
|
);
|
||||||
|
|
||||||
|
%local host port path mmxuser mmxpass eff filt;
|
||||||
|
%let host=%sysfunc(getoption(metaserver));
|
||||||
|
%let port=%sysfunc(getoption(metaport));
|
||||||
|
%let path=%mf_loc(POF)/tools/sas-show-metadata-access;
|
||||||
|
|
||||||
|
%if &effective=YES %then %let eff=-effective;
|
||||||
|
%if "&onlygroup" ne "0" %then %let filt=-onlyGroup ""&onlygroup"";
|
||||||
|
%else %if "&onlyuser" ne "0" %then %let filt=-onlyUser ""&onlyuser"";
|
||||||
|
|
||||||
|
%local fref1;
|
||||||
|
%let fref1=%mf_getuniquefileref();
|
||||||
|
data _null_;
|
||||||
|
file &fref1 lrecl=32767;
|
||||||
|
infile &secureref;
|
||||||
|
input;
|
||||||
|
put 'data _null_;';
|
||||||
|
put "infile '&path -disableX11 -host &host -port &port " _infile_ @;
|
||||||
|
put " ""&metaloc"" &eff &filt 2>&1' pipe lrecl=10000;";
|
||||||
|
put 'input;putlog _infile_;run;';
|
||||||
|
run;
|
||||||
|
|
||||||
|
data _null_;
|
||||||
|
infile &fref1;
|
||||||
|
input;list;run;
|
||||||
|
|
||||||
|
%inc &fref1/nosource;
|
||||||
|
|
||||||
|
|
||||||
|
%mp_abort(iftrue= (&syscc ne 0)
|
||||||
|
,mac=&sysmacroname
|
||||||
|
,msg=%str(syscc=&syscc on exit)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
%mend mmx_getmetaperms;
|
||||||
6
package-lock.json
generated
6
package-lock.json
generated
@@ -1579,9 +1579,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"ws": {
|
"ws": {
|
||||||
"version": "7.4.5",
|
"version": "7.4.6",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.5.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz",
|
||||||
"integrity": "sha512-xzyu3hFvomRfXKH8vOFMU3OguG6oOvhXMo3xsGy3xWExqaM2dxBbVxuD99O7m3ZUFMvvscsZDqxfgMaRr/Nr1g==",
|
"integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"xml-name-validator": {
|
"xml-name-validator": {
|
||||||
|
|||||||
@@ -30,13 +30,16 @@
|
|||||||
"name": "viya",
|
"name": "viya",
|
||||||
"serverUrl": "https://sas.analytium.co.uk",
|
"serverUrl": "https://sas.analytium.co.uk",
|
||||||
"serverType": "SASVIYA",
|
"serverType": "SASVIYA",
|
||||||
|
"allowInsecureRequests": false,
|
||||||
"appLoc": "/Public/temp/macrocore",
|
"appLoc": "/Public/temp/macrocore",
|
||||||
"deployConfig": {
|
|
||||||
"deployServicePack": true
|
|
||||||
},
|
|
||||||
"macroFolders": [
|
"macroFolders": [
|
||||||
"tests/viya"
|
"tests/viya"
|
||||||
],
|
],
|
||||||
|
"programFolders": [],
|
||||||
|
"deployConfig": {
|
||||||
|
"deployServicePack": true,
|
||||||
|
"deployScripts": []
|
||||||
|
},
|
||||||
"contextName": "SAS Job Execution compute context"
|
"contextName": "SAS Job Execution compute context"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -237,6 +237,30 @@ 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 if rec='07'x then do; /* Bell Char */
|
||||||
|
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,'7');rc =fwrite(fileid);
|
||||||
|
end;
|
||||||
|
else if rec='1B'x then do; /* escape char */
|
||||||
|
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,'1');rc =fwrite(fileid);
|
||||||
|
rc =fput(fileid,'B');rc =fwrite(fileid);
|
||||||
|
end;
|
||||||
else do;
|
else do;
|
||||||
rc =fput(fileid,rec);
|
rc =fput(fileid,rec);
|
||||||
rc =fwrite(fileid);
|
rc =fwrite(fileid);
|
||||||
|
|||||||
@@ -549,8 +549,9 @@ data _null_;
|
|||||||
put ' ods output Members=&tempds; ';
|
put ' ods output Members=&tempds; ';
|
||||||
put ' proc datasets library=WORK memtype=data; ';
|
put ' proc datasets library=WORK memtype=data; ';
|
||||||
put ' %local wtcnt;%let wtcnt=0; ';
|
put ' %local wtcnt;%let wtcnt=0; ';
|
||||||
put ' data _null_; set &tempds; ';
|
put ' data _null_; ';
|
||||||
put ' if not (name =:"DATA"); ';
|
put ' set &tempds; ';
|
||||||
|
put ' if not (upcase(name) =:"DATA"); /* ignore temp datasets */ ';
|
||||||
put ' i+1; ';
|
put ' i+1; ';
|
||||||
put ' call symputx(''wt''!!left(i),name); ';
|
put ' call symputx(''wt''!!left(i),name); ';
|
||||||
put ' call symputx(''wtcnt'',i); ';
|
put ' call symputx(''wtcnt'',i); ';
|
||||||
@@ -674,6 +675,22 @@ run;
|
|||||||
rc =fput(fileid,'0');rc =fwrite(fileid);
|
rc =fput(fileid,'0');rc =fwrite(fileid);
|
||||||
rc =fput(fileid,'1');rc =fwrite(fileid);
|
rc =fput(fileid,'1');rc =fwrite(fileid);
|
||||||
end;
|
end;
|
||||||
|
else if rec='07'x then do; /* Bell Char */
|
||||||
|
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,'7');rc =fwrite(fileid);
|
||||||
|
end;
|
||||||
|
else if rec='1B'x then do; /* escape char */
|
||||||
|
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,'1');rc =fwrite(fileid);
|
||||||
|
rc =fput(fileid,'B');rc =fwrite(fileid);
|
||||||
|
end;
|
||||||
else do;
|
else do;
|
||||||
rc =fput(fileid,rec);
|
rc =fput(fileid,rec);
|
||||||
rc =fwrite(fileid);
|
rc =fwrite(fileid);
|
||||||
|
|||||||
@@ -174,8 +174,9 @@
|
|||||||
ods output Members=&tempds;
|
ods output Members=&tempds;
|
||||||
proc datasets library=WORK memtype=data;
|
proc datasets library=WORK memtype=data;
|
||||||
%local wtcnt;%let wtcnt=0;
|
%local wtcnt;%let wtcnt=0;
|
||||||
data _null_; set &tempds;
|
data _null_;
|
||||||
if not (name =:"DATA");
|
set &tempds;
|
||||||
|
if not (upcase(name) =:"DATA"); /* ignore temp datasets */
|
||||||
i+1;
|
i+1;
|
||||||
call symputx('wt'!!left(i),name);
|
call symputx('wt'!!left(i),name);
|
||||||
call symputx('wtcnt',i);
|
call symputx('wtcnt',i);
|
||||||
|
|||||||
Reference in New Issue
Block a user