Compare commits
40 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f950e11ce | ||
|
|
96247523ba | ||
|
|
425f7b389c | ||
|
|
56748bc44b | ||
|
|
96fa16078c | ||
|
|
dc7f8cee19 | ||
|
|
9b76f52b78 | ||
|
|
c40c0bd9dc | ||
|
|
ba2ca42015 | ||
|
|
55b7b507cf | ||
|
|
b47b1fb536 | ||
|
|
73f0ba2d4c | ||
|
|
c38cb1e70d | ||
|
|
0a738cc639 | ||
|
|
3cf49b5221 | ||
|
|
8638902ec3 | ||
|
|
7aca779d60 | ||
|
|
ca3a001f65 | ||
|
|
fa2d53eaf8 | ||
|
|
bd81f5d36e | ||
|
|
96c8234a58 | ||
|
|
669a8e0a1d | ||
|
|
b48260977b | ||
|
|
92dc813146 | ||
|
|
c5756d3979 | ||
|
|
9c9ebe63d1 | ||
|
|
5be2d8c76c | ||
|
|
ee5d4de333 | ||
|
|
c4bb3ec6a6 | ||
|
|
d43db77a45 | ||
|
|
7b99a5651d | ||
|
|
7e5c98976b | ||
|
|
9f4143af53 | ||
|
|
bd8e378829 | ||
|
|
dc3bedae3f | ||
|
|
af94d49a79 | ||
|
|
4069f066aa | ||
|
|
266a1fe1a7 | ||
|
|
3111b6667e | ||
|
|
e3b86f1157 |
39
README.md
@@ -10,11 +10,13 @@ The *purpose of a package* is to be a simple, and easy to access, code sharing m
|
||||
|
||||
In this repository we are presenting the **SAS Packages Framework** which allows to develop and use SAS packages.
|
||||
|
||||
Don't forget to **STAR** (:star:) the repository! :-)
|
||||
|
||||
---
|
||||
|
||||
### Current version:
|
||||
|
||||
**The latest version** of SPF is **`20230904`**.
|
||||
**The latest version** of SPF is **`20240711`**.
|
||||
|
||||
To get started with SAS Packages try this [**`Getting Started with SAS Packages`**](https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/Documentation/Getting_Started_with_SAS_Packages.pdf "Getting Started with SAS Packages") presentation (see the `./SPF/Documentation` directory).
|
||||
|
||||
@@ -37,6 +39,21 @@ Videos presenting the SPF and packages, from various conferences and meetups (th
|
||||
- ["SAS Packages Framework - an easy code sharing medium for SAS" - Warsaw IT Days 2023](https://youtu.be/T52Omisi0dk&t=0s "Warsaw IT Days 2023") (March 31st 2023, ~60 minutes, general overview with technical details for user and developer)
|
||||
|
||||
|
||||
### Tutorials:
|
||||
|
||||
Here are links to some tutorials which may help you to start with the framework.
|
||||
Order is dictated by the amount of details presented.
|
||||
Letter "D" indicates tutorial dedicated for developers and "U" materials for users.
|
||||
|
||||
1) (DU) The latest [video](https://youtu.be/T52Omisi0dk&t=0s) explaining the idea.
|
||||
|
||||
2) (D) Very simple ["Hello World" example](https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/Documentation/HelloWorldPackage.md) tutorial for developers. As a support a [walk-through video](https://youtu.be/T52Omisi0dk&t=2160s)
|
||||
|
||||
3) (D) Article and all required materials for ["My first SAS Package"](https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation/Paper_1079-2021) tutorial.
|
||||
|
||||
4) (DU) Materials from Hands-on-Workshop (4+ hours) tutorial: [Share your code with SAS Packages](https://github.com/yabwon/HoW-SASPackages).
|
||||
|
||||
|
||||
---
|
||||
|
||||
### Initiative to add SAS Packages Framework to SAS Base/Viya:
|
||||
@@ -146,9 +163,13 @@ The SAS Packages Framework [(short) documentation](https://github.com/yabwon/SAS
|
||||
|
||||
### Updates worth mentioning:
|
||||
|
||||
**Update**\[February 7th, 2023\]**:** `ADDCNT` ** type for *additional content* feature and ** `%loadPackageAddCnt()` **macro added to the framework. (see [here](https://github.com/yabwon/SAS_PACKAGES/releases/tag/20230207 "Additional Content"))**.
|
||||
**Update**\[December 10th, 2023\]**:** `markdownDoc=` **parameter added to** `%generatePackage()` **macro, which allows to generate markdown file with documentation. Content is taken from the help information notes and the description. (see [here](https://github.com/yabwon/SAS_PACKAGES/releases/tag/20231210 "markdown documentation"))**.
|
||||
|
||||
**Update**\[December 12th, 2022\]**:** `CASLUDF` ** type for CASL user defined functions added to the framework. Utility macros for for loading content in proc IML and proc CAS added. (see [here](https://github.com/yabwon/SAS_PACKAGES/releases/tag/20221212 "New Type and Utility macros"))**.
|
||||
**Update**\[November 11th, 2023\]**:** `KMFSNIP` **type for *key macro abbreviations* snippets added to the framework. (see [here](https://github.com/yabwon/SAS_PACKAGES/releases/tag/20231111 "KMF-abbreviations"))**.
|
||||
|
||||
**Update**\[February 7th, 2023\]**:** `ADDCNT` **type for *additional content* feature and ** `%loadPackageAddCnt()` **macro added to the framework. (see [here](https://github.com/yabwon/SAS_PACKAGES/releases/tag/20230207 "Additional Content"))**.
|
||||
|
||||
**Update**\[December 12th, 2022\]**:** `CASLUDF` **type for CASL user defined functions added to the framework. Utility macros for for loading content in proc IML and proc CAS added. (see [here](https://github.com/yabwon/SAS_PACKAGES/releases/tag/20221212 "New Type and Utility macros"))**.
|
||||
|
||||
**Update**\[November 21st, 2022\]**:** `%loadPackage()` **macro allows Cherry Picking of content (see [here](https://github.com/yabwon/SAS_PACKAGES/releases/tag/20221121 "Cherry Picking"))**.
|
||||
|
||||
@@ -174,15 +195,19 @@ This is a list of locations where the SAS Packages Framework is used:
|
||||
|
||||
If you want to share that you are using the SPF let me know and I'll update the list.
|
||||
|
||||
If you find the SPF useful **share info** about it or **give it a [star](https://github.com/yabwon/SAS_PACKAGES/stargazers)** so more people will know.
|
||||
If you find the SPF useful **share info** about it or **give it a [star (:star:)](https://github.com/yabwon/SAS_PACKAGES/stargazers)** so more people will know.
|
||||
|
||||
---
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## Available packages:
|
||||
|
||||
This section presents some example of available SAS packages.
|
||||
This section presents some examples of available SAS packages.
|
||||
|
||||
**(!)** Since *September 2022* the default location for packages is **SASPAC - the SAS Packages Archive** located under: [`https://github.com/SASPAC`](https://github.com/SASPAC) where each package is stored as a separate repository with historical versions too.
|
||||
**(!)** Since *September 2022* the default and **official** location for packages is **SASPAC - the SAS Packages Archive** located under: [`https://github.com/SASPAC`](https://github.com/SASPAC) where each package is stored as a separate repository with historical versions.
|
||||
|
||||
**(!)** For "backward compatibility"/historical point of view the following packages are also available under the `./packages` directory in this repository.
|
||||
|
||||
@@ -223,4 +248,4 @@ Packages:
|
||||
|
||||
Development of this package is currently on hold.
|
||||
|
||||
### ======
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
|
||||
## The "Hello World" Package
|
||||
|
||||
---
|
||||
@@ -40,7 +40,9 @@ If it was - then continue.
|
||||
|
||||
```sas
|
||||
/*** HELP START ***//*
|
||||
This is a help info for the HelloWorldFormat. format
|
||||
This is a help info for the `HelloWorldFormat.` format.
|
||||
|
||||
Category *other* is marked with exclamation mark (`!`).
|
||||
*//*** HELP END ***/
|
||||
|
||||
value HelloWorldFormat
|
||||
@@ -57,7 +59,11 @@ value HelloWorldFormat
|
||||
into that file:
|
||||
```sas
|
||||
/*** HELP START ***//*
|
||||
This is a help info for the helloWorldMacro() macro
|
||||
This is a help info for the `%helloWorldMacro()` macro.
|
||||
|
||||
Macro has the following parameter(s):
|
||||
- `n` - *Required*, provides number of loop iterations.
|
||||
|
||||
*//*** HELP END ***/
|
||||
|
||||
%macro HelloWorldMacro(n);
|
||||
@@ -86,10 +92,12 @@ Encoding: UTF8
|
||||
Required: "Base SAS Software"
|
||||
|
||||
DESCRIPTION START:
|
||||
## My "Hello World" SAS package ##
|
||||
### My "Hello World" SAS package ###
|
||||
|
||||
The "Hello World" is my first SAS package and
|
||||
for sure it will not be the last package one!
|
||||
|
||||
Using packages is a good idea!
|
||||
DESCRIPTION END:
|
||||
```
|
||||
|
||||
@@ -107,13 +115,14 @@ DESCRIPTION END:
|
||||
```sas
|
||||
%generatePackage(
|
||||
filesLocation=<put/folder/from/the/step/three/here>
|
||||
,markdownDoc=1
|
||||
)
|
||||
```
|
||||
|
||||
`Step 10.` See the information in the output window and in the log.
|
||||
The `WARNING:[License] No license.sas file provided, default (MIT) licence file will be generated.` can be ignored.
|
||||
|
||||
`Step 11.` Check the directory from the `Step 3.` and look for the `helloworld.zip` package file.
|
||||
`Step 11.` Check the directory from the `Step 3.` and look for the `helloworld.zip` package file and `helloworld.md` documentation file.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
when empty the "packages" value is used */
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to list directories pointed by "packages" fileref, version 20230904. Run %extendPackagesFileref(HELP) for help info.'
|
||||
des = 'Macro to list directories pointed by "packages" fileref, version 20240711. Run %extendPackagesFileref(HELP) for help info.'
|
||||
;
|
||||
|
||||
%if %QUPCASE(&packages.) = HELP %then
|
||||
@@ -22,14 +22,14 @@ des = 'Macro to list directories pointed by "packages" fileref, version 20230904
|
||||
%put ### This is short help information for the `extendPackagesFileref` macro #;
|
||||
%put #-----------------------------------------------------------------------------------------#;;
|
||||
%put # #;
|
||||
%put # Macro to list directories pointed by 'packages' fileref, version `20230904` #;
|
||||
%put # Macro to list directories pointed by 'packages' fileref, version `20240711` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
%put # data, etc.) wrapped up together and embedded inside the zip. #;
|
||||
%put # #;
|
||||
%put # The `%nrstr(%%extendPackagesFileref())` macro lists directories pointed by #;
|
||||
%put # the packages fileref. It allows to add new dierctories to packages folder list. #;
|
||||
%put # the packages fileref. It allows to add new directories to packages folder list. #;
|
||||
%put # #;
|
||||
%put #### Parameters: #;
|
||||
%put # #;
|
||||
|
||||
@@ -1,4 +1,19 @@
|
||||
/*+generatePackage+*/
|
||||
/*** HELP START ***//*
|
||||
|
||||
Macro to generate SAS packages.
|
||||
|
||||
Version 20240711
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
data, etc.) wrapped up together and %INCLUDEed by
|
||||
a single load.sas file (also embedded inside the zip).
|
||||
|
||||
See examples below.
|
||||
|
||||
*//*** HELP END ***/
|
||||
|
||||
/*** HELP START ***/
|
||||
|
||||
%macro generatePackage(
|
||||
@@ -21,9 +36,14 @@
|
||||
,delTestWork=1 /* indicates if `WORK` directories generated by user tests
|
||||
should be deleted, i.e. the (NO)WORKTERM option is set,
|
||||
default value 1 means "delete tests work" */
|
||||
,markdownDoc=0 /* indicates if a markdown file with documentation
|
||||
be generated from help info blocks */
|
||||
,easyArch=0 /* when creating documentation file indicates if a copy of
|
||||
the zip and markdown files with the version number in the
|
||||
file name be created */
|
||||
)/ secure minoperator
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to generate SAS packages, version 20230904. Run %generatePackage() for help info.'
|
||||
des = 'Macro to generate SAS packages, version 20240711. Run %generatePackage() for help info.'
|
||||
;
|
||||
%if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then
|
||||
%do;
|
||||
@@ -38,7 +58,7 @@ des = 'Macro to generate SAS packages, version 20230904. Run %generatePackage()
|
||||
%put ### This is short help information for the `generatePackage` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to generate SAS packages, version `20230904` #;
|
||||
%put # Macro to generate SAS packages, version `20240711` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
@@ -71,6 +91,7 @@ des = 'Macro to generate SAS packages, version 20230904. Run %generatePackage()
|
||||
%put # if there are dependencies in loading the package. #;
|
||||
%put # Has to be a single directory, if more than one are #;
|
||||
%put # provided than only the first is used. #;
|
||||
%put # If path to location contains spaces it should be quoted! #;
|
||||
%put # #;
|
||||
%put # - `testResults=` Location where tests results should be stored, #;
|
||||
%put # if null (the default) then the session WORK is used. #;
|
||||
@@ -88,6 +109,17 @@ des = 'Macro to generate SAS packages, version 20230904. Run %generatePackage()
|
||||
%put # The default value: `1` means "delete tests work". #;
|
||||
%put # Available values are `0` and `1`. #;
|
||||
%put # #;
|
||||
%put # - `markdownDoc=` Indicates if a markdown file with documentation #;
|
||||
%put # be generated from help information blocks. #;
|
||||
%put # The default value: `0` means "do not generate the file". #;
|
||||
%put # Available values are `0` and `1`. #;
|
||||
%put # #;
|
||||
%put # - `easyArch=` When creating documentation file (`markdownDoc=1`) #;
|
||||
%put # indicates if a copy of the zip and markdown files #;
|
||||
%put # with the version number in the file name be created #;
|
||||
%put # The default value: `0` means "do not create files". #;
|
||||
%put # Available values are `0` and `1`. #;
|
||||
%put # #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put #################################################################################;
|
||||
%put ;
|
||||
@@ -96,8 +128,11 @@ des = 'Macro to generate SAS packages, version 20230904. Run %generatePackage()
|
||||
%end;
|
||||
|
||||
%put --- generatePackage START ---;
|
||||
%local zipReferrence filesWithCodes _DESCR_ _LIC_ _DUMMY_ _RC_ _PackageFileref_ additionalContent;
|
||||
%local zipReferrence zipReferrenceV filesWithCodes _DESCR_ _LIC_ _DUMMY_ _RC_ _PackageFileref_ additionalContent
|
||||
packageHashF packageHashC
|
||||
;
|
||||
%let zipReferrence = _%sysfunc(datetime(), hex6.)_;
|
||||
%let zipReferrenceV = _%sysfunc(datetime(), hex6.)V;
|
||||
%let filesWithCodes = WORK._%sysfunc(datetime(), hex16.)_;
|
||||
%let _DESCR_ = _%sysfunc(datetime(), hex6.)d;
|
||||
%let _LIC_ = _%sysfunc(datetime(), hex6.)l;
|
||||
@@ -446,7 +481,7 @@ DESCRIPTION END:
|
||||
|
|
||||
+-004_format [one file one format,
|
||||
| | option LIB= should be: work.&packageName.format
|
||||
| | (literally with macrovariable name and "format" sufix)]
|
||||
| | (literally with macrovariable name and "format" suffix)]
|
||||
| |
|
||||
| +-efg.sas [a file with a code creating format EFG and informat EFG]
|
||||
|
|
||||
@@ -482,6 +517,16 @@ DESCRIPTION END:
|
||||
| |
|
||||
| +-abc.sas [a file with a code creating IML module ABC, _without_ "Proc IML" header]
|
||||
|
|
||||
+-011_casludf [one file one CAS-L user defined function,
|
||||
| | only plain code of the function, without "Proc CAS" header]
|
||||
| |
|
||||
| +-abc.sas [a file with a code creating CAS-L user defined function ABC, _without_ "Proc CAS" header]
|
||||
|
|
||||
+-012_kmfsnip [one file one KMF-abbreviation snippet,
|
||||
| | code snipped proper tagging]
|
||||
| |
|
||||
| +-abc.sas [a file with a KMF-abbreviation snippet ABC, _with_ proper tagging, snippets names are in low-case]
|
||||
|
|
||||
+-<sequential number>_<type [in lower case]>
|
||||
|
|
||||
+-00n_clean [if you need to clean something up after exec file execution,
|
||||
@@ -563,7 +608,7 @@ data &filesWithCodes.;
|
||||
'FUNCTION' /*'FUNCTIONS'*/ 'FORMAT' /*'FORMATS'*/
|
||||
'IMLMODULE' 'PROTO' 'EXEC' 'CLEAN'
|
||||
'LAZYDATA' 'TEST' 'CASLUDF'
|
||||
'ADDCNT'
|
||||
'ADDCNT' 'KMFSNIP'
|
||||
))
|
||||
then
|
||||
do;
|
||||
@@ -589,6 +634,7 @@ data &filesWithCodes.;
|
||||
put;
|
||||
_abort_ + 1;
|
||||
end;
|
||||
length fileshort $ 256;
|
||||
fileshort = substr(file, 1, length(file) - 4); /* filename.sas -> filename */
|
||||
|
||||
if strip(reverse(file)) in: ('sas.') then output; /* ignore not ".sas" files */
|
||||
@@ -809,6 +855,7 @@ title6 "MD5 hashed fileref of package lowcase name: &_PackageFileref_.";
|
||||
title8 "Required SAS packages: %qsysfunc(compress(%superq(packageReqPackages),%str(%'%")))" ; /* " */
|
||||
%end;
|
||||
|
||||
footnote1 "SAS Packages Framework, version 20240711";
|
||||
|
||||
proc print data = &filesWithCodes.(drop=base folderRef fileRef rc folderid _abort_ fileId additionalContent);
|
||||
run;
|
||||
@@ -835,6 +882,7 @@ title;
|
||||
%end;
|
||||
|
||||
title;
|
||||
footnote;
|
||||
options ¬esSourceOptions.;
|
||||
|
||||
|
||||
@@ -944,8 +992,8 @@ run;
|
||||
4) load package
|
||||
*//*
|
||||
|
||||
filename packages zip 'C:/SAS_PACKAGES/sqlinds.zip';
|
||||
%include packages(iceloadpackage.sas);
|
||||
filename ice ZIP 'C:/SAS_PACKAGES/sqlinds.zip';
|
||||
%include ice(iceloadpackage.sas);
|
||||
filename packages 'C:/SAS_PACKAGES/';
|
||||
%ICEloadpackage(sqlinds)
|
||||
|
||||
@@ -1273,9 +1321,16 @@ data _null_;
|
||||
put ' put "ERROR: Loading package &packageName. will be aborted!";';
|
||||
put ' put "ERROR- Required components are missing."; ';
|
||||
put ' put "ERROR- *** STOP ***"; ';
|
||||
put ' ABORT; ';
|
||||
put ' end; ';
|
||||
put ' run; ';
|
||||
put ' call symputX("packageRequiredErrors",';
|
||||
put ' ''options ls = &ls_tmp. ps = &ps_tmp. ';
|
||||
put ' ¬es_tmp. &source_tmp. msglevel=&msglevel_tmp. ';
|
||||
put ' &stimer_tmp. &fullstimer_tmp. ;';
|
||||
put ' data _null_;abort;run;'', "L"); ';
|
||||
put ' end; ';
|
||||
put ' else ';
|
||||
put ' call symputX("packageRequiredErrors", " ", "L");';
|
||||
put ' run; ';
|
||||
put ' &packageRequiredErrors. ';
|
||||
%end;
|
||||
|
||||
|
||||
@@ -1283,7 +1338,7 @@ data _null_;
|
||||
|
||||
set &filesWithCodes. end = EOF nobs=NOBS;
|
||||
by TYPE notsorted;
|
||||
if (upcase(type) in: ('CLEAN' 'LAZYDATA' 'TEST' 'CASLUDF' 'ADDCNT'))
|
||||
if (upcase(type) in: ('CLEAN' 'LAZYDATA' 'TEST' 'CASLUDF' 'ADDCNT' 'KMFSNIP'))
|
||||
then continue; /* CASLUDF type will go in the next loop */
|
||||
/* cleaning files are only included in unload.sas */
|
||||
/* lazy data are only loaded on demand
|
||||
@@ -1295,7 +1350,7 @@ data _null_;
|
||||
('LIBNAME' 'MACRO' /*'MACROS'*/ 'DATA'
|
||||
'FUNCTION' /*'FUNCTIONS'*/ 'FORMAT' /*'FORMATS'*/
|
||||
'IMLMODULE' 'PROTO' 'EXEC' 'CLEAN'
|
||||
'LAZYDATA' 'TEST' 'ADDCNT'))
|
||||
'LAZYDATA' 'TEST' 'ADDCNT' 'KMFSNIP'))
|
||||
then
|
||||
do;
|
||||
putlog 'WARNING: Type ' type 'is not yet supported.';
|
||||
@@ -1521,7 +1576,7 @@ data _null_;
|
||||
%end;
|
||||
put +(-1) '`.;''' /
|
||||
' !! '' %put The macro generated: '' !! put(dtCASLudf, E8601DT19.-L) !! ";"' /
|
||||
' !! '' %put with the SAS Packages Framework version 20230904.;''' /
|
||||
' !! '' %put with the SAS Packages Framework version 20240711.;''' /
|
||||
' !! '' %put ****************************************************************************;''' /
|
||||
' !! '' %GOTO theEndOfTheMacro;''' /
|
||||
' !! '' %end;''' ;
|
||||
@@ -1559,7 +1614,7 @@ data _null_;
|
||||
put ' %let cherryPick_CASLUDF = %eval(&cherryPick_CASLUDF. + 1);';
|
||||
put '%end; ' /; /* Cherry Pick test2 end */
|
||||
|
||||
end; /* loopOverTypes1 - start */
|
||||
end; /* loopOverTypes1 - end */
|
||||
|
||||
/* this is a footer for CASLudf macro */
|
||||
put ' !! " options nonotes;" ' /
|
||||
@@ -1598,8 +1653,6 @@ data _null_;
|
||||
end;
|
||||
put 'run;'/;
|
||||
|
||||
|
||||
|
||||
/* cherry pick clean in cmplib for functions */
|
||||
if isFunction then
|
||||
do;
|
||||
@@ -1626,12 +1679,7 @@ data _null_;
|
||||
put "proc delete data=work.%lowcase(&packageName.proto); run;";
|
||||
put '%end;';
|
||||
end;
|
||||
/* list cmplib for functions */
|
||||
if isFunction OR isProto then
|
||||
do;
|
||||
put '%put NOTE- ;';
|
||||
put '%put NOTE:[CMPLIB] %sysfunc(getoption(cmplib));' /;
|
||||
end;
|
||||
|
||||
|
||||
/* list fmtsearch for formats */
|
||||
if isFormat then
|
||||
@@ -1645,7 +1693,6 @@ data _null_;
|
||||
', %str(()) ))));';
|
||||
put '%end;';
|
||||
put '%put NOTE- ;';
|
||||
put '%put NOTE:[FMTSEARCH] %sysfunc(getoption(fmtsearch));'/;
|
||||
end;
|
||||
|
||||
/* create a macro loader for IML modules with dependencies */
|
||||
@@ -1673,11 +1720,11 @@ data _null_;
|
||||
''' %put This is help for the `' "&packageName.IML" '` macro; '' !!' /
|
||||
''' %put Parameters (optional) are the following:; '' !!' /
|
||||
|
||||
''' %put - `list` indicates if the list of loaded moduls should be displayed,; '' !!' /
|
||||
''' %put - `list` indicates if the list of loaded modules should be displayed,; '' !!' /
|
||||
''' %put %str( )when set to the value of `1` (the default) runs `SHOW MODULES%str(;)`,; '' !!' /
|
||||
''' %put %str( )when set to the value of `HELP` (upcase letters!) displays this help message.;'' !!' /
|
||||
|
||||
''' %put - `resetIMLstorage` indicates if to reset default moduls storage,; '' !!' /
|
||||
''' %put - `resetIMLstorage` indicates if to reset default modules storage,; '' !!' /
|
||||
''' %put %str( )when set to `1` (the default) runs `RESET STORAGE = WORK.IMLSTOR%str(;)`.; '' !!' /
|
||||
|
||||
''' %put - `err` [technical] indicates message type in case of missing modules catalog,; '' !!' /
|
||||
@@ -1694,7 +1741,7 @@ data _null_;
|
||||
%end;
|
||||
put +(-1) '`.; '' !!' /
|
||||
''' %put The macro generated: ''' " !! put(dtIML, E8601DT19.-L) !! " '''; '' !!' /
|
||||
''' %put with the SAS Packages Framework version 20230904.; '' !! ' /
|
||||
''' %put with the SAS Packages Framework version 20240711.; '' !! ' /
|
||||
''' %put ****************************************************************************; '' !! ' /
|
||||
''' %GOTO theEndOfTheMacro; '' !! ' /
|
||||
''' %end; '' !! ' /
|
||||
@@ -1757,8 +1804,173 @@ data _null_;
|
||||
put '%end;';
|
||||
end;
|
||||
|
||||
/* KMF -------------------------------------------------------------------------------- start */
|
||||
/*
|
||||
The Key Macro Function Abbreviations part of the framework is based on PhUSE 2012 article:
|
||||
|
||||
"Dynamically generating macro invocations using SAS keyboard abbreviations" (Paper CC03)
|
||||
|
||||
by:
|
||||
Tom Van Campen, SGS Life Science Services, Mechelen, Belgium
|
||||
Benny Haemhouts, SGS Life Science Services, Mechelen, Belgium
|
||||
|
||||
Link to materials:
|
||||
https://www.lexjansen.com/phuse/2012/cc/CC03.pdf
|
||||
*/
|
||||
|
||||
do until(eof2); /* loopOverKMF - start */
|
||||
set &filesWithCodes. end = EOF2;
|
||||
by TYPE notsorted;
|
||||
if not (upcase(type) = 'KMFSNIP') then continue; /* only CASLUDF type in this loop */
|
||||
isKMF + 1;
|
||||
if 1=isKMF then
|
||||
do;
|
||||
put 'data _null_; '
|
||||
/ ' call symputX("cherryPick_KMF", 0, "L"); '
|
||||
/ 'run; '
|
||||
/ "data work.%lowcase(&packageName.kmf); "
|
||||
/ "length member $ 128; call missing(member); "
|
||||
/ "if 0 then output; ";
|
||||
end;
|
||||
|
||||
put ' '
|
||||
/ '%if (%str(*)=%superq(cherryPick)) or (' fileshort +(-1) ' in %superq(cherryPick)) %then %do; ' /* Cherry Pick KMF start */
|
||||
/ ' %put NOTE- ;'
|
||||
/ ' %put NOTE: >> Element of type ' type 'from the file "' file +(-1) '" will be included <<;'
|
||||
/ ' member = "_' folder +(-1) "." file +(-1) '"; output;'
|
||||
/ ' %let cherryPick_KMF = %eval(&cherryPick_KMF. + 1);'
|
||||
/ '%end; ' /; /* Cherry Pick KMF end */
|
||||
end; /* loopOverKMF - end */
|
||||
put 'data _null_;';
|
||||
put 'run;';
|
||||
|
||||
if isKMF then
|
||||
do;
|
||||
put '%let temp_noNotes_etc=%sysfunc(getoption(NOTES));'
|
||||
/ 'options noNotes;';
|
||||
put '%if &cherryPick_KMF. %then %do;';
|
||||
put 'filename __KMFgen temp;'
|
||||
/ 'data _null_;'
|
||||
/ " set work.%lowcase(&packageName.kmf) nobs=nobs;"
|
||||
|
||||
/ ' call symputX("numberKMF",nobs,"L");'
|
||||
/ ' file __KMFgen;'
|
||||
|
||||
/ ' length _KMF_name_$ 130;'
|
||||
/ ' _KMF_name_ = quote(scan(member,-2,"."));'
|
||||
|
||||
/ " put 'end=0; append=0; i+1;'"
|
||||
/ " / '_KMF_name_[i]=' _KMF_name_ ';'"
|
||||
/ " / 'do until(end);'"
|
||||
/ " / ' infile &_PackageFileref_.(' member +(-1) ') end=end;'"
|
||||
/ " / ' input codeLine $char2048. @;'"
|
||||
/ " / ' if upcase(codeLine) =: ""KMFCODEDESC:"" then'"
|
||||
/ " / ' _KMF_desc_[i] = strip(substr(codeLine,13));'"
|
||||
|
||||
/ " / ' if upcase(codeLine) =: ""KMFCODEEND:"" then append=0;'"
|
||||
/ " / ' if append then'"
|
||||
/ " / ' do;'"
|
||||
/ " / ' if lengthn(codeLine) then'"
|
||||
/ " / ' _KMF_code_[i] = trim(_KMF_code_[i]) !! trim(codeLine) !! CrNl;'"
|
||||
/ " / ' else _KMF_code_[i] = trim(_KMF_code_[i]) !! CrNl;'"
|
||||
/ " / ' _KMF_NoLi_[i]+1;'"
|
||||
/ " / ' end;'"
|
||||
/ " / ' if upcase(codeLine) =: ""KMFCODESTART:"" then append=1;'"
|
||||
/ " / 'end;'"
|
||||
/ " / '_KMF_code_[i]=substr(_KMF_code_[i],1,lengthn(_KMF_code_[i])-1);'"
|
||||
/ " ;"
|
||||
/ "run;"
|
||||
;
|
||||
|
||||
put 'data _nulL_;'
|
||||
/ ' file "%sysfunc(pathname(WORK))/%lowcase(&packageName..kmf)" termstr=NL lrecl=32767;'
|
||||
/ ' putlog "INFO: The &packageName. package provides KMF-abbreviations."; '
|
||||
/ ' putlog @7 "By default the file with abbreviations is located in:";'
|
||||
/ ' putlog / @9 "%sysfunc(pathname(WORK))/%lowcase(&packageName..kmf)";'
|
||||
/ ' putlog / @7 "To import code abbreviations to your SAS session:";'
|
||||
/ ' putlog @7 "- in SAS DMS go to: Tools -> Keyboard Macros -> Macros... -> Import... ";'
|
||||
/ ' putlog @7 "- in SAS EG go to: Program -> Manage Macros and Snippets -> Import... ";'
|
||||
/ ' putlog @7 "and navigate to the location of the KMF file.";'
|
||||
|
||||
/ ' putlog / @7 "Should you have any problem with finding the file consider moving";'
|
||||
/ ' putlog @7 "it to a location of your choice with the help of the following snippet:";'
|
||||
/ ' putlog / @7 " filename KMFin " "''%sysfunc(pathname(WORK))/%lowcase(&packageName..kmf)''" " lrecl=1 recfm=n;";'
|
||||
/ ' putlog / @7 " filename KMFout " "''</directory/of/your/choice>/%lowcase(&packageName..kmf)''" " lrecl=1 recfm=n;";'
|
||||
/ ' putlog @7 '' %put *%sysfunc(fcopy(KMFin, KMFout))*(0=success)*;'';'
|
||||
/ ' putlog / "0a"x / " ";'
|
||||
|
||||
|
||||
/ ' array _KMF_name_[&numberKMF.] $ 128;'
|
||||
/ ' array _KMF_desc_[&numberKMF.] $ 256;'
|
||||
/ ' array _KMF_seqn_[&numberKMF.] (1:&numberKMF.);'
|
||||
/ ' array _KMF_code_[&numberKMF.] $ 32767;'
|
||||
/ ' array _KMF_NoLi_[&numberKMF.] ;'
|
||||
/ ' array _KMF_Byte_[&numberKMF.] $ 7;'
|
||||
|
||||
/ ' noDef = symgetn("numberKMF");'
|
||||
/ ' tmpByteD2 = floor(noDef/256);'
|
||||
/ ' tmpByteD1 = noDef - (tmpByteD2*256);'
|
||||
/ ' noDefByte = "KM" !! byte(0) !! byte(2) !! byte(tmpByteD1) !! byte(tmpByteD2) !! byte(0) !! byte(0);'
|
||||
|
||||
/ ' CrNl=byte(13)!!byte(10);'
|
||||
|
||||
/ ' %include __KMFgen / &source2.;'
|
||||
|
||||
/ ' do i = 1 to &numberKMF.;'
|
||||
/ ' X1=lengthn(trim(_KMF_code_[i]));'
|
||||
/ ' X2=lengthn(strip(_KMF_name_[i]));'
|
||||
/ ' X3=lengthn(strip(_KMF_desc_[i]));'
|
||||
/ ' X4=lengthn(put(_KMF_seqn_[i], best3.-l));'
|
||||
/ ' X5=lengthn(put(_KMF_NoLi_[i], best12.-l));'
|
||||
/ ' noChar = sum(X1, X2, X3, X4, X5, 20);'
|
||||
/ ' tmpByteC2 = floor(noChar/256);'
|
||||
/ ' tmpByteC1 = noChar - (tmpByteC2*256);'
|
||||
|
||||
/ ' _KMF_Byte_[i] = byte(tmpByteC1) !! byte(tmpByteC2) !! byte(0) !! byte(0) !! "252";'
|
||||
/ ' end;'
|
||||
|
||||
/ ' do i = 1 to &numberKMF.;'
|
||||
/ ' if i=1 then put noDefByte +(-1) @@;'
|
||||
/ ' /* 1*/ put _KMF_Byte_[i];'
|
||||
/ ' /* 2*/ put "3";'
|
||||
/ ' /* 3*/ put _KMF_name_[i];'
|
||||
/ ' /* 4*/ if lengthn(_KMF_desc_[i]) then put _KMF_desc_[i]; else put;'
|
||||
/ ' /* 5*/ put "1"'
|
||||
/ ' /* 6*/ / "332"'
|
||||
/ ' /* 7*/ / "1";'
|
||||
/ ' /* 8*/ put _KMF_NoLi_[i];'
|
||||
/ ' /* 8*/ put _KMF_code_[i];'
|
||||
/ ' /*10*/ put _KMF_seqn_[i];'
|
||||
/ ' /*11*/ put "1";'
|
||||
/ ' ;'
|
||||
/ ' end;'
|
||||
/ 'stop;'
|
||||
/ 'run;'
|
||||
/ '%symdel numberKMF / noWarn;'
|
||||
/ 'filename __KMFgen clear;'
|
||||
;
|
||||
put '%end;';
|
||||
put "proc delete data=work.%lowcase(&packageName.kmf); run;";
|
||||
put 'options &temp_noNotes_etc.;';
|
||||
end;
|
||||
put 'data _null_;';
|
||||
put 'run;';
|
||||
/* KMF -------------------------------------------------------------------------------- end */
|
||||
|
||||
/* list cmplib for functions and fmtsearch for formats*/
|
||||
if isFunction OR isProto then
|
||||
do;
|
||||
put '%put NOTE- ;';
|
||||
put '%put NOTE:[CMPLIB] %sysfunc(getoption(cmplib));' /;
|
||||
end;
|
||||
if isFormat then
|
||||
do;
|
||||
put '%put NOTE- ;';
|
||||
put '%put NOTE:[FMTSEARCH] %sysfunc(getoption(fmtsearch));'/;
|
||||
end;
|
||||
|
||||
/* update SYSloadedPackages global macrovariable */
|
||||
put 'options noNotes;';
|
||||
put '%if (%str(*)=%superq(cherryPick)) %then %do; '; /* Cherry Pick test3 start */
|
||||
put ' data _null_ ; ';
|
||||
put ' length SYSloadedPackages stringPCKG $ 32767; ';
|
||||
@@ -1776,7 +1988,7 @@ data _null_;
|
||||
put " SYSloadedPackages = catx('#', SYSloadedPackages, '&packageName.(&packageVersion.)'); ";
|
||||
put ' SYSloadedPackages = compbl(translate(SYSloadedPackages, " ", "#")); ';
|
||||
put ' call symputX("SYSloadedPackages", SYSloadedPackages, "G"); ';
|
||||
put ' put "NOTE: " SYSloadedPackages = ; ';
|
||||
put ' put / "INFO:[SYSLOADEDPACKAGES] " SYSloadedPackages ; ';
|
||||
put ' end ; ';
|
||||
put " else ";
|
||||
put ' do; ';
|
||||
@@ -1785,21 +1997,26 @@ data _null_;
|
||||
put " SYSloadedPackages = catx('#', SYSloadedPackages, '&packageName.(&packageVersion.)'); ";
|
||||
put ' SYSloadedPackages = compbl(translate(SYSloadedPackages, " ", "#")); ';
|
||||
put ' call symputX("SYSloadedPackages", SYSloadedPackages, "G"); ';
|
||||
put ' put "NOTE: " SYSloadedPackages = ; ';
|
||||
put ' put / "INFO:[SYSLOADEDPACKAGES] " SYSloadedPackages ; ';
|
||||
put ' end ; ';
|
||||
put ' end; ';
|
||||
put ' else ';
|
||||
put ' do; ';
|
||||
put " call symputX('SYSloadedPackages', '&packageName.(&packageVersion.)', 'G'); ";
|
||||
put " put 'NOTE: SYSloadedPackages = &packageName.(&packageVersion.)'; ";
|
||||
put " put / 'INFO:[SYSLOADEDPACKAGES] &packageName.(&packageVersion.)'; ";
|
||||
put ' end; ';
|
||||
put ' stop; ';
|
||||
put ' run; ';
|
||||
put ' run; ';
|
||||
put '%end; ' / ; /* Cherry Pick test3 end */
|
||||
|
||||
|
||||
put 'options NOTES;';
|
||||
put '%put NOTE- ;';
|
||||
put '%put NOTE: '"Loading package &packageName., version &packageVersion., license &packageLicense.;";
|
||||
put '%put NOTE- *** END ***;' /;
|
||||
|
||||
put 'options &temp_noNotes_etc.;'
|
||||
/ '%symdel temp_noNotes_etc / noWarn;';
|
||||
|
||||
put "/* load.sas end */" /;
|
||||
stop;
|
||||
run;
|
||||
@@ -1915,7 +2132,7 @@ data _null_;
|
||||
if not (upcase(type)=:'MACRO') then continue;
|
||||
put ' %put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be deleted;';
|
||||
put ' %put NOTE- ;';
|
||||
put ' ,"' fileshort upcase32. '"' /;
|
||||
put ' ,"' fileshort upcase64. '"' /;
|
||||
end;
|
||||
/**/
|
||||
put ' )';
|
||||
@@ -1933,7 +2150,7 @@ data _null_;
|
||||
if not (upcase(type)=:'FORMAT') then continue;
|
||||
put ' %put NOTE- Element of type ' type 'generated from the file "' file +(-1) '" will be deleted;';
|
||||
put ' %put NOTE- ;';
|
||||
put ' ,"' fileshort upcase32. '"' /;
|
||||
put ' ,"' fileshort upcase64. '"' /;
|
||||
isFormat + 1;
|
||||
end;
|
||||
put ' )';
|
||||
@@ -2173,6 +2390,7 @@ data _null_;
|
||||
set &filesWithCodes. end = EOFDS nobs = NOBS;
|
||||
if upcase(type) in: ('TEST') then continue; /* exclude tests */
|
||||
|
||||
length fileshort2 $ 256;
|
||||
select;
|
||||
when (upcase(type) in ("DATA" "LAZYDATA")) fileshort2 = cats("'", fileshort, "'" );
|
||||
when (upcase(type) =: "MACRO" ) fileshort2 = cats('''%', fileshort, "()'");
|
||||
@@ -2280,25 +2498,25 @@ data _null_;
|
||||
put 'put @5 "' CUROBS +(-1) '." @10 "' type '" @21 "' fileshort '";';
|
||||
end;
|
||||
|
||||
%if %bquote(&packageRequired.) ne %then
|
||||
%if %superq(packageRequired) ne %then
|
||||
%do;
|
||||
length packageRequired $ 32767;
|
||||
packageRequired = symget('packageRequired');
|
||||
put ' length req $ 64; ';
|
||||
put ' length req $ 256; ';
|
||||
put ' put ; put " Required SAS Components: "; ';
|
||||
put ' do req = ' / packageRequired / ' ; ';
|
||||
put ' put @5 req; ';
|
||||
put ' put @3 "-" @5 req; ';
|
||||
put ' end ; ';
|
||||
%end;
|
||||
|
||||
%if %bquote(&packageReqPackages.) ne %then
|
||||
%if %superq(packageReqPackages) ne %then
|
||||
%do;
|
||||
length packageReqPackages $ 32767;
|
||||
packageReqPackages = symget('packageReqPackages');
|
||||
put ' length req $ 64; ';
|
||||
put ' length req $ 256; ';
|
||||
put ' put ; put " Required SAS Packages: "; ';
|
||||
put ' do req = ' / packageReqPackages / ' ; ';
|
||||
put ' put @5 req; ';
|
||||
put ' put @3 "-" @5 req; ';
|
||||
put ' end ; ';
|
||||
%end;
|
||||
|
||||
@@ -2310,7 +2528,9 @@ data _null_;
|
||||
put "put @3 'localization (only if additional content was deployed during the installation process).';" / "put ;";
|
||||
%end;
|
||||
|
||||
put 'put "***"; put "* SAS package generated by generatePackage, version 20230904 *"; put "***";';
|
||||
put 'put " " / @3 "--------------------------------------------------------------------" / " ";'
|
||||
/ 'put @3 "*SAS package generated by SAS Package Framework, version `20240711`*";'
|
||||
/ 'put " " / @3 "--------------------------------------------------------------------";';
|
||||
|
||||
put 'run; ' /;
|
||||
|
||||
@@ -2346,6 +2566,7 @@ data _null_;
|
||||
set &filesWithCodes. end = EOFDS;
|
||||
if upcase(type) in: ('TEST') then continue; /* exclude tests */
|
||||
|
||||
length fileshort2 $ 256;
|
||||
select;
|
||||
when (upcase(type) in ("DATA" "LAZYDATA")) fileshort2 = cats("'", fileshort, "'" );
|
||||
when (upcase(type) =: "MACRO" ) fileshort2 = cats('''%', fileshort, "()'");
|
||||
@@ -2353,6 +2574,7 @@ data _null_;
|
||||
when (upcase(type) =: "IMLMODULE" ) fileshort2 = cats("'", fileshort, "()'" );
|
||||
when (upcase(type) =: "PROTO" ) fileshort2 = cats("'", fileshort, "()'" );
|
||||
when (upcase(type) =: "FORMAT" ) fileshort2 = cats("'$", fileshort, ".'" );
|
||||
when (upcase(type) =: "CASLUDF" ) fileshort2 = cats("'", fileshort, "()'" );
|
||||
otherwise fileshort2 = fileshort;
|
||||
end;
|
||||
strX = catx('/', folder, order, type, file, fileshort, fileshort2);
|
||||
@@ -2462,7 +2684,7 @@ data _null_;
|
||||
|
||||
/* copy code file into the zip */
|
||||
call execute('data _null_;');
|
||||
call execute(' put ;');
|
||||
call execute(' put ; length pathname $ 8192;');
|
||||
call execute(' pathname = pathname("_SPFIN_");');
|
||||
|
||||
call execute(' do until (ex OR Try>10) ;');
|
||||
@@ -2659,20 +2881,22 @@ filename &zipReferrence. clear;
|
||||
set sashelp.vfunc(keep=fncname);
|
||||
where fncname = "HASHING_FILE";
|
||||
call execute('
|
||||
data the_SHA256_hash_id;' !!
|
||||
data work.the_SHA256_hash_id;' !!
|
||||
/* F - file */
|
||||
" SHA256 = 'F*' !! HASHING_FILE('SHA256', pathname('&zipReferrence.','F'), 0); " !!
|
||||
' TYPE="F"; ' !!
|
||||
' put / @7 SHA256= / " "; output; ' !!
|
||||
' call symputX("packageHashF",SHA256,"L");' !!
|
||||
/* C - content */
|
||||
" SHA256 = 'C*' !! HASHING_FILE('SHA256', '&zipReferrence.', 4); " !!
|
||||
' TYPE="C"; ' !!
|
||||
' put / @7 SHA256= / " "; output; ' !!
|
||||
' call symputX("packageHashC",SHA256,"L");' !!
|
||||
' label ' !!
|
||||
' SHA256 = "The SHA256 hash digest for package &packageName.:" ' !!
|
||||
' TYPE= "Type of hash digest / F = file / C = content"; ' !!
|
||||
'run;');
|
||||
call execute('proc print data = the_SHA256_hash_id noobs label split="/"; run;');
|
||||
call execute('proc print data = work.the_SHA256_hash_id noobs label split="/"; run;');
|
||||
stop;
|
||||
run;
|
||||
options ¬esSourceOptions.;
|
||||
@@ -2681,7 +2905,7 @@ filename &zipReferrence. clear;
|
||||
/*-+++++++++++++++++++++++-*/
|
||||
|
||||
/* verify if there were errors while package content creation */
|
||||
%if %bquote(&createPackageContentStatus.) ne 0 %then
|
||||
%if %superq(createPackageContentStatus) ne 0 %then
|
||||
%do;
|
||||
%put ERROR- ** [&sysmacroname.] **;
|
||||
%put ERROR: ** ERRORS IN PACKAGE CONTENT CREATION! **;
|
||||
@@ -2703,7 +2927,20 @@ filename &zipReferrence. clear;
|
||||
%put NOTE-;
|
||||
/* in case the packages macrovariable is multi-directory the first directory will be selected */
|
||||
data _null_;
|
||||
call symputX("packages", dequote(kscanx(resolve(symget("packages")), 1, "()", "QS")) ,"L");
|
||||
length packages $ 32767;
|
||||
packages = resolve(symget("packages"));
|
||||
|
||||
/* check if path contains quotes */
|
||||
quotes = lengthn(compress(packages,"""'","K"));
|
||||
|
||||
/* issue error for unmatched quotes */
|
||||
if mod(quotes,2) then
|
||||
put "ERROR: Unbalanced quotes in the PACKAGES= parameter." / "ERROR- " PACKAGES= ;
|
||||
|
||||
if quotes > 0 then
|
||||
call symputX("packages", dequote(kscanx(packages, 1, "()", "QS")) ,"L");
|
||||
else
|
||||
call symputX("packages", packages ,"L");
|
||||
run;
|
||||
|
||||
/* check if systask is available */
|
||||
@@ -2719,7 +2956,9 @@ run;
|
||||
put 'NOTE-';
|
||||
|
||||
n=6;
|
||||
put @n "filename packages '&packages.';" /;
|
||||
length packages $ 32767;
|
||||
packages = quote(dequote(strip(symget('packages'))));
|
||||
put @n "filename packages " packages ";" /;
|
||||
|
||||
if fileexist("&packages./SPFinit.sas") then
|
||||
put @n '%include packages(SPFinit.sas);' /;
|
||||
@@ -3221,6 +3460,290 @@ options "elenmax_tmp.;
|
||||
/* if you do not want any test to be executed */
|
||||
%NOTESTING:
|
||||
|
||||
/* generate MarkDown documentation file */
|
||||
/* check param value */
|
||||
%if %superq(markdownDoc) NE 1 %then %let markdownDoc=0;
|
||||
/* if true then execute */
|
||||
%if %superq(markdownDoc)=1 %then
|
||||
%do;
|
||||
%if %superq(createPackageContentStatus) NE 0 %then
|
||||
%do;
|
||||
%put ERROR- ** [&sysmacroname.] **;
|
||||
%put ERROR: ** ERRORS IN PACKAGE CONTENT CREATION! **;
|
||||
%put ERROR- ** NO MARKDOWN DOCUMMENTATION WILL BE GENERATED. **;
|
||||
%GOTO NOmarkdownDoc;
|
||||
%end;
|
||||
/*= generate MarkDown documentation START =================================================================================*/
|
||||
%put NOTE-;
|
||||
%put NOTE: Preparing markdown documentation file.;
|
||||
%put NOTE- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^;
|
||||
%put NOTE-;
|
||||
|
||||
%local MarkDownOptionsTmp;
|
||||
%let MarkDownOptionsTmp =
|
||||
%sysfunc(getoption(notes)) %sysfunc(getoption(source)) msglevel=%sysfunc(getoption(msglevel));
|
||||
options NOnotes NOsource msglevel=N;
|
||||
|
||||
filename &zipReferrence. "&filesLocation./%lowcase(&packageName.).md";
|
||||
filename &_PackageFileref_. ZIP "&filesLocation./%lowcase(&packageName.).zip";
|
||||
|
||||
data &filesWithCodes.markdown;
|
||||
/* break if no data */
|
||||
if NOBS = 0 then stop;
|
||||
|
||||
file &zipReferrence. encoding = &packageEncoding.;
|
||||
put "# Documentation for the `&packageName.` package.";
|
||||
|
||||
length packageLicense packageGenerated $ 64
|
||||
packageTitle packageAuthor packageMaintainer $ 4096
|
||||
packageHashF packageHashC $ 128
|
||||
;
|
||||
packageLicense=symget("packageLicense");
|
||||
packageTitle=symget("packageTitle");
|
||||
packageGenerated=symget("packageGenerated");
|
||||
packageAuthor=symget("packageAuthor");
|
||||
packageMaintainer=symget("packageMaintainer");
|
||||
packageHashF=symget("packageHashF");
|
||||
packageHashC=symget("packageHashC");
|
||||
drop package:;
|
||||
|
||||
put " " / 64*"-" / " "
|
||||
/ ' *' packageTitle +(-1)'* '
|
||||
/ " " / 64*"-" / " "
|
||||
/ "### Version information:"
|
||||
/ " "
|
||||
/ "- Package: &packageName."
|
||||
/ "- Version: &packageVersion."
|
||||
/ "- Generated: " packageGenerated
|
||||
/ "- Author(s): " packageAuthor
|
||||
/ "- Maintainer(s): " packageMaintainer
|
||||
/ "- License: " packageLicense
|
||||
/ "- File SHA256: `" packageHashF +(-1) "` for this version"
|
||||
/ "- Content SHA256: `" packageHashC +(-1) "` for this version"
|
||||
/ " " / "---" / " ";
|
||||
|
||||
put "# The `&packageName.` package, version: `&packageVersion.`;"
|
||||
/ " " / "---" / " ";
|
||||
|
||||
do until (EOF);
|
||||
infile &_PackageFileref_.(description.sas) end = EOF;
|
||||
input;
|
||||
if upcase(strip(_infile_)) =: "DESCRIPTION END:" then printer = 0;
|
||||
if printer then put _infile_;
|
||||
if upcase(strip(_infile_)) =: "DESCRIPTION START:" then printer = 1;
|
||||
end;
|
||||
|
||||
put " " / "---" / " ";
|
||||
|
||||
%if %superq(packageRequired) ne %then
|
||||
%do;
|
||||
put " " / "---" / " ";
|
||||
length req $ 256;
|
||||
put "Required SAS Components: ";
|
||||
do req = &packageRequired. ;
|
||||
put @3 "-" @5 req;
|
||||
end ;
|
||||
%end;
|
||||
|
||||
%if %superq(packageReqPackages) ne %then
|
||||
%do;
|
||||
put " " / "---" / " ";
|
||||
length req2 $ 256;
|
||||
put "Required SAS Packages: ";
|
||||
do req2 = &packageReqPackages.;
|
||||
put @3 "-" @5 req2;
|
||||
end ;
|
||||
%end;
|
||||
|
||||
put " " / "---" / " ";
|
||||
|
||||
%if %superq(additionalContent) NE %then
|
||||
%do;
|
||||
put " " / "---" / " ";
|
||||
put 'Package contains additional content, run: `%loadPackageAddCnt(' "&packageName." ')` to load it'
|
||||
/ "or look for the `%lowcase(&packageName.)_AdditionalContent` directory in the `packages` fileref"
|
||||
/ "localization (only if additional content was deployed during the installation process).";
|
||||
%end;
|
||||
|
||||
put " " / "--------------------------------------------------------------------" / " "
|
||||
/ "*SAS package generated by SAS Package Framework, version `20240711`*"
|
||||
/ " " / "--------------------------------------------------------------------" / " ";
|
||||
|
||||
put "# The `&packageName.` package content";
|
||||
put "The `&packageName.` package consists of the following content:" / " ";
|
||||
EOFDS = 0;
|
||||
do until(EOFDS);
|
||||
/* content is created during package creation */
|
||||
set &filesWithCodes. end = EOFDS nobs = NOBS curobs = CUROBS;
|
||||
if upcase(type) in: ('TEST') then continue; /* exclude tests */
|
||||
|
||||
/*
|
||||
To exclude file from being added to the documentation
|
||||
insert the "excluding" text(see below) as a comment
|
||||
in the FIRST line of the file.
|
||||
Do not add spaces.
|
||||
|
||||
For each file the first line is read in and checked.
|
||||
*/
|
||||
length _FILEVARPATH_ $ 4096;
|
||||
_FILEVARPATH_=catx("/",base,folder,file);
|
||||
infile _dummy_ FILEVAR=_FILEVARPATH_;
|
||||
input;
|
||||
if strip(_infile_) IN (
|
||||
'/*##DoNotUse4Documentation##*/'
|
||||
'/*##ExcludeFromDocumentation##*/'
|
||||
'/*##ExcludeFromMarkdownDoc##*/'
|
||||
)
|
||||
then continue; /* exclude file from documentation */
|
||||
|
||||
type2=type;
|
||||
length link $ 256;
|
||||
link=catx("-",compress(fileshort,,"KAD"),type,CUROBS);
|
||||
length fileshort $ 256;
|
||||
select;
|
||||
when (upcase(type) =: "MACRO" ) do; fileshort2 = cats('`%', fileshort, "()`"); type2='macro'; end;
|
||||
when (upcase(type) =: "FORMAT" ) do; fileshort2 = cats("`$", fileshort, ".`"); type2='format/informat'; end;
|
||||
when (upcase(type) =: "FUNCTION" ) do; fileshort2 = cats("`", fileshort, "()`"); type2='function'; end;
|
||||
when (upcase(type) =: "IMLMODULE") fileshort2 = cats("`", fileshort, "()`");
|
||||
when (upcase(type) =: "PROTO" ) fileshort2 = cats("`", fileshort, "()`");
|
||||
when (upcase(type) =: "CASLUDF" ) fileshort2 = cats("`", fileshort, "()`");
|
||||
otherwise fileshort2 = cats("`", fileshort, "`");
|
||||
end;
|
||||
|
||||
contentObs + 1;
|
||||
put @1 contentObs +(-1) '. [' fileshort2 type2'](#' link ')';
|
||||
output;
|
||||
end;
|
||||
|
||||
put " " / " ";
|
||||
contentObs+1;
|
||||
put @1 contentObs +(-1) '. [License note](#license)';
|
||||
put " " / "---" / " ";
|
||||
|
||||
putlog "Doc. note with general information ready.";
|
||||
stop;
|
||||
run;
|
||||
|
||||
/* loop through content and print info to the MD file */
|
||||
data _null_;
|
||||
if 0 = NOBS then stop;
|
||||
do until(EOFDS);
|
||||
set &filesWithCodes.markdown end = EOFDS nobs = NOBS curobs=CUROBS;
|
||||
length memberX $ 1024;
|
||||
memberX = cats("_",folder,".",file);
|
||||
/* inner data step in call execute to read each embedded file */
|
||||
call execute("data _null_; ");
|
||||
call execute(" file &zipReferrence. encoding = &packageEncoding. MOD; ");
|
||||
call execute(' put ''## ' !! catx(" ",fileshort2,type2) !! ' <a name="' !! strip(link) !! '"></a> ######'';');
|
||||
call execute(' infile &_PackageFileref_.(' || strip(memberX) || ') end = EOF; ');
|
||||
call execute(" printer = 0; ");
|
||||
call execute(" do until(EOF); ");
|
||||
call execute(" input; length _endhelpline_ _starthelpline_ $ 32767; ");
|
||||
call execute(" _endhelpline_ = upcase(reverse(strip(_infile_))); ");
|
||||
call execute(" if 18 <= lengthn(_endhelpline_) AND _endhelpline_
|
||||
=: '/*** DNE PLEH ***/' then printer = 0; "); /* ends with HELP END */
|
||||
call execute(" if printer then put _infile_; ");
|
||||
call execute(" _starthelpline_ = upcase(strip(_infile_)); ");
|
||||
call execute(" if 20 <= lengthn(_starthelpline_) AND _starthelpline_
|
||||
=: '/*** HELP START ***/' then printer = 1 ; "); /* starts with HELP START */
|
||||
call execute(" end; ");
|
||||
call execute(' put " " / "---" / " "; ');
|
||||
call execute(' putlog ''Doc. note ' !! cats(CUROBS) !! ' for ' !! catx(" ",fileshort2,type2) !! ' ready.'';');
|
||||
call execute(" stop; ");
|
||||
call execute("run; ");
|
||||
|
||||
end;
|
||||
stop;
|
||||
run;
|
||||
|
||||
/* license info */
|
||||
data _null_;
|
||||
file &zipReferrence. encoding = &packageEncoding. MOD;
|
||||
putlog "Doc. note with license ready.";
|
||||
put " " / "---" / " "
|
||||
/ '# License <a name="license"></a> ######' / " "
|
||||
;
|
||||
do until (EOF_L);
|
||||
infile &_PackageFileref_.(license.sas) end = EOF_L;
|
||||
input;
|
||||
put _infile_;
|
||||
end;
|
||||
put " " / "---" / " ";
|
||||
stop;
|
||||
run;
|
||||
|
||||
options &MarkDownOptionsTmp.;
|
||||
%put NOTE: Markdown file generated.;
|
||||
filename &zipReferrence. list;
|
||||
%put NOTE- ;
|
||||
|
||||
options NOnotes NOsource msglevel=N;
|
||||
|
||||
filename &zipReferrence. clear;
|
||||
filename &_PackageFileref_. clear;
|
||||
options &MarkDownOptionsTmp.;
|
||||
|
||||
/* to make archiving easier a copy of the package zip file
|
||||
with the version in the name is created */
|
||||
%if %superq(easyArch) NE 1 %then %let easyArch=0;
|
||||
|
||||
%if %superq(easyArch) = 1 %then
|
||||
%do;
|
||||
%put NOTE-;
|
||||
%put NOTE: Creating files with version in the name.;
|
||||
%put NOTE- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^;
|
||||
%put NOTE-;
|
||||
|
||||
%local notesSourceOptions;
|
||||
%let notesSourceOptions = %sysfunc(getoption(notes)) %sysfunc(getoption(source));
|
||||
options NOnotes NOsource;
|
||||
|
||||
/* zip */
|
||||
filename &zipReferrence. "&filesLocation./%lowcase(&packageName.).zip" lrecl=1 recfm=n;
|
||||
filename &zipReferrence. list;
|
||||
filename &zipReferrenceV. "&filesLocation./%lowcase(&packageName.)_&packageVersion._.zip" lrecl=1 recfm=n;
|
||||
filename &zipReferrenceV. list;
|
||||
data _null_;
|
||||
rc = fcopy("&zipReferrence.", "&zipReferrenceV.");
|
||||
length rctxt $ 32767;
|
||||
rctxt = sysmsg();
|
||||
if rc then
|
||||
do;
|
||||
put "ERROR: An error " rc "occurred during creation of %lowcase(&packageName.)_&packageVersion._.zip file.";
|
||||
put rctxt;
|
||||
end;
|
||||
else put "Creating %lowcase(&packageName.)_&packageVersion._.zip file.";
|
||||
run;
|
||||
filename &zipReferrence. clear;
|
||||
filename &zipReferrenceV. clear;
|
||||
|
||||
/* md */
|
||||
filename &zipReferrence. "&filesLocation./%lowcase(&packageName.).md" lrecl=1 recfm=n;
|
||||
filename &zipReferrence. list;
|
||||
filename &zipReferrenceV. "&filesLocation./%lowcase(&packageName.)_&packageVersion._.md" lrecl=1 recfm=n;
|
||||
filename &zipReferrenceV. list;
|
||||
data _null_;
|
||||
rc = fcopy("&zipReferrence.", "&zipReferrenceV.");
|
||||
length rctxt $ 32767;
|
||||
rctxt = sysmsg();
|
||||
if rc then
|
||||
do;
|
||||
put "ERROR: An error " rc "occurred during creation of %lowcase(&packageName.)_&packageVersion._.md file.";
|
||||
put rctxt;
|
||||
end;
|
||||
else put "Creating %lowcase(&packageName.)_&packageVersion._.md file.";
|
||||
run;
|
||||
filename &zipReferrence. clear;
|
||||
filename &zipReferrenceV. clear;
|
||||
|
||||
options ¬esSourceOptions.;
|
||||
%end;
|
||||
/*= generate MarkDown documentation END =================================================================================*/
|
||||
%NOmarkdownDoc:
|
||||
%end;
|
||||
|
||||
|
||||
/* clean temporary files */
|
||||
proc sql;
|
||||
drop table &filesWithCodes.;
|
||||
|
||||
@@ -3228,6 +3751,11 @@ proc sql;
|
||||
%do;
|
||||
drop table &filesWithCodes.addCnt;
|
||||
%end;
|
||||
|
||||
%if %sysfunc(exist(&filesWithCodes.markdown)) %then
|
||||
%do;
|
||||
drop table &filesWithCodes.markdown;
|
||||
%end;
|
||||
quit;
|
||||
|
||||
/* turn on the original value of the note about quoted string length */
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
*/
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to get help about SAS package, version 20230904. Run %helpPackage() for help info.'
|
||||
des = 'Macro to get help about SAS package, version 20240711. Run %helpPackage() for help info.'
|
||||
;
|
||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||
%do;
|
||||
@@ -43,7 +43,7 @@ des = 'Macro to get help about SAS package, version 20230904. Run %helpPackage()
|
||||
%put ### This is short help information for the `helpPackage` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to get help about SAS packages, version `20230904` #;
|
||||
%put # Macro to get help about SAS packages, version `20240711` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
@@ -181,10 +181,3 @@ TODO:
|
||||
- add MD5(&packageName.) value hash instead "package" word in filenames [DONE]
|
||||
*/
|
||||
|
||||
/* Macros to install SAS packages, version 20230904 */
|
||||
/* A SAS package is a zip file containing a group of files
|
||||
with SAS code (macros, functions, data steps generating
|
||||
data, etc.) wrapped up together and %INCLUDEed by
|
||||
a single load.sas file (also embedded inside the zip).
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
/*+installPackage+*/
|
||||
/* Macros to install SAS packages, version 20240711 */
|
||||
/* A SAS package is a zip file containing a group of files
|
||||
with SAS code (macros, functions, data steps generating
|
||||
data, etc.) wrapped up together and %INCLUDEed by
|
||||
a single load.sas file (also embedded inside the zip).
|
||||
*/
|
||||
/*** HELP START ***/
|
||||
|
||||
%macro installPackage(
|
||||
@@ -16,7 +22,7 @@
|
||||
/secure
|
||||
minoperator
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to install SAS package, version 20230904. Run %%installPackage() for help info.'
|
||||
des = 'Macro to install SAS package, version 20240711. Run %%installPackage() for help info.'
|
||||
;
|
||||
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
|
||||
%do;
|
||||
@@ -31,7 +37,7 @@ des = 'Macro to install SAS package, version 20230904. Run %%installPackage() fo
|
||||
%put ### This is short help information for the `installPackage` macro #;
|
||||
%put #--------------------------------------------------------------------------------------------#;;
|
||||
%put # #;
|
||||
%put # Macro to install SAS packages, version `20230904` #;
|
||||
%put # Macro to install SAS packages, version `20240711` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
@@ -479,25 +485,4 @@ des = 'Macro to install SAS package, version 20230904. Run %%installPackage() fo
|
||||
|
||||
/*** HELP END ***/
|
||||
|
||||
/*** HELP START ***/
|
||||
|
||||
/* Macro to list SAS packages in packages folder.
|
||||
|
||||
Version 20230904
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
data, etc.) wrapped up together and %INCLUDEed by
|
||||
a single load.sas file (also embedded inside the zip).
|
||||
*/
|
||||
/*
|
||||
* Example 1: Set local packages directory, enable the framework,
|
||||
and list packages in the local repository.
|
||||
|
||||
filename packages "C:\SAS_PACKAGES";
|
||||
%include packages(SPFinit.sas);
|
||||
%listPackages()
|
||||
|
||||
*/
|
||||
/*** HELP END ***/
|
||||
|
||||
|
||||
@@ -1,7 +1,28 @@
|
||||
/*+listPackages+*/
|
||||
/*** HELP START ***//*
|
||||
|
||||
Macro to list SAS packages in packages folder.
|
||||
|
||||
Version 20240711
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
data, etc.) wrapped up together and %INCLUDEed by
|
||||
a single load.sas file (also embedded inside the zip).
|
||||
|
||||
|
||||
* Example 1: Set local packages directory, enable the framework,
|
||||
and list packages in the local repository.
|
||||
|
||||
filename packages "C:\SAS_PACKAGES";
|
||||
%include packages(SPFinit.sas);
|
||||
%listPackages()
|
||||
|
||||
*//*** HELP END ***/
|
||||
|
||||
|
||||
%macro listPackages()/secure PARMBUFF
|
||||
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20230904.'
|
||||
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20240711.'
|
||||
;
|
||||
%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
|
||||
%do;
|
||||
@@ -16,14 +37,14 @@ des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HE
|
||||
%put ### This is short help information for the `listPackages` macro #;
|
||||
%put #-----------------------------------------------------------------------------------------#;;
|
||||
%put # #;
|
||||
%put # Macro to list available SAS packages, version `20230904` #;
|
||||
%put # Macro to list available SAS packages, version `20240711` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
%put # data, etc.) wrapped up together and embedded inside the zip. #;
|
||||
%put # #;
|
||||
%put # The `%nrstr(%%listPackages())` macro lists packages available #;
|
||||
%put # in the packages folder. List is printed inthe SAS Log. #;
|
||||
%put # in the packages folder. List is printed in the SAS Log. #;
|
||||
%put # #;
|
||||
%put #### Parameters: #;
|
||||
%put # #;
|
||||
@@ -162,19 +183,3 @@ options ls = &ls_tmp. ps = &ps_tmp. ¬es_tmp. &source_tmp.;
|
||||
%mend listPackages;
|
||||
|
||||
|
||||
/*** HELP START ***/
|
||||
|
||||
/* Macro to generate SAS packages.
|
||||
|
||||
Version 20230904
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
data, etc.) wrapped up together and %INCLUDEed by
|
||||
a single load.sas file (also embedded inside the zip).
|
||||
|
||||
See examples below.
|
||||
*/
|
||||
|
||||
/*** HELP END ***/
|
||||
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
, suppressExec=0 /* indicates if loading of exec files
|
||||
should be suppressed, 1=suppress
|
||||
*/
|
||||
)/secure
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to load SAS package, version 20230904. Run %loadPackage() for help info.'
|
||||
des = 'Macro to load SAS package, version 20240711. Run %loadPackage() for help info.'
|
||||
minoperator
|
||||
;
|
||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||
@@ -50,7 +50,7 @@ minoperator
|
||||
%put ### This is short help information for the `loadPackage` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to *load* SAS packages, version `20230904` #;
|
||||
%put # Macro to *load* SAS packages, version `20240711` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
@@ -250,7 +250,7 @@ minoperator
|
||||
;
|
||||
%if %superq(lazyData) = %then
|
||||
%do;
|
||||
%local tempLoad_minoperator;
|
||||
%local tempLoad_minoperator temp_noNotes_etc /* for hiding notes */ ;
|
||||
%let tempLoad_minoperator = %sysfunc(getoption(minoperator));
|
||||
options minoperator; /* MinOperator option is required for cherryPicking to work */
|
||||
%include &_PackageFileref_.(load.sas) / &source2.;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
is provided in required version */
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to load additional content for a SAS package, version 20230904. Run %loadPackageAddCnt() for help info.'
|
||||
des = 'Macro to load additional content for a SAS package, version 20240711. Run %loadPackageAddCnt() for help info.'
|
||||
minoperator
|
||||
;
|
||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||
@@ -35,7 +35,7 @@ minoperator
|
||||
%put ### This is short help information for the `loadPackageAddCnt` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to *load* additional content for a SAS package, version `20230904` #;
|
||||
%put # Macro to *load* additional content for a SAS package, version `20240711` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
@@ -298,14 +298,14 @@ minoperator
|
||||
|
||||
pathname_f = pathname("f");
|
||||
rc1 = filename("in", strip(pathname_f), "zip", "member='" !! strip(file) !! "' lrecl=1 recfm=n");
|
||||
length rc1txt $ 8192;
|
||||
length rc1msg $ 8192;
|
||||
rc1msg = sysmsg();
|
||||
rc2 = filename("out", catx("/", libText, scan(file, j , "/\")), "disk", "lrecl=1 recfm=n");
|
||||
length rc2txt $ 8192;
|
||||
length rc2msg $ 8192;
|
||||
rc2msg = sysmsg();
|
||||
|
||||
rc3 = fcopy("in", "out");
|
||||
length rc3txt $ 8192;
|
||||
length rc3msg $ 8192;
|
||||
rc3msg = sysmsg();
|
||||
|
||||
loadingProblem + (rc3 & 1);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to load multiple SAS packages at one run, version 20230904. Run %loadPackages() for help info.'
|
||||
des = 'Macro to load multiple SAS packages at one run, version 20240711. Run %loadPackages() for help info.'
|
||||
parmbuff
|
||||
;
|
||||
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
|
||||
@@ -27,7 +27,7 @@ parmbuff
|
||||
%put ### This is short help information for the `loadPackageS` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro wrapper for the loadPackage macro, version `20230904` #;
|
||||
%put # Macro wrapper for the loadPackage macro, version `20240711` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
@@ -68,7 +68,7 @@ parmbuff
|
||||
%put %nrstr( %%include packages(SPFinit.sas); %%* enable the framework; );
|
||||
%put ;
|
||||
%put %nrstr( %%installPackage(SQLinDS DFA) %%* install packages from the Internet; );
|
||||
%put %nrstr( %%loadPackageS(SQLinDS, DFA) %%* load packags content into the SAS session; );
|
||||
%put %nrstr( %%loadPackageS(SQLinDS, DFA) %%* load packages content into the SAS session; );
|
||||
%put ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
|
||||
%put #################################################################################;
|
||||
%put ;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to preview content of a SAS package, version 20230904. Run %previewPackage() for help info.'
|
||||
des = 'Macro to preview content of a SAS package, version 20240711. Run %previewPackage() for help info.'
|
||||
;
|
||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||
%do;
|
||||
@@ -38,7 +38,7 @@ des = 'Macro to preview content of a SAS package, version 20230904. Run %preview
|
||||
%put ### This is short help information for the `previewPackage` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to get previwe of a SAS packages, version `20230904` #;
|
||||
%put # Macro to get preview of a SAS packages, version `20240711` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to unload SAS package, version 20230904. Run %unloadPackage() for help info.'
|
||||
des = 'Macro to unload SAS package, version 20240711. Run %unloadPackage() for help info.'
|
||||
;
|
||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||
%do;
|
||||
@@ -35,7 +35,7 @@ des = 'Macro to unload SAS package, version 20230904. Run %unloadPackage() for h
|
||||
%put ### This is short help information for the `unloadPackage` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to unload SAS packages, version `20230904` #;
|
||||
%put # Macro to unload SAS packages, version `20240711` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
hashing_file() function, SAS 9.4M6 */
|
||||
)/secure
|
||||
/*** HELP END ***/
|
||||
des = 'Macro to verify SAS package with the hash digest, version 20230904. Run %verifyPackage() for help info.'
|
||||
des = 'Macro to verify SAS package with the hash digest, version 20240711. Run %verifyPackage() for help info.'
|
||||
;
|
||||
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
|
||||
%do;
|
||||
@@ -28,7 +28,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20230904. Run %
|
||||
%put ### This is short help information for the `verifyPackage` macro #;
|
||||
%put #-------------------------------------------------------------------------------#;
|
||||
%put # #;
|
||||
%put # Macro to verify SAS package with it hash digest, version `20230904` #;
|
||||
%put # Macro to verify SAS package with it hash digest, version `20240711` #;
|
||||
%put # #;
|
||||
%put # A SAS package is a zip file containing a group #;
|
||||
%put # of SAS codes (macros, functions, data steps generating #;
|
||||
|
||||
@@ -22,7 +22,7 @@ A **SAS package** is an automatically generated, single, stand alone *zip* file
|
||||
|
||||
The *purpose of a package* is to be a simple, and easy to access, code sharing medium, which will allow: on the one hand, to separate the code complex dependencies created by the developer from the user experience with the final product and, on the other hand, reduce developer's and user's unnecessary frustration related to a remote deployment process.
|
||||
|
||||
In this repository we are presenting the **SAS Packages Framework** which allows to develop and use SAS packages. The latest version of SPF is **`20230905`**.
|
||||
In this repository we are presenting the **SAS Packages Framework** which allows to develop and use SAS packages. The latest version of SPF is **`20240711`**.
|
||||
|
||||
**To get started with SAS Packages** try this [**`Getting Started with SAS Packages`**](https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/Documentation/Getting_Started_with_SAS_Packages.pdf "Getting Started with SAS Packages") presentation (see the `./SPF/Documentation` directory).
|
||||
|
||||
@@ -40,7 +40,7 @@ After assigning the directory do not change them when using the SPF since it may
|
||||
## This is short help information for the `installPackage` macro <a name="installpackage"></a>
|
||||
--------------------------------------------------------------------------------------------
|
||||
|
||||
Macro to install SAS packages, version `20230905`
|
||||
Macro to install SAS packages, version `20240711`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -149,7 +149,7 @@ filename packages "C:/SAS_PACKAGES";
|
||||
## This is short help information for the `helpPackage` macro <a name="helppackage"></a>
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Macro to get help about SAS packages, version `20230905`
|
||||
Macro to get help about SAS packages, version `20240711`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -225,7 +225,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
||||
## This is short help information for the `loadPackage` macro <a name="loadpackage"></a>
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Macro to *load* SAS packages, version `20230905`
|
||||
Macro to *load* SAS packages, version `20240711`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -377,7 +377,7 @@ If created, those macros are automatically deleted when the `%unloadPackage()` m
|
||||
## This is short help information for the `loadPackageS` macro <a name="loadpackages"></a>
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Macro wrapper for the loadPackage macro, version `20230905`
|
||||
Macro wrapper for the loadPackage macro, version `20240711`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -426,7 +426,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
||||
## This is short help information for the `unloadPackage` macro <a name="unloadpackage"></a>
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Macro to unload SAS packages, version `20230905`
|
||||
Macro to unload SAS packages, version `20240711`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -491,7 +491,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
||||
## This is short help information for the `listPackages` macro <a name="listpackages"></a>
|
||||
-----------------------------------------------------------------------------------------
|
||||
|
||||
Macro to list available SAS packages, version `20230905`
|
||||
Macro to list available SAS packages, version `20240711`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -532,7 +532,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
||||
## This is short help information for the `verifyPackage` macro <a name="verifypackage"></a>
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Macro to verify SAS package with it hash digest, version `20230905`
|
||||
Macro to verify SAS package with it hash digest, version `20240711`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -586,7 +586,7 @@ filename packages "C:/SAS_PACKAGES"; %* set-up a directory for packages;
|
||||
## This is short help information for the `previewPackage` macro <a name="previewpackage"></a>
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Macro to get previwe of a SAS packages, version `20230905`
|
||||
Macro to get preview of a SAS packages, version `20240711`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -653,7 +653,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
||||
## This is short help information for the `generatePackage` macro <a name="generatepackage"></a>
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Macro to generate SAS packages, version `20230905`
|
||||
Macro to generate SAS packages, version `20240711`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -666,7 +666,7 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation`
|
||||
Visit: `https://github.com/yabwon/SAS_PACKAGES/tree/main/SPF/Documentation`
|
||||
to read about the details of package generation process.
|
||||
|
||||
### Parameters:
|
||||
@@ -685,24 +685,36 @@ filename packages "C:/SAS_PACKAGES"; %* setup a directory for packages;
|
||||
- `packages=` Location of other packages for testing
|
||||
if there are dependencies in loading the package.
|
||||
Has to be a single directory, if more than one are
|
||||
provided than only the first is used.
|
||||
provided than only the first is used.
|
||||
If path to location contains spaces it should be quoted!
|
||||
|
||||
- `testResults=` Location where tests results should be stored,
|
||||
if null (the default) then the session WORK is used.
|
||||
- `testResults=` Location where tests results should be stored,
|
||||
if null (the default) then the session WORK is used.
|
||||
|
||||
- `sasexe=` Location of a DIRECTORY where the SAS binary is located,
|
||||
if null (the default) then the `!SASROOT` is used.
|
||||
|
||||
- `sascfgFile=` Location of a FILE with testing session configuration
|
||||
parameters, if null (the default) then no config file
|
||||
is pointed during the SAS invocation,
|
||||
if set to `DEF` then the `!SASROOT/sasv9.cfg` is used.
|
||||
|
||||
- `delTestWork=` Indicates if `WORK` directories generated by user tests
|
||||
should be deleted, i.e. the (NO)WORKTERM option is set.
|
||||
The default value: `1` means "delete tests work".
|
||||
Available values are `0` and `1`.
|
||||
|
||||
- `markdownDoc=` Indicates if a markdown file with documentation
|
||||
be generated from help information blocks.
|
||||
The default value: `0` means "do not generate the file".
|
||||
Available values are `0` and `1`.
|
||||
|
||||
- `easyArch=` When creating documentation file (`markdownDoc=1`)
|
||||
indicates if a copy of the zip and markdown files
|
||||
with the version number in the file name be created
|
||||
The default value: `0` means "do not create files".
|
||||
Available values are `0` and `1`.
|
||||
|
||||
- `sasexe=` Location of a DIRECTORY where the SAS binary is located,
|
||||
if null (the default) then the `!SASROOT` is used.
|
||||
|
||||
- `sascfgFile=` Location of a FILE with testing session configuration
|
||||
parameters, if null (the default) then no config file
|
||||
is pointed during the SAS invocation,
|
||||
if set to `DEF` then the `!SASROOT/sasv9.cfg` is used.
|
||||
|
||||
- `delTestWork=` Indicates if `WORK` directories generated by user tests
|
||||
should be deleted, i.e. the (NO)WORKTERM option is set.
|
||||
The default value: `1` means "delete tests work".
|
||||
Available values are `0` and `1`.
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
@@ -778,7 +790,7 @@ All files have to have `.sas` extension. Other files are ignored.
|
||||
|
|
||||
+-004_format [one file one format,
|
||||
| | option LIB= should be: work.&packageName.format
|
||||
| | (literally with macrovariable name and "format" sufix)]
|
||||
| | (literally with macrovariable name and "format" suffix)]
|
||||
| |
|
||||
| +-efg.sas [a file with a code creating format EFG and informat EFG]
|
||||
|
|
||||
@@ -814,9 +826,19 @@ All files have to have `.sas` extension. Other files are ignored.
|
||||
| |
|
||||
| +-abc.sas [a file with a code creating IML module ABC, _without_ "Proc IML" header]
|
||||
|
|
||||
+-011_casludf [one file one CAS-L user defined function,
|
||||
| | only plain code of the function, without "Proc CAS" header]
|
||||
| |
|
||||
| +-abc.sas [a file with a code creating CAS-L user defined function ABC, _without_ "Proc CAS" header]
|
||||
|
|
||||
+-012_kmfsnip [one file one KMF-abbreviation snippet,
|
||||
| | code snipped proper tagging]
|
||||
| |
|
||||
| +-abc.sas [a file with a KMF-abbreviation snippet ABC, _with_ proper tagging, snippets names are in low-case]
|
||||
|
|
||||
+-<sequential number>_<type [in lower case]>
|
||||
|
|
||||
+-00n_clean [if you need to clean something up after exec file execution,
|
||||
+-0nn_clean [if you need to clean something up after exec file execution,
|
||||
| | content of the files will be printed to the log before execution]
|
||||
| |
|
||||
| +-<no file, in this case folder may be skipped>
|
||||
@@ -846,7 +868,7 @@ All files have to have `.sas` extension. Other files are ignored.
|
||||
## This is short help information for the `extendPackagesFileref` macro <a name="extendpackagesfileref"></a>
|
||||
-----------------------------------------------------------------------------------------
|
||||
|
||||
Macro to list directories pointed by 'packages' fileref, version `20230905`
|
||||
Macro to list directories pointed by 'packages' fileref, version `20240711`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
@@ -886,7 +908,7 @@ filename packages ("D:/NEW_DIR" %extendPackagesFileref()); %* add new directory;
|
||||
## This is short help information for the `loadPackageAddCnt` macro <a name="loadpackageaddcnt"></a>
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Macro to load *additional content* for a SAS package, version `20230905`
|
||||
Macro to load *additional content* for a SAS package, version `20240711`
|
||||
|
||||
A SAS package is a zip file containing a group
|
||||
of SAS codes (macros, functions, data steps generating
|
||||
|
||||
699
SPF/SPFinit.sas
@@ -10,7 +10,7 @@ Packages:
|
||||
|
||||
---
|
||||
|
||||
- **SQLinDS**\[2.2.7\], based on Mike Rhoads' article *Use the Full Power of SAS in Your Function-Style Macros*. The package allows to write SQL queries in the data step, e.g.
|
||||
- **SQLinDS**\[2.3.0\], based on Mike Rhoads' article *Use the Full Power of SAS in Your Function-Style Macros*. The package allows to write SQL queries in the data step, e.g.
|
||||
```sas
|
||||
data class;
|
||||
set %SQL(
|
||||
@@ -22,13 +22,13 @@ data class;
|
||||
WH = weight + height;
|
||||
run;
|
||||
```
|
||||
SHA256 digest for SQLinDS: F*42DC179E1D2B946AD519C4EC04A068061B312E021C3F4BC4826D2775E116E1B9
|
||||
SHA256 digest for SQLinDS: F*3C010734B76CA7459C4D35087C899121011CD4AA2932B56335FF11A805C8EF8D
|
||||
|
||||
[Documentation for SQLinDS](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/sqlinds.md "Documentation for SQLinDS")
|
||||
|
||||
---
|
||||
|
||||
- **DFA** (Dynamic Function Arrays)\[0.5.6\], contains set of macros and FCMP functions which implement: a dynamically allocated array, a stack, a fifo queue, an ordered stack, and a priority queue, run `%helpPackage(DFA,createDFArray)` to find examples.
|
||||
- **DFA** (Dynamic Function Arrays)\[0.5.7\], contains set of macros and FCMP functions which implement: a dynamically allocated array, a stack, a fifo queue, an ordered stack, and a priority queue, run `%helpPackage(DFA,createDFArray)` to find examples.
|
||||
```sas
|
||||
%createDFArray(ArrDynamic, resizefactor=17);
|
||||
|
||||
@@ -55,13 +55,13 @@ data _null_;
|
||||
end;
|
||||
run;
|
||||
```
|
||||
SHA256 digest for DFA: F*09EA5201360922A91A9EEE72F4567792E9CFDFB591BA33419E2BF2B31D9B7C62
|
||||
SHA256 digest for DFA: F*012375D87F66EB3A7BF5DDD0CC5AEE28851733EE33CC63231DF9045BEB958168
|
||||
|
||||
[Documentation for DFA](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/dfa.md "Documentation for DFA")
|
||||
|
||||
---
|
||||
|
||||
- **macroArray**\[1.1.0\], implementation of an array concept in a macro language, e.g.
|
||||
- **macroArray**\[1.2.6\], implementation of an array concept in a macro language, e.g.
|
||||
```sas
|
||||
%array(ABC[17] (111:127), macarray=Y);
|
||||
|
||||
@@ -80,13 +80,13 @@ SHA256 digest for DFA: F*09EA5201360922A91A9EEE72F4567792E9CFDFB591BA33419E2BF2B
|
||||
which = 1:H:2
|
||||
);
|
||||
```
|
||||
SHA256 digest for macroArray: F*6A22A01868F4203862B3685F543D723C7DB8E9AB3C1A6357D2BFA030971B0D3C
|
||||
SHA256 digest for macroArray: F*3F3893F1FCD78719543703E4353F4CC19811D247C016F220FF729B283C1AD790
|
||||
|
||||
[Documentation for macroArray](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/macroarray.md "Documentation for macroArray")
|
||||
|
||||
---
|
||||
|
||||
- **BasePlus**\[1.30.0\] adds a bunch of functionalities I am missing in BASE SAS, such as:
|
||||
- **BasePlus**\[2.1.0\] adds a bunch of functionalities I am missing in BASE SAS, such as:
|
||||
```sas
|
||||
call arrMissToRight(myArray);
|
||||
call arrFillMiss(17, myArray);
|
||||
@@ -109,26 +109,38 @@ format x bool.;
|
||||
%dirsAndFiles(C:\SAS_WORK\,ODS=work.result)
|
||||
|
||||
%put %repeatTxt(#,15,s=$) HELLO SAS! %repeatTxt(#,15,s=$);
|
||||
|
||||
%put %date() %time() %datetime();
|
||||
|
||||
%put %date(yymmddn10.) %time(time5.) %datetime(e8601dt.);
|
||||
|
||||
%put %monthShift(2023,1,-5);
|
||||
|
||||
%put #%expandDataSetsList(lib=sashelp,datasets=_all_)#;
|
||||
```
|
||||
SHA256 digest for BasePlus: F*B91771D45C781B6806DBB44A3B491A0784D7698B9F3BBBE1A86EE5594834315F
|
||||
SHA256 digest for BasePlus: F*DFA83F8E0D7424DEB63D49620392068BC68D766552E2804CB6B01DE8E5A87769
|
||||
|
||||
[Documentation for BasePlus](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md "Documentation for BasePlus")
|
||||
|
||||
---
|
||||
|
||||
- **GSM** (Generate Secure Macros)\[0.21.1\], package allows
|
||||
- **GSM** (Generate Secure Macros)\[0.22.1\], package allows
|
||||
to create secured macros stored in SAS Proc FCMP functions.
|
||||
The dataset with functions can be shared between different operating systems
|
||||
and allows to generate macros on site without showing their code.
|
||||
|
||||
SHA256 digest for GSM: F*2FECDDB568B38E206CA4ADA6FDEF5209C0A08B99401A1510D777BABF9DA54682
|
||||
[Recording of presentation with "how it works" description (in Polish)](https://www.youtube.com/watch?v=LtaWPe2sgRY&t=1s "YouTube").
|
||||
|
||||
[The WUSS 2023 Conference article describing the idea](https://www.wuss.org/proceedings/2023/WUSS-2023-Paper-189.pdf "Article about the idea GSM")
|
||||
|
||||
SHA256 digest for GSM: F*80197391195C3EC41BD436DF0C8802D3920E4D22B64009A7DE872FBDF8D4B86E
|
||||
|
||||
[Documentation for GSM](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/gsm.md "Documentation for GSM")
|
||||
|
||||
---
|
||||
|
||||
- **dynMacroArray**\[0.2.6\], set of macros (wrappers for a hash table) emulating dynamic array in the data step (macro predecessor of DFA). Development of this package is currently on hold.
|
||||
- **dynMacroArray**\[0.2.7\], set of macros (wrappers for a hash table) emulating dynamic array in the data step (macro predecessor of DFA). Development of this package is currently on hold.
|
||||
|
||||
SHA256 digest for dynMacroArray: F*F50BEDB542D96B07C763EAB7549FBC5F08ED389DC2338BFAAEBFBD1FD20E22B6
|
||||
SHA256 digest for dynMacroArray: F*C1644842102C87522E22513744B249027306A833AF7951E51D1760FF28656C16
|
||||
|
||||
---
|
||||
|
||||
@@ -1,3 +1,73 @@
|
||||
/* 20240909 */
|
||||
BasePlus: F*DFA83F8E0D7424DEB63D49620392068BC68D766552E2804CB6B01DE8E5A87769
|
||||
|
||||
/* 20240724 */
|
||||
BasePlus: F*FB102C9B12E870666C15A651017D48E0141E47D64C11437350D0EC75A7E9E609
|
||||
|
||||
/* 20240723 */
|
||||
BasePlus: F*0730DD793516E5C193842126A7EC9D339ADADD19F0F40B071F938CABDE4E66AD
|
||||
|
||||
/* 20240722 */
|
||||
BasePlus: F*68BB953CD732EB43119A3339656670292317FE1C3B764EC57484C7D5C9DF23EB
|
||||
|
||||
/* 20240719 */
|
||||
BasePlus: F*2129F372D72A34A4FB1F368A581EA33D64AD4D8F3707213D5B9553F3C3122003
|
||||
|
||||
/* 20240710 */
|
||||
BasePlus: F*6012D1475AE22A4445C032D8EAE092BE515D8CD2AE390CC087F5987ACB8BCB13
|
||||
|
||||
/* 20240609 */
|
||||
BasePlus: F*6760DDF382E7CA9A1291F028FA7F2BACB68A3D31CEA3A85104E13EA08645AEF1
|
||||
|
||||
/* 20240606 */
|
||||
BasePlus: F*BD0333B92D7CB639A136CD4994DE0C63F8396E449E45BC714D71D2E15318F42D
|
||||
|
||||
/* 20240529 */
|
||||
BasePlus: F*3C3A2050E3FF46E1FC0F936634A66FC3F294A3531EFE0A7DC9CE74F2EF17C687
|
||||
|
||||
/* 20240312 */
|
||||
BasePlus: F*209FB8198270DEAB6151CE31391A352A065B4EE2689F40433FA9550A7F4AAC18
|
||||
|
||||
/* 20240309 */
|
||||
BasePlus: F*8155BFE82F7833E4B0DA24D81DBDFC58463906D6032B1F0161772DADE84BE790
|
||||
|
||||
/* 20240112 */
|
||||
BasePlus: F*B9F1B3243FD3956F0B68652C21EA1EBC19F3EB0931774A57FECE1F02A9448108
|
||||
|
||||
/* 20231201 */
|
||||
macroArray: F*3F3893F1FCD78719543703E4353F4CC19811D247C016F220FF729B283C1AD790
|
||||
|
||||
/* 20231129 */
|
||||
macroArray: F*FFF2C3D854F9B5677F561BA2EB6FAA2CCC652D81F6AF9473ADF0A4CE977E43F0
|
||||
|
||||
/* 20231123 */
|
||||
macroArray: F*A0840B92EB9356EDB318DBE9B579A345C85ABF69E8D5F7C73C144C66F2F74FB4
|
||||
|
||||
/* 20231114 */
|
||||
BasePlus: F*BCD89EDF856762EB8E441BC53933774483258453D1F7D74185F8A1861E414B0E
|
||||
|
||||
/* 20231111 */
|
||||
BasePlus: F*D84CE41A550DC2D5C092C70C04A796E8329F34087A603BEF0CD366910C162E80
|
||||
DFA: F*012375D87F66EB3A7BF5DDD0CC5AEE28851733EE33CC63231DF9045BEB958168
|
||||
dynMacroArray: F*C1644842102C87522E22513744B249027306A833AF7951E51D1760FF28656C16
|
||||
GSM: F*80197391195C3EC41BD436DF0C8802D3920E4D22B64009A7DE872FBDF8D4B86E
|
||||
macroArray: F*2A108D121D4DACAA8752E681301371F80F0500B2EE28A9E3B39678415BCBD6B2
|
||||
SQLinDS: F*3C010734B76CA7459C4D35087C899121011CD4AA2932B56335FF11A805C8EF8D
|
||||
|
||||
/* 20231107 */
|
||||
BasePlus: F*6214654B4575DC8E4BA3CF032924862C2F69A03A6384872BAA9F774EDF6A8DDA
|
||||
GSM: F*8D80AEB2DB7A4531BA124240E7A12EBE717293048561A877EB5B6B039BD11D18
|
||||
macroArray: F*8689194590698F9A00B57FB37BE3CA8D7330F16B3E591CEAF49E6BE0B70D61D0
|
||||
|
||||
/* 20231026 */
|
||||
BasePlus: F*3407AD8068C7528E129034144F9A44CFDF14B7DC34334C64C2F1D67351D1E01E
|
||||
|
||||
/* 20231012 */
|
||||
BasePlus: F*7EF23E80A2C03B29402183D97ECFF608B62BEDD9458848709B52DC362E6201B9
|
||||
|
||||
/* 20230921 */
|
||||
macroArray: F*E9C0C58FB36AC40C76A518066B8C6F9942202A9DB2C2D737E95D2BB6E4ECED50
|
||||
|
||||
/* 20230919 */
|
||||
BasePlus: F*B91771D45C781B6806DBB44A3B491A0784D7698B9F3BBBE1A86EE5594834315F
|
||||
|
||||
|
||||
7556
packages/baseplus.md
BIN
packages/baseplus_RainCloudPlot_Ex0.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 36 KiB |
BIN
packages/baseplus_RainCloudPlot_Ex1x.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
packages/baseplus_RainCloudPlot_Ex1y.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 82 KiB |
BIN
packages/baseplus_RainCloudPlot_Ex4.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
@@ -18,7 +18,7 @@
|
||||
|
||||
---
|
||||
|
||||
# The DFA package [ver. 0.5.6] <a name="dfa-package"></a> ###############################################
|
||||
# The DFA package [ver. 0.5.7] <a name="dfa-package"></a> ###############################################
|
||||
|
||||
The **DFA** (a.k.a. *Dynamic Function Array*) package implements:
|
||||
- dynamic numeric and character arrays,
|
||||
@@ -52,10 +52,10 @@ Package contains:
|
||||
12. exec generatearrays
|
||||
13. clean generatearrays
|
||||
|
||||
*SAS package generated by generatePackage, version 20230905*
|
||||
*SAS package generated by generatePackage, version 20231111*
|
||||
|
||||
The SHA256 hash digest for package DFA:
|
||||
`F*09EA5201360922A91A9EEE72F4567792E9CFDFB591BA33419E2BF2B31D9B7C62`
|
||||
`F*012375D87F66EB3A7BF5DDD0CC5AEE28851733EE33CC63231DF9045BEB958168`
|
||||
|
||||
---
|
||||
# Content description ############################################################################################
|
||||
|
||||
BIN
packages/dfa.zip
@@ -8,7 +8,7 @@
|
||||
---
|
||||
|
||||
|
||||
# The GSM package [ver. 0.21.1] <a name="gsm-package"></a> ###############################################
|
||||
# The GSM package [ver. 0.22.1] <a name="gsm-package"></a> ###############################################
|
||||
|
||||
The **GSM** (a.k.a. *Generate Secure Macros*) package allows
|
||||
to create secured macros stored in SAS Proc FCMP functions.
|
||||
@@ -42,7 +42,10 @@ run;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
See examples for more details.
|
||||
|
||||
Recording of presentation with "how it works" description, in Polish, is avaliable [here](https://www.youtube.com/watch?v=LtaWPe2sgRY&t=1s).
|
||||
[Recording of presentation with "how it works" description (in Polish)](https://www.youtube.com/watch?v=LtaWPe2sgRY&t=1s "YouTube").
|
||||
|
||||
[The WUSS 2023 Conference article describing the idea](https://www.lexjansen.com/wuss/2023/WUSS-2023-Paper-189.pdf "Article about the idea GSM")
|
||||
|
||||
|
||||
*How to use it:*
|
||||
- Copy all files with your secured macros code into a directory.
|
||||
@@ -91,10 +94,14 @@ Package contains:
|
||||
Required SAS Components:
|
||||
`Base SAS Software`
|
||||
|
||||
*SAS package generated by generatePackage, version 20230905*
|
||||
Package contains additional content, run: %loadPackageAddCnt(GSM) to load it
|
||||
or look for the gsm_AdditionalContent directory in the Packages fileref
|
||||
localization (only if additional content was deployed during the installation process).
|
||||
|
||||
*SAS package generated by generatePackage, version 20231111*
|
||||
|
||||
The SHA256 hash digest for package GSM:
|
||||
`F*2FECDDB568B38E206CA4ADA6FDEF5209C0A08B99401A1510D777BABF9DA54682`
|
||||
`F*80197391195C3EC41BD436DF0C8802D3920E4D22B64009A7DE872FBDF8D4B86E`
|
||||
|
||||
|
||||
## >>> `%GSM()` macro: <<< <a name="gsm-macro"></a> #######################
|
||||
|
||||
BIN
packages/gsm.zip
@@ -19,9 +19,9 @@
|
||||
|
||||
---
|
||||
|
||||
# The macroArray package [ver. 1.0.6] <a name="macroarray-package"></a> ###############################################
|
||||
# The macroArray package [ver. 1.2.6] <a name="macroarray-package"></a> ###############################################
|
||||
|
||||
The **macroArray** package implements a macro array facility:
|
||||
The **macroArray** package implements a macroarray facility:
|
||||
- `%array()`,
|
||||
- `%do_over()`,
|
||||
- `%make_do_over()`,
|
||||
@@ -75,10 +75,10 @@ Package contains:
|
||||
Required SAS Components:
|
||||
*Base SAS Software*
|
||||
|
||||
*SAS package generated by generatePackage, version 20230905*
|
||||
*SAS package generated by generatePackage, version 20231123*
|
||||
|
||||
The SHA256 hash digest for package macroArray:
|
||||
`F*4FAAEE7DF2854EA31933AE017A89C1615C7291A66A07CCE345041EB0D587ED4E`
|
||||
`F*3F3893F1FCD78719543703E4353F4CC19811D247C016F220FF729B283C1AD790`
|
||||
|
||||
---
|
||||
# Content description ############################################################################################
|
||||
@@ -244,7 +244,7 @@ The code of a macro was inspired by
|
||||
|
||||
The `%array()` macro version provided in the package
|
||||
is designed to facilitate
|
||||
the idea of macro array concept, i.e. *a list of
|
||||
the idea of macroarray concept, i.e. *a list of
|
||||
macrovariables with common prefix and numerical suffixes*.
|
||||
Usually such construction is then resolved by
|
||||
double ampersand syntax, e.g. `&&perfix&i` or similar one.
|
||||
@@ -253,7 +253,7 @@ What is new/extension to the `%array()` macro concept are:
|
||||
|
||||
0. The syntax is closer to the data step one.
|
||||
1. It is a pure macro code (it can be executed in any place
|
||||
of 4GL code), this includes generating macro arrays out
|
||||
of 4GL code), this includes generating macroarrays out
|
||||
of datasets.
|
||||
2. When a macroarrray is created it allows also to generate
|
||||
a new macro (named the same as the array name) and replace
|
||||
@@ -346,8 +346,9 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
||||
3) macroarray "W" with UNIQUE(|) values of variable "weight" and <br>
|
||||
4) macroarray "AGE" with UNIQUE(|) values of variable "age".
|
||||
|
||||
* `q=` - *Optional*, indicates (when set to `1`) if the value be surrounded by quotes.
|
||||
* `q=` - *Optional*, indicates (when set to `1` or '2') if the value should be surrounded by quotes.
|
||||
It uses `quote(cats(...))` combo under the hood. Default value is `0`.
|
||||
Value `1` is for apostrophes, value `2` is for double quotes.
|
||||
Ignored for `macarray=M`.
|
||||
|
||||
|
||||
@@ -1210,7 +1211,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
||||
1. `H` - *Required*, a hash table macro name and a declaration/definition,
|
||||
e.g. `mcHashTable(HT)`. It names a macro which is generated by
|
||||
the `%mcHashTable()` macro. Provided name cannot be empty
|
||||
or an underscore (`_`). No longer than *16* characters.
|
||||
or an underscore (`_`). No longer than *10* characters.
|
||||
|
||||
2. `METHOD` - *Optional*, if empty (or DECLARE or DCL) then the code of
|
||||
a macro hash table is compiled.
|
||||
@@ -1556,6 +1557,9 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
||||
%mcDictionary(
|
||||
H
|
||||
<,METHOD>
|
||||
<,DS=>
|
||||
<,K=Key>
|
||||
<,D=Data>
|
||||
)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -1564,13 +1568,25 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
||||
1. `H` - *Required*, a dictionary macro name and a declaration/definition,
|
||||
e.g. `mcDictionary(HT)`. It names a macro which is generated by
|
||||
the `%mcDictionary()` macro. Provided name cannot be empty
|
||||
or an underscore (`_`). No longer than *16* characters.
|
||||
or an underscore (`_`). No longer than *13* characters.
|
||||
|
||||
2. `METHOD` - *Optional*, if empty (or DECLARE or DCL) then the code of
|
||||
a macro dictionary is compiled.
|
||||
If `DELETE` then the macro dictionary named by `H` and all
|
||||
macrovariables named like "`&H._`" are deleted.
|
||||
|
||||
* `DS=` - *Optional*, if NOT empty then the `&DS.` dataset is used to
|
||||
populate dictionary with keys from variable `&K.` and data
|
||||
from variable `&D.` Works only during declaration.
|
||||
|
||||
* `K=` - *Optional*, if the `&DS.` is NOT empty then `&K.` holds a name of
|
||||
a variable which keeps or an expression which generates keys values.
|
||||
Default is `Key`.
|
||||
|
||||
* `D=` - *Optional*, if the `&DS.` is NOT empty then `&D.` holds a name of
|
||||
a variable which keeps or an expression which generates data values.
|
||||
Default is `Data`.
|
||||
|
||||
---
|
||||
|
||||
### THE CREATED MACRO `%&H.()`: ####################################################
|
||||
@@ -1704,7 +1720,7 @@ See examples below to see use cases.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
**EXAMPLE 2.** Populate macro dictionary from a dataset.
|
||||
**EXAMPLE 2A.** Populate macro dictionary from a dataset "by hand".
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||
%mcDictionary(CLASS)
|
||||
@@ -1714,6 +1730,7 @@ data _null_;
|
||||
call execute('%CLASS(ADD,key=' !! name !! ',data=' !! age !! ')');
|
||||
run;
|
||||
%put t = %sysevalf(%sysfunc(datetime()) - &t.);
|
||||
%put &=Class_KEYSNUM.;
|
||||
%put _user_;
|
||||
%CLASS(CLEAR)
|
||||
|
||||
@@ -1721,25 +1738,52 @@ run;
|
||||
%mcDictionary(CARS)
|
||||
%let t = %sysfunc(datetime());
|
||||
data _null_;
|
||||
set sashelp.cars;
|
||||
call execute('%CARS(ADD,key=' !! catx("|",make,model,type) !! ',data=' !! MPG_CITY !! ')');
|
||||
set sashelp.cars(obs=42);
|
||||
call execute('%CARS(ADD,key=' !! catx("|",make,model,type) !! ',data=' !! put(MPG_CITY*10,dollar10.2) !! ')');
|
||||
run;
|
||||
%put t = %sysevalf(%sysfunc(datetime()) - &t.);
|
||||
%put &=CARS_KEYSNUM.;
|
||||
%CARS(LIST);
|
||||
|
||||
%put %CARS(F,key=Audi|TT 3.2 coupe 2dr (convertible)|Sports);
|
||||
|
||||
%CARS(CLEAR)
|
||||
%put &=CARS_KEYSNUM.;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
**EXAMPLE 3.** Data portion may require quoting and un-quoting..
|
||||
**EXAMPLE 2B.** Populate macro dictionary from a dataset "automatically".
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||
%let t = %sysfunc(datetime());
|
||||
%mcDictionary(CLASS,DCL,DS=sashelp.class,k=name,d=_N_)
|
||||
%put t = %sysevalf(%sysfunc(datetime()) - &t.);
|
||||
%put &=CLASS_KEYSNUM.;
|
||||
%put _user_;
|
||||
%CLASS(CLEAR)
|
||||
|
||||
|
||||
%let t = %sysfunc(datetime());
|
||||
%mcDictionary(CARS,DCL,DS=sashelp.cars(obs=42),k=catx("|",make,model,type),d=put(MPG_CITY*10,dollar10.2))
|
||||
%put t = %sysevalf(%sysfunc(datetime()) - &t.);
|
||||
%put &=CARS_KEYSNUM.;
|
||||
%CARS(LIST);
|
||||
|
||||
%put %CARS(F,key=Audi|TT 3.2 coupe 2dr (convertible)|Sports);
|
||||
|
||||
%CARS(CLEAR)
|
||||
%put &=CARS_KEYSNUM.;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
**EXAMPLE 3.** Data portion may require quoting and un-quoting.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||
%mcDictionary(CODE)
|
||||
%CODE(CLEAR)
|
||||
%CODE(ADD,key=data, data=%str(data test; x = 42; run;))
|
||||
%CODE(ADD,key=proc, data=%str(proc print; run;))
|
||||
%CODE(ADD,key=macro,data=%nrstr(%put *****;))
|
||||
%CODE(ADD,key=macro,data=%nrstr(%put *1*2*3*4*;))
|
||||
|
||||
%CODE(FIND,key=data)
|
||||
%CODE(FIND,key=proc)
|
||||
@@ -1765,6 +1809,7 @@ data _null_;
|
||||
end;
|
||||
run;
|
||||
%put t = %sysevalf(%sysfunc(datetime()) - &t.);
|
||||
%put %AAA(F,key=A555) %AAA(CHECK,key=A555);
|
||||
%put &=AAA_KEYSNUM;
|
||||
%AAA(CLEAR)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -1780,13 +1825,50 @@ run;
|
||||
%mcDictionary(ABCDEFGHIJKLMNOP) %* good;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
**EXAMPLE 6.** More fun with datasets.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||
|
||||
data work.metadata;
|
||||
input key :$16. data :$128.;
|
||||
cards;
|
||||
ID ABC-123-XYZ
|
||||
path /path/to/study/data
|
||||
cutoffDT 2023-01-01
|
||||
startDT 2020-01-01
|
||||
endDT 2024-12-31
|
||||
MedDRA v26.0
|
||||
;
|
||||
run;
|
||||
proc print;
|
||||
run;
|
||||
|
||||
%mcDictionary(Study,dcl,DS=work.metadata)
|
||||
|
||||
%put _user_;
|
||||
|
||||
%put *%Study(F,key=ID)**%Study(C,key=ID)*;
|
||||
|
||||
title1 "Study %Study(F,key=ID) is located at %Study(F,key=path)";
|
||||
title2 "it starts %Study(F,key=startDT) and ends %Study(F,key=endDT)";
|
||||
footnote "MedDRA version: %Study(F,key=MedDRA)";
|
||||
|
||||
proc print data=sashelp.class(obs=7);
|
||||
run;
|
||||
|
||||
title;
|
||||
footnote;
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
---
|
||||
|
||||
## >>> `%QzipArrays()` macro: <<< <a name="qziparrays-macro"></a> #######################
|
||||
|
||||
The zipArrays() and QzipArrays() macros
|
||||
allow to use a function on elements of pair of
|
||||
macro arrays.
|
||||
macroarrays.
|
||||
|
||||
For two macroarrays the corresponding
|
||||
elements are taken and the macro applies a function, provided by user,
|
||||
@@ -1897,7 +1979,7 @@ See examples in `%zipArrays()` help for the details.
|
||||
|
||||
The zipArrays() and QzipArrays() macros
|
||||
allow to use a function on elements of pair of
|
||||
macro arrays.
|
||||
macroarrays.
|
||||
|
||||
For two macroarrays the corresponding
|
||||
elements are taken and the macro applies a function, provided by user,
|
||||
@@ -2096,7 +2178,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
||||
## >>> `%sortMacroArray()` macro: <<< <a name="sortmacroarray-macro"></a> #######################
|
||||
|
||||
The sortMacroArray() macro
|
||||
allow to sort elements of a macro array.
|
||||
allow to sort elements of a macroarray.
|
||||
|
||||
The **limitation** is that sorted values are limited to 32767 bytes of length.
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
---
|
||||
|
||||
# The SQLinDS package [ver. 2.2.7] <a name="sqlinds-package"></a> ###############################################
|
||||
# The SQLinDS package [ver. 2.3.0] <a name="sqlinds-package"></a> ###############################################
|
||||
|
||||
The **SQLinDS** package is an implementation of
|
||||
the *macro-function-sandwich* concept introduced in the
|
||||
@@ -35,8 +35,9 @@ SQLinDS package contains the following components:
|
||||
|
||||
1. `%SQL()` macro - the main package macro available for the User
|
||||
2. `dsSQL()` function (internal)
|
||||
3. `%dsSQL_inner()` macro (internal)
|
||||
3. `%dsSQL_inner()` macro (internal)
|
||||
4. Library `DSSQL` (created as a subdirectory of the `WORK` library)
|
||||
5. Optional KMF-abbreviations `sqlinds`
|
||||
|
||||
---
|
||||
|
||||
@@ -45,14 +46,19 @@ Package contains:
|
||||
2. macro dssql_inner
|
||||
3. macro sql
|
||||
4. function dssql
|
||||
5. kmfsnip sqlinds
|
||||
|
||||
Required SAS Components:
|
||||
*Base SAS Software*
|
||||
|
||||
*SAS package generated by generatePackage, version 20230905*
|
||||
Package contains additional content, run: %loadPackageAddCnt(SQLinDS) to load it
|
||||
or look for the sqlinds_AdditionalContent directory in the Packages fileref
|
||||
localization (only if additional content was deployed during the installation process).
|
||||
|
||||
*SAS package generated by generatePackage, version 20231111*
|
||||
|
||||
The SHA256 hash digest for package SQLinDS:
|
||||
`F*42DC179E1D2B946AD519C4EC04A068061B312E021C3F4BC4826D2775E116E1B9`
|
||||
`F*3C010734B76CA7459C4D35087C899121011CD4AA2932B56335FF11A805C8EF8D`
|
||||
|
||||
---
|
||||
# Content description ############################################################################################
|
||||
|
||||