1
0
mirror of https://github.com/sasjs/core.git synced 2025-12-11 06:24:35 +00:00

Compare commits

...

7 Commits

Author SHA1 Message Date
Allan Bowe
1beb30d0ff fix: updating <h4> Dependencies </h4> in header to be <h4> SAS Macros </h4> in line with the updated SASjs compilation process (which distinguishes between SAS Macro and SAS Program dependencies)
BREAKING CHANGE - this doesn't break anything in the framework but I know of at least one old project that uses the <h4> Dependencies </h4> tag to perform backend compilation, so am bumping the version to be safe (looking at you, Chris
2020-12-25 10:36:19 +00:00
Allan Bowe
e334ea9b85 chore: all.sas update 2020-12-25 10:22:44 +00:00
Allan Bowe
c090c8d53b feat: simple macro to test the write speed for a library (very very basic) 2020-12-25 10:18:02 +00:00
Allan Bowe
659339bd98 fix: more comments in mp_prevobs 2020-12-25 10:15:03 +00:00
Allan Bowe
4c333ae7b3 feat: mp_prevobs.sas macro 2020-12-23 00:33:59 +00:00
b3a8b4323e fix: adding new mp_ds2csv macro 2020-12-16 17:11:31 +01:00
0592206f2d patch: doxy formatting 2020-12-03 22:44:08 +01:00
72 changed files with 594 additions and 138 deletions

View File

@@ -91,7 +91,25 @@ The **Macro Core** documentation is created using [doxygen](http://www.doxygen.n
- version. The EARLIEST SAS version in which this macro is known to work.
- author. Author name, contact details optional
All macros must be commented in the doxygen format, to enable the [online documentation](https://sasjs.github.io/core.github.io/).
All macros must be commented in the doxygen format, to enable the [online documentation](https://core.sasjs.io).
### Dependencies
SAS code can contain one of two types of dependency - SAS Macros, and SAS Programs. When compiling projects using the [SASjs CLI](https://cli.sasjs.io) the doxygen header is scanned for ` @li` items under the following headers:
```
<h4> SAS Macros </h4>
@li mf_nobs.sas
@li mm_assignlib.sas
<h4> SAS Programs </h4>
@li somefile.ddl SOMEFREF
@li someprogram.sas FREFTWO
```
The CLI can then extract all the dependencies and insert as precode (SAS Macros) or in a temp engine fileref (SAS Programs) when creating SAS Jobs and Services.
When contributing to this library, it is therefore important to ensure that all dependencies are listed in the header in this format.
## Coding Standards
@@ -102,6 +120,7 @@ All macros must be commented in the doxygen format, to enable the [online docume
- Mandatory parameters should be positional, all optional parameters should be keyword (var=) style.
- All dataset references must be 2 level (eg `work.blah`, not `blah`). This is to avoid contention when options [DATASTMTCHK](https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000279064.htm)=ALLKEYWORDS is in effect.
- Avoid naming collisions! All macro variables should be local scope. Use system generated work tables where possible - eg `data ; set sashelp.class; run; data &output; set &syslast; run;`
- If you have a long-running SQL query, the use of a `quit;` statement is recommended in order to benefit from the timing statistics.
# General Notes

352
all.sas
View File

@@ -39,8 +39,8 @@ options noquotelenmax;
@version 9.2
@author Allan Bowe
@cond
**/
/** @cond */
%macro mf_abort(mac=mf_abort.sas, type=, msg=, iftrue=%str(1=1)
)/*/STORE SOURCE*/;
@@ -199,7 +199,7 @@ options noquotelenmax;
@return output returns 1 or 0 (or -1 if not found)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_getplatform.sas
@@ -270,7 +270,7 @@ options noquotelenmax;
%put %mf_existVarList(sashelp.class, age sex name dummyvar)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_abort.sas
@param libds 2 part dataset or view reference
@@ -278,6 +278,7 @@ options noquotelenmax;
@version 9.2
@author Allan Bowe
@cond
**/
%macro mf_existvarlist(libds, varlist
@@ -317,7 +318,9 @@ options noquotelenmax;
0
%put Vars not found: &found;
%end;
%mend;/**
%mend;
/** @endcond *//**
@file
@brief Returns a character attribute of a dataset.
@details Can be used in open code, eg as follows:
@@ -519,7 +522,7 @@ options noquotelenmax;
@param switch the param for which to return a platform specific variable
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_mval.sas
@li mf_trimstr.sas
@@ -633,6 +636,7 @@ options noquotelenmax;
@version 9.2
@author Allan Bowe
@cond
**/
%macro mf_getschema(libref
@@ -654,6 +658,8 @@ options noquotelenmax;
&schema
%mend;
/** @endcond */
/**
@file
@brief Assigns and returns an unused fileref
@@ -801,7 +807,7 @@ options noquotelenmax;
%put %mf_getvalue(sashelp.class,name,filter=%quote(age=15));
%put %mf_getvalue(sashelp.class,name);
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_getattrn.sas
@param libds dataset to query
@@ -1318,7 +1324,7 @@ Usage:
%put Number of observations=%mf_nobs(sashelp.class);
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_getattrn.sas
@param libds library.dataset
@@ -1345,7 +1351,7 @@ Usage:
%put %mf_trimstr(/blah/,h); * /blah/;
%put %mf_trimstr(/blah/,h/);* /bla;
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@param basestr The string to be modified
@@ -1416,7 +1422,7 @@ Usage:
Returns:
> 1
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_abort.sas
@param verifyvars space separated list of macro variable names
@@ -1529,11 +1535,11 @@ Usage:
the particulars of an environment. For instance, can stream custom
results back to the client in an STP Web App context, or completely stop
in the case of a batch run.
Using SAS Abort Cancel mechanisms can cause hung sessions in some Stored Process
environments. This macro takes a unique approach - we set the SAS syscc to 0,
run `stpsrvset('program error', 0)` (if SAS 9) and then - we open a macro
but don't close it! This provides a graceful abort for SAS web services in all
run `stpsrvset('program error', 0)` (if SAS 9) and then - we open a macro
but don't close it! This provides a graceful abort for SAS web services in all
web enabled environments.
@param mac= to contain the name of the calling macro
@@ -1542,6 +1548,7 @@ Usage:
@version 9.4M3
@author Allan Bowe
@cond
**/
%macro mp_abort(mac=mp_abort.sas, type=, msg=, iftrue=%str(1=1)
@@ -1554,7 +1561,7 @@ Usage:
%put NOTE - &msg;
/* Stored Process Server web app context */
%if %symexist(_metaperson)
%if %symexist(_metaperson)
or (%symexist(SYSPROCESSNAME) and "&SYSPROCESSNAME"="Compute Server" )
%then %do;
options obs=max replace nosyntaxcheck mprint;
@@ -1675,7 +1682,7 @@ Usage:
%end;
%mend;
/**
/** @endcond *//**
@file
@brief Copy any file using binary input / output streams
@details Reads in a file byte by byte and writes it back out. Is an
@@ -1739,6 +1746,7 @@ Usage:
applying CRLF line endings and converting embedded cr and crlf to lf.
usage:
fileref mycsv "/path/your/csv";
%mp_cleancsv(in=mycsv,out=/path/new.csv)
@@ -1748,6 +1756,7 @@ Usage:
@version 9.2
@author Allan Bowe
@cond
**/
%macro mp_cleancsv(in=NOTPROVIDED,out=NOTPROVIDED,qchar='22'x);
@@ -1796,7 +1805,8 @@ Usage:
else put inchar $char1.;
end;
run;
%mend;/**
%mend;
/** @endcond *//**
@file mp_createconstraints.sas
@brief Creates constraints
@details Takes the output from mp_getconstraints.sas as input
@@ -1820,7 +1830,7 @@ Usage:
@param outds= a table containing the create statements (create_statement column)
@param execute= `YES|NO` - default is NO. To actually create, use YES.
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@version 9.2
@author Allan Bowe
@@ -1890,7 +1900,7 @@ Usage:
;;;;
%mp_createwebservice(path=/Public/app/common,name=appInit,code=ft15f001,replace=YES)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_getplatform.sas
@li mm_createwebservice.sas
@li mv_createwebservice.sas
@@ -1976,7 +1986,7 @@ Usage:
@version 9.2
@author Allan Bowe
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_existds.sas
@@ -2365,7 +2375,7 @@ run;
create view view2 as select * from sashelp.class;
%mp_dropmembers(list=data1 view2)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_isblank.sas
@@ -2635,6 +2645,63 @@ quit;
%put NOTE-;%put NOTE-;
%put NOTE- %sysfunc(dequote(&cards_file.));
%put NOTE-;%put NOTE-;
%mend;/**
@file
@brief Export a dataset to a CSV file
@details Export to a file or a fileref
Usage:
%mp_ds2csv(sashelp.class,outref="%sysfunc(pathname(work))/file.csv")
@param ds The dataset to be exported
@param outfile= The output filename - should be quoted.
@param outref= The output fileref (takes precedence if provided)
@param outencoding= The output encoding to use (unquoted)
@version 9.2
@author Allan Bowe (credit mjsq)
**/
%macro mp_ds2csv(ds, outref=0, outfile=, outencoding=0
)/*/STORE SOURCE*/;
%if not %sysfunc(exist(&ds)) %then %do;
%put WARNING: &ds does not exist;
%return;
%end;
%if %index(&ds,.)=0 %then %let ds=WORK.&ds;
%if &outencoding=0 %then %let outencoding=;
%else %let outencoding=encoding="&outencoding";
%local outloc;
%if &outref=0 %then %let outloc=&outfile;
%else %let outloc=&outref;
/* credit to mjsq - https://stackoverflow.com/a/55642267 */
/* first get headers */
data _null_;
file &outloc dlm=',' dsd &outencoding lrecl=32767;
length header $ 2000;
dsid=open("&ds.","i");
num=attrn(dsid,"nvars");
do i=1 to num;
header = trim(left(coalescec(varlabel(dsid,i),varname(dsid,i))));
put header @;
end;
rc=close(dsid);
run;
/* next, export data */
data _null_;
set &ds.;
file &outloc mod dlm=',' dsd &outencoding lrecl=32767;
put (_all_) (+0);
run;
%mend;/**
@file mp_getconstraints.sas
@brief Get constraint details at column level
@@ -2658,7 +2725,7 @@ quit;
@param ds= The target dataset. Leave blank (default) for all datasets.
@param outds the output dataset
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@version 9.2
@author Allan Bowe
@@ -2712,6 +2779,8 @@ create table &outds as
You may need to adjust the rendered DBML to suit your needs.
![dbml for sas](https://i.imgur.com/8T1tIZp.gif)
<h4> SAS Macros </h4>
@li mf_getquotedstr.sas
@@ -3034,7 +3103,7 @@ run;
proc sql; describe table &syslast;
%mp_getddl(work,test,flavour=tsql,showlog=YES)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_getconstraints.sas
@param lib libref of the library to create DDL for. Should be assigned.
@@ -3391,7 +3460,7 @@ run;
@param libds Two part dataset (or view) reference.
@param outds= The output dataset to create
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_getvarlist.sas
@li mf_getvartype.sas
@li mf_getvarformat.sas
@@ -3463,7 +3532,7 @@ create table &outds (rename=(
@param min_rows= The minimum number of rows a table should have in order to try
and guess the PK. Default=5.
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_getvarlist.sas
@li mf_getuniquename.sas
@li mf_nobs.sas
@@ -3916,7 +3985,7 @@ create table &outds (rename=(
%mp_lib2cards(lib=sashelp
, outloc= C:\temp )
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_mkdir.sas
@li mp_ds2cards.sas
@@ -3997,6 +4066,93 @@ select distinct lowcase(memname)
,dttm=%sysfunc(datetime());
quit;
%mend;/**
@file
@brief Enables previous observations to be re-instated
@details Remembers the last X observations by storing them in a hash table.
Is a convenience over the use of lag() or retain, when an entire observation
needs to be restored.
This macro will also restore automatic variables (such as _n_ and _error_).
Example Usage:
data example;
set sashelp.class;
calc_var=_n_*3;
%* initialise hash and save from PDV ;
%mp_prevobs(INIT,history=2)
if _n_ =10 then do;
%* fetch previous but 1 record;
%mp_prevobs(FETCH,-2)
put _n_= name= age= calc_var=;
%* fetch previous record;
%mp_prevobs(FETCH,-1)
put _n_= name= age= calc_var=;
%* reinstate current record ;
%mp_prevobs(FETCH,0)
put _n_= name= age= calc_var=;
end;
run;
Result:
<img src="https://imgur.com/PSjHoET.png" alt="mp_prevobs sas" width="400"/>
Credit is made to `data _null_` for authoring this very helpful paper:
https://www.lexjansen.com/pharmasug/2008/cc/CC08.pdf
@param action Either FETCH a current or previous record, or INITialise.
@param record The relative (to current) position of the previous observation
to return.
@param history= The number of records to retain in the hash table. Default=5
@param prefix= the prefix to give to the variables used to store the hash name
and index. Default=mp_prevobs
@version 9.2
@author Allan Bowe
**/
%macro mp_prevobs(action,record,history=5,prefix=mp_prevobs
)/*/STORE SOURCE*/;
%let action=%upcase(&action);
%let prefix=%upcase(&prefix);
%let record=%eval((&record+0) * -1);
%if &action=INIT %then %do;
if _n_ eq 1 then do;
attrib &prefix._VAR length=$64;
dcl hash &prefix._HASH(ordered:'Y');
&prefix._KEY=0;
&prefix._HASH.defineKey("&prefix._KEY");
do while(1);
call vnext(&prefix._VAR);
if &prefix._VAR='' then leave;
if &prefix._VAR eq "&prefix._VAR" then continue;
else if &prefix._VAR eq "&prefix._KEY" then continue;
&prefix._HASH.defineData(&prefix._VAR);
end;
&prefix._HASH.defineDone();
end;
/* this part has to happen before FETCHing */
&prefix._KEY+1;
&prefix._rc=&prefix._HASH.add();
if &prefix._rc then putlog 'adding' &prefix._rc=;
%if &history>0 %then %do;
if &prefix._key>&history+1 then
&prefix._HASH.remove(key: &prefix._KEY - &history - 1);
if &prefix._rc then putlog 'removing' &prefix._rc=;
%end;
%end;
%else %if &action=FETCH %then %do;
if &record > &prefix._key then putlog "Not enough records in &Prefix._hash yet";
else &prefix._rc=&prefix._HASH.find(key: &prefix._KEY - &record);
if &prefix._rc then putlog &prefix._rc= " when fetching " &prefix._KEY=
"with record &record and " _n_=;
%end;
%mend;/**
@file
@brief Returns all children from a hierarchy table for a specified parent
@@ -4264,7 +4420,7 @@ proc sort; by descending sumcols memname libname; run;
@param outobs= set to a positive integer to restrict the number of observations
@param filter_text= add a (valid) filter clause to further filter the results
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_getvarlist.sas
@li mf_getvartype.sas
@li mf_mkdir.sas
@@ -4362,7 +4518,7 @@ proc sql
%mp_setkeyvalue(someindex,22,type=N)
%mp_setkeyvalue(somenewindex,somevalue)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_existds.sas
@param key Provide a key on which to perform the lookup
@@ -4490,7 +4646,7 @@ proc sql
%mp_streamfile(contenttype=csv,inloc=/some/where.txt,outname=myfile.txt)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_getplatform.sas
@li mp_binarycopy.sas
@@ -4598,6 +4754,64 @@ proc sql
%mp_binarycopy(inloc="&inloc",outref=_webout)
%end;
%mend;/**
@file mp_testwritespeedlibrary.sas
@brief Tests the write speed of a new table in a SAS library
@details Will create a new table of a certain size in an
existing SAS library. The table will have one column,
and will be subsequently deleted.
%mp_testwritespeedlibrary(
lib=work
,size=0.5
,outds=work.results
)
@param lib= (WORK) The library in which to create the table
@param size= (0.1) The size in GB of the table to create
@param outds= (WORK.RESULTS) The output dataset to be created.
<h4> SAS Macros </h4>
@li mf_getuniquename.sas
@li mf_existds.sas
@version 9.4
@author Allan Bowe
**/
%macro mp_testwritespeedlibrary(lib=WORK
,outds=work.results
,size=0.1
)/*/STORE SOURCE*/;
%local ds start;
/* find an unused, unique name for the new table */
%let ds=%mf_getuniquename();
%do %until(%mf_existds(&lib..&ds)=0);
%let ds=%mf_getuniquename();
%end;
%let start=%sysfunc(datetime());
data &lib..&ds(compress=no keep=x);
header=128*1024;
size=(1073741824/8 * &size) - header;
do x=1 to size;
output;
end;
run;
proc sql;
drop table &lib..&ds;
data &outds;
lib="&lib";
start_dttm=put(&start,datetime19.);
end_dttm=put(datetime(),datetime19.);
duration_seconds=end_dttm-start_dttm;
run;
%mend;/**
@file
@brief Recursively scans a directory tree to get all subfolders and content
@@ -4679,7 +4893,7 @@ run;
%mp_unzip(ziploc="/some/file.zip",outdir=/some/folder)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_mkdir.sas
@li mf_getuniquefileref.sas
@@ -4750,7 +4964,7 @@ run;
@param var The variable to modify
@param len The new length to apply
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_existds.sas
@li mp_abort.sas
@li mf_existvar.sas
@@ -4837,7 +5051,7 @@ alter table &libds modify &var char(&len);
be sure that _debug is not set (else the SPWA will send non zipped content
as well).
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_dirlist.sas
@param in= unquoted filepath, dataset of files or directory to zip
@@ -5014,7 +5228,7 @@ filename __us2grp clear;
disconnect from MyAlias;
quit;
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_getengine.sas
@li mp_abort.sas
@@ -5462,7 +5676,7 @@ run;
%mm_assignlib(SOMEREF)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@param libref the libref (not name) of the metadata library
@@ -5543,7 +5757,7 @@ run;
@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> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_verifymacvars.sas
@@ -5698,7 +5912,7 @@ run;
%mm_createdataset(tableuri=G5X8AFW1.BE00015Y)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mm_getlibs.sas
@li mm_gettables.sas
@li mm_getcols.sas
@@ -5774,7 +5988,7 @@ run;
%mm_createdocument(tree=/User Folders/sasdemo
,name=MyNote)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_verifymacvars.sas
@@ -6063,7 +6277,7 @@ run;
,directory=/tmp/tests
,mDebug=1)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_verifymacvars.sas
@li mm_createfolder.sas
@@ -6404,7 +6618,7 @@ filename &frefout temp;
,Server=SASApp
,stptype=2)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_nobs.sas
@li mf_verifymacvars.sas
@li mm_getdirectories.sas
@@ -6777,7 +6991,7 @@ Usage:
;;;;
%mm_createwebservice(path=/Public/app/common,name=appInit,code=ft15f001,replace=YES)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mm_createstp.sas
@li mf_getuser.sas
@li mm_createfolder.sas
@@ -7168,7 +7382,7 @@ run;
%mm_createdocument(tree=/User Folders/&sysuserid,name=MyNote)
%mm_deletedocument(target=/User Folders/&sysuserid/MyNote)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@param target= full path to the document being deleted
@@ -7238,7 +7452,7 @@ run;
%mm_deletestp(target=/some/meta/path/myStoredProcess)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@param target= full path to the STP being deleted
@@ -7308,7 +7522,7 @@ run;
@param outds= the ONE LEVEL work dataset to create
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mm_getobjects.sas
@li mf_getuniquefileref.sas
@li mm_getdetails.sas
@@ -7598,7 +7812,7 @@ run;
,outref=/some/unquoted/filename.ext
)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@param tree= The metadata path of the document
@@ -7747,7 +7961,7 @@ filename __outdoc clear;
@param outds= the dataset to create that contains the list of directories
@param mDebug= set to 1 to show debug messages in the log
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@version 9.4
@author Allan Bowe
@@ -8434,7 +8648,7 @@ libname _XML_ clear;
filename __mc2 clear;
libname __mc3 clear;
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mm_getrepos.sas
@version 9.3
@@ -8673,7 +8887,7 @@ filename __outdoc clear;
%mm_getstps(tree=/My Folder/My STPs, name=My STP)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mm_gettree.sas
@param tree= the metadata folder location in which to search. Leave blank
@@ -9341,7 +9555,7 @@ filename __shake clear;
./mmscript.sh "myuser" "mypass"
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_loc.sas
@li mm_tree.sas
@li mf_getuniquefileref.sas
@@ -9461,7 +9675,7 @@ run;
Table
,outds=morestuff)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_getquotedstr.sas
@li mm_getpublictypes.sas
@li mf_isblank.sas
@@ -9842,7 +10056,7 @@ run;
%mm_updatestpservertype(target=/some/meta/path/myStoredProcess
,type=WKS)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@param target= full path to the STP being deleted
@param type= Either WKS or STP depending on whether Workspace or Stored Process
@@ -10198,7 +10412,7 @@ run;
%mmx_deletemetafolder(loc=/some/meta/folder,user=sasdemo,pass=mars345)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_loc.sas
@param loc= the metadata folder to delete
@@ -10253,7 +10467,7 @@ Usage:
,outspkpath=%str(/tmp)
)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_loc.sas
@li mm_tree.sas
@li mf_getuniquefileref.sas
@@ -10335,7 +10549,7 @@ run;
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getuniquefileref.sas
@li mf_getuniquelibref.sas
@@ -10498,7 +10712,7 @@ options noquotelenmax;
To minimise postgres requests, output json is stored in a temporary file
and then sent to _webout in one go at the end.
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mv_createfolder.sas
@li mf_getuniquelibref.sas
@@ -11148,7 +11362,7 @@ run;
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas
@@ -11297,7 +11511,7 @@ libname &libref1a clear;
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas
@@ -11441,7 +11655,7 @@ libname &libref1a clear;
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas
@@ -11569,7 +11783,7 @@ libname &libref1 clear;
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mv_tokenrefresh.sas
**/
@@ -11600,7 +11814,7 @@ libname &libref1 clear;
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mv_registerclient.sas
**/
@@ -11648,7 +11862,7 @@ libname &libref1 clear;
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas
@@ -11734,7 +11948,7 @@ libname &libref1 clear;
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas
@@ -11867,7 +12081,7 @@ libname &libref1 clear;
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas
@@ -11971,7 +12185,7 @@ filename &fname1 clear;
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas
@@ -12041,7 +12255,7 @@ libname &libref1 clear;
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mv_tokenauth.sas
**/
@@ -12090,7 +12304,7 @@ libname &libref1 clear;
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas
@@ -12208,7 +12422,7 @@ libname &libref1 clear;
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas
@@ -12319,7 +12533,7 @@ libname &libref1 clear;
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas
@@ -12495,7 +12709,7 @@ libname &libref;
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas
@@ -12718,7 +12932,7 @@ libname &libref clear;
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas
@@ -12860,7 +13074,7 @@ filename &fref2 clear;
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas
@@ -12975,7 +13189,7 @@ filename &fref1 clear;
@param dslabel= value to use instead of the real name for sending to JSON
@param fmt= change to N to strip formats from output
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_jsonout.sas
@li mf_getuser.sas

View File

@@ -21,8 +21,8 @@
@version 9.2
@author Allan Bowe
@cond
**/
/** @cond */
%macro mf_abort(mac=mf_abort.sas, type=, msg=, iftrue=%str(1=1)
)/*/STORE SOURCE*/;

View File

@@ -13,7 +13,7 @@
@return output returns 1 or 0 (or -1 if not found)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_getplatform.sas

View File

@@ -6,7 +6,7 @@
%put %mf_existVarList(sashelp.class, age sex name dummyvar)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_abort.sas
@param libds 2 part dataset or view reference
@@ -14,6 +14,7 @@
@version 9.2
@author Allan Bowe
@cond
**/
%macro mf_existvarlist(libds, varlist
@@ -53,4 +54,6 @@
0
%put Vars not found: &found;
%end;
%mend;
%mend;
/** @endcond */

View File

@@ -10,7 +10,7 @@
@param switch the param for which to return a platform specific variable
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_mval.sas
@li mf_trimstr.sas

View File

@@ -17,6 +17,7 @@
@version 9.2
@author Allan Bowe
@cond
**/
%macro mf_getschema(libref
@@ -38,3 +39,5 @@
&schema
%mend;
/** @endcond */

View File

@@ -7,7 +7,7 @@
%put %mf_getvalue(sashelp.class,name,filter=%quote(age=15));
%put %mf_getvalue(sashelp.class,name);
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_getattrn.sas
@param libds dataset to query

View File

@@ -6,7 +6,7 @@
%put Number of observations=%mf_nobs(sashelp.class);
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_getattrn.sas
@param libds library.dataset

View File

@@ -8,7 +8,7 @@
%put %mf_trimstr(/blah/,h); * /blah/;
%put %mf_trimstr(/blah/,h/);* /bla;
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@param basestr The string to be modified

View File

@@ -11,7 +11,7 @@
Returns:
> 1
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_abort.sas
@param verifyvars space separated list of macro variable names

View File

@@ -5,11 +5,11 @@
the particulars of an environment. For instance, can stream custom
results back to the client in an STP Web App context, or completely stop
in the case of a batch run.
Using SAS Abort Cancel mechanisms can cause hung sessions in some Stored Process
environments. This macro takes a unique approach - we set the SAS syscc to 0,
run `stpsrvset('program error', 0)` (if SAS 9) and then - we open a macro
but don't close it! This provides a graceful abort for SAS web services in all
run `stpsrvset('program error', 0)` (if SAS 9) and then - we open a macro
but don't close it! This provides a graceful abort for SAS web services in all
web enabled environments.
@param mac= to contain the name of the calling macro
@@ -18,6 +18,7 @@
@version 9.4M3
@author Allan Bowe
@cond
**/
%macro mp_abort(mac=mp_abort.sas, type=, msg=, iftrue=%str(1=1)
@@ -30,7 +31,7 @@
%put NOTE - &msg;
/* Stored Process Server web app context */
%if %symexist(_metaperson)
%if %symexist(_metaperson)
or (%symexist(SYSPROCESSNAME) and "&SYSPROCESSNAME"="Compute Server" )
%then %do;
options obs=max replace nosyntaxcheck mprint;
@@ -151,3 +152,4 @@
%end;
%mend;
/** @endcond */

View File

@@ -8,6 +8,7 @@
applying CRLF line endings and converting embedded cr and crlf to lf.
usage:
fileref mycsv "/path/your/csv";
%mp_cleancsv(in=mycsv,out=/path/new.csv)
@@ -17,6 +18,7 @@
@version 9.2
@author Allan Bowe
@cond
**/
%macro mp_cleancsv(in=NOTPROVIDED,out=NOTPROVIDED,qchar='22'x);
@@ -65,4 +67,5 @@
else put inchar $char1.;
end;
run;
%mend;
%mend;
/** @endcond */

View File

@@ -22,7 +22,7 @@
@param outds= a table containing the create statements (create_statement column)
@param execute= `YES|NO` - default is NO. To actually create, use YES.
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@version 9.2
@author Allan Bowe

View File

@@ -26,7 +26,7 @@ Usage:
;;;;
%mp_createwebservice(path=/Public/app/common,name=appInit,code=ft15f001,replace=YES)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_getplatform.sas
@li mm_createwebservice.sas
@li mv_createwebservice.sas

View File

@@ -29,7 +29,7 @@
@version 9.2
@author Allan Bowe
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_existds.sas

View File

@@ -9,7 +9,7 @@
create view view2 as select * from sashelp.class;
%mp_dropmembers(list=data1 view2)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_isblank.sas

58
base/mp_ds2csv.sas Normal file
View File

@@ -0,0 +1,58 @@
/**
@file
@brief Export a dataset to a CSV file
@details Export to a file or a fileref
Usage:
%mp_ds2csv(sashelp.class,outref="%sysfunc(pathname(work))/file.csv")
@param ds The dataset to be exported
@param outfile= The output filename - should be quoted.
@param outref= The output fileref (takes precedence if provided)
@param outencoding= The output encoding to use (unquoted)
@version 9.2
@author Allan Bowe (credit mjsq)
**/
%macro mp_ds2csv(ds, outref=0, outfile=, outencoding=0
)/*/STORE SOURCE*/;
%if not %sysfunc(exist(&ds)) %then %do;
%put WARNING: &ds does not exist;
%return;
%end;
%if %index(&ds,.)=0 %then %let ds=WORK.&ds;
%if &outencoding=0 %then %let outencoding=;
%else %let outencoding=encoding="&outencoding";
%local outloc;
%if &outref=0 %then %let outloc=&outfile;
%else %let outloc=&outref;
/* credit to mjsq - https://stackoverflow.com/a/55642267 */
/* first get headers */
data _null_;
file &outloc dlm=',' dsd &outencoding lrecl=32767;
length header $ 2000;
dsid=open("&ds.","i");
num=attrn(dsid,"nvars");
do i=1 to num;
header = trim(left(coalescec(varlabel(dsid,i),varname(dsid,i))));
put header @;
end;
rc=close(dsid);
run;
/* next, export data */
data _null_;
set &ds.;
file &outloc mod dlm=',' dsd &outencoding lrecl=32767;
put (_all_) (+0);
run;
%mend;

View File

@@ -21,7 +21,7 @@
@param ds= The target dataset. Leave blank (default) for all datasets.
@param outds the output dataset
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@version 9.2
@author Allan Bowe

View File

@@ -16,6 +16,8 @@
You may need to adjust the rendered DBML to suit your needs.
![dbml for sas](https://i.imgur.com/8T1tIZp.gif)
<h4> SAS Macros </h4>
@li mf_getquotedstr.sas

View File

@@ -15,7 +15,7 @@
proc sql; describe table &syslast;
%mp_getddl(work,test,flavour=tsql,showlog=YES)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_getconstraints.sas
@param lib libref of the library to create DDL for. Should be assigned.

View File

@@ -21,7 +21,7 @@
@param libds Two part dataset (or view) reference.
@param outds= The output dataset to create
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_getvarlist.sas
@li mf_getvartype.sas
@li mf_getvarformat.sas

View File

@@ -22,7 +22,7 @@
@param min_rows= The minimum number of rows a table should have in order to try
and guess the PK. Default=5.
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_getvarlist.sas
@li mf_getuniquename.sas
@li mf_nobs.sas

View File

@@ -8,7 +8,7 @@
%mp_lib2cards(lib=sashelp
, outloc= C:\temp )
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_mkdir.sas
@li mp_ds2cards.sas

88
base/mp_prevobs.sas Normal file
View File

@@ -0,0 +1,88 @@
/**
@file
@brief Enables previous observations to be re-instated
@details Remembers the last X observations by storing them in a hash table.
Is a convenience over the use of lag() or retain, when an entire observation
needs to be restored.
This macro will also restore automatic variables (such as _n_ and _error_).
Example Usage:
data example;
set sashelp.class;
calc_var=_n_*3;
%* initialise hash and save from PDV ;
%mp_prevobs(INIT,history=2)
if _n_ =10 then do;
%* fetch previous but 1 record;
%mp_prevobs(FETCH,-2)
put _n_= name= age= calc_var=;
%* fetch previous record;
%mp_prevobs(FETCH,-1)
put _n_= name= age= calc_var=;
%* reinstate current record ;
%mp_prevobs(FETCH,0)
put _n_= name= age= calc_var=;
end;
run;
Result:
<img src="https://imgur.com/PSjHoET.png" alt="mp_prevobs sas" width="400"/>
Credit is made to `data _null_` for authoring this very helpful paper:
https://www.lexjansen.com/pharmasug/2008/cc/CC08.pdf
@param action Either FETCH a current or previous record, or INITialise.
@param record The relative (to current) position of the previous observation
to return.
@param history= The number of records to retain in the hash table. Default=5
@param prefix= the prefix to give to the variables used to store the hash name
and index. Default=mp_prevobs
@version 9.2
@author Allan Bowe
**/
%macro mp_prevobs(action,record,history=5,prefix=mp_prevobs
)/*/STORE SOURCE*/;
%let action=%upcase(&action);
%let prefix=%upcase(&prefix);
%let record=%eval((&record+0) * -1);
%if &action=INIT %then %do;
if _n_ eq 1 then do;
attrib &prefix._VAR length=$64;
dcl hash &prefix._HASH(ordered:'Y');
&prefix._KEY=0;
&prefix._HASH.defineKey("&prefix._KEY");
do while(1);
call vnext(&prefix._VAR);
if &prefix._VAR='' then leave;
if &prefix._VAR eq "&prefix._VAR" then continue;
else if &prefix._VAR eq "&prefix._KEY" then continue;
&prefix._HASH.defineData(&prefix._VAR);
end;
&prefix._HASH.defineDone();
end;
/* this part has to happen before FETCHing */
&prefix._KEY+1;
&prefix._rc=&prefix._HASH.add();
if &prefix._rc then putlog 'adding' &prefix._rc=;
%if &history>0 %then %do;
if &prefix._key>&history+1 then
&prefix._HASH.remove(key: &prefix._KEY - &history - 1);
if &prefix._rc then putlog 'removing' &prefix._rc=;
%end;
%end;
%else %if &action=FETCH %then %do;
if &record > &prefix._key then putlog "Not enough records in &Prefix._hash yet";
else &prefix._rc=&prefix._HASH.find(key: &prefix._KEY - &record);
if &prefix._rc then putlog &prefix._rc= " when fetching " &prefix._KEY=
"with record &record and " _n_=;
%end;
%mend;

View File

@@ -25,7 +25,7 @@
@param outobs= set to a positive integer to restrict the number of observations
@param filter_text= add a (valid) filter clause to further filter the results
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_getvarlist.sas
@li mf_getvartype.sas
@li mf_mkdir.sas

View File

@@ -6,7 +6,7 @@
%mp_setkeyvalue(someindex,22,type=N)
%mp_setkeyvalue(somenewindex,somevalue)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_existds.sas
@param key Provide a key on which to perform the lookup

View File

@@ -11,7 +11,7 @@
%mp_streamfile(contenttype=csv,inloc=/some/where.txt,outname=myfile.txt)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_getplatform.sas
@li mp_binarycopy.sas

View File

@@ -0,0 +1,59 @@
/**
@file mp_testwritespeedlibrary.sas
@brief Tests the write speed of a new table in a SAS library
@details Will create a new table of a certain size in an
existing SAS library. The table will have one column,
and will be subsequently deleted.
%mp_testwritespeedlibrary(
lib=work
,size=0.5
,outds=work.results
)
@param lib= (WORK) The library in which to create the table
@param size= (0.1) The size in GB of the table to create
@param outds= (WORK.RESULTS) The output dataset to be created.
<h4> SAS Macros </h4>
@li mf_getuniquename.sas
@li mf_existds.sas
@version 9.4
@author Allan Bowe
**/
%macro mp_testwritespeedlibrary(lib=WORK
,outds=work.results
,size=0.1
)/*/STORE SOURCE*/;
%local ds start;
/* find an unused, unique name for the new table */
%let ds=%mf_getuniquename();
%do %until(%mf_existds(&lib..&ds)=0);
%let ds=%mf_getuniquename();
%end;
%let start=%sysfunc(datetime());
data &lib..&ds(compress=no keep=x);
header=128*1024;
size=(1073741824/8 * &size) - header;
do x=1 to size;
output;
end;
run;
proc sql;
drop table &lib..&ds;
data &outds;
lib="&lib";
start_dttm=put(&start,datetime19.);
end_dttm=put(datetime(),datetime19.);
duration_seconds=end_dttm-start_dttm;
run;
%mend;

View File

@@ -12,7 +12,7 @@
%mp_unzip(ziploc="/some/file.zip",outdir=/some/folder)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_mkdir.sas
@li mf_getuniquefileref.sas

View File

@@ -18,7 +18,7 @@
@param var The variable to modify
@param len The new length to apply
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_existds.sas
@li mp_abort.sas
@li mf_existvar.sas

View File

@@ -12,7 +12,7 @@
be sure that _debug is not set (else the SPWA will send non zipped content
as well).
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_dirlist.sas
@param in= unquoted filepath, dataset of files or directory to zip

View File

@@ -13,6 +13,11 @@
* Not metadata aware
* No X command
* Prefixes: _mf_, _mp_
Macros starting `mf_` are macro _functions_ and can be used in assignment
statements. Those starting `mp_` are macro _procedures_, which generate
SAS statements, and must therefore be applied accordingly.
*/
/*! \dir meta

View File

@@ -14,7 +14,7 @@
disconnect from MyAlias;
quit;
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_getengine.sas
@li mp_abort.sas

View File

@@ -10,7 +10,7 @@
%mm_assignlib(SOMEREF)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@param libref the libref (not name) of the metadata library

View File

@@ -15,7 +15,7 @@
@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> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_verifymacvars.sas

View File

@@ -18,7 +18,7 @@
%mm_createdataset(tableuri=G5X8AFW1.BE00015Y)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mm_getlibs.sas
@li mm_gettables.sas
@li mm_getcols.sas

View File

@@ -12,7 +12,7 @@
%mm_createdocument(tree=/User Folders/sasdemo
,name=MyNote)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_verifymacvars.sas

View File

@@ -19,7 +19,7 @@
,directory=/tmp/tests
,mDebug=1)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_verifymacvars.sas
@li mm_createfolder.sas

View File

@@ -39,7 +39,7 @@
,Server=SASApp
,stptype=2)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_nobs.sas
@li mf_verifymacvars.sas
@li mm_getdirectories.sas

View File

@@ -24,7 +24,7 @@ Usage:
;;;;
%mm_createwebservice(path=/Public/app/common,name=appInit,code=ft15f001,replace=YES)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mm_createstp.sas
@li mf_getuser.sas
@li mm_createfolder.sas

View File

@@ -8,7 +8,7 @@
%mm_createdocument(tree=/User Folders/&sysuserid,name=MyNote)
%mm_deletedocument(target=/User Folders/&sysuserid/MyNote)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@param target= full path to the document being deleted

View File

@@ -7,7 +7,7 @@
%mm_deletestp(target=/some/meta/path/myStoredProcess)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@param target= full path to the STP being deleted

View File

@@ -7,7 +7,7 @@
@param outds= the ONE LEVEL work dataset to create
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mm_getobjects.sas
@li mf_getuniquefileref.sas
@li mm_getdetails.sas

View File

@@ -11,7 +11,7 @@
,outref=/some/unquoted/filename.ext
)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@param tree= The metadata path of the document

View File

@@ -14,7 +14,7 @@
@param outds= the dataset to create that contains the list of directories
@param mDebug= set to 1 to show debug messages in the log
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@version 9.4
@author Allan Bowe

View File

@@ -14,7 +14,7 @@
filename __mc2 clear;
libname __mc3 clear;
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mm_getrepos.sas
@version 9.3

View File

@@ -14,7 +14,7 @@
%mm_getstps(tree=/My Folder/My STPs, name=My STP)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mm_gettree.sas
@param tree= the metadata folder location in which to search. Leave blank

View File

@@ -45,7 +45,7 @@
./mmscript.sh "myuser" "mypass"
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_loc.sas
@li mm_tree.sas
@li mf_getuniquefileref.sas

View File

@@ -46,7 +46,7 @@
Table
,outds=morestuff)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_getquotedstr.sas
@li mm_getpublictypes.sas
@li mf_isblank.sas

View File

@@ -8,7 +8,7 @@
%mm_updatestpservertype(target=/some/meta/path/myStoredProcess
,type=WKS)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@param target= full path to the STP being deleted
@param type= Either WKS or STP depending on whether Workspace or Stored Process

View File

@@ -9,7 +9,7 @@
%mmx_deletemetafolder(loc=/some/meta/folder,user=sasdemo,pass=mars345)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_loc.sas
@param loc= the metadata folder to delete

View File

@@ -25,7 +25,7 @@ Usage:
,outspkpath=%str(/tmp)
)
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mf_loc.sas
@li mm_tree.sas
@li mf_getuniquefileref.sas

View File

@@ -17,7 +17,7 @@
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getuniquefileref.sas
@li mf_getuniquelibref.sas

View File

@@ -29,7 +29,7 @@
To minimise postgres requests, output json is stored in a temporary file
and then sent to _webout in one go at the end.
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mv_createfolder.sas
@li mf_getuniquelibref.sas

View File

@@ -22,7 +22,7 @@
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas

View File

@@ -21,7 +21,7 @@
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas

View File

@@ -18,7 +18,7 @@
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas

View File

@@ -5,7 +5,7 @@
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mv_tokenrefresh.sas
**/

View File

@@ -5,7 +5,7 @@
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mv_registerclient.sas
**/

View File

@@ -31,7 +31,7 @@
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas

View File

@@ -17,7 +17,7 @@
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas

View File

@@ -32,7 +32,7 @@
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas

View File

@@ -31,7 +31,7 @@
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas

View File

@@ -5,7 +5,7 @@
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mv_tokenauth.sas
**/

View File

@@ -22,7 +22,7 @@
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas

View File

@@ -49,7 +49,7 @@
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas

View File

@@ -45,7 +45,7 @@
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas

View File

@@ -54,7 +54,7 @@
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas

View File

@@ -43,7 +43,7 @@
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas

View File

@@ -42,7 +42,7 @@
@version VIYA V.03.04
@author Allan Bowe, source: https://github.com/sasjs/core
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_abort.sas
@li mf_getplatform.sas
@li mf_getuniquefileref.sas

View File

@@ -27,7 +27,7 @@
@param dslabel= value to use instead of the real name for sending to JSON
@param fmt= change to N to strip formats from output
<h4> Dependencies </h4>
<h4> SAS Macros </h4>
@li mp_jsonout.sas
@li mf_getuser.sas