Compare commits

...

5 Commits

Author SHA1 Message Date
Bart Jablonski
73f0ba2d4c SAS Packages Framework, version 20240423
SAS Packages Framework, version 20240423

A minor aesthetic update in a log note about KMF snippets added to `%generatePackage()` macro. Does not change any functionality, just make it look nicer.
2024-04-23 11:32:52 +02:00
Bart Jablonski
c38cb1e70d SAS Packages Framework, version 20240415
SAS Packages Framework, version 20240415

Features:

- In the `%generatePackage()` macro, when `markdownDoc=` parameters is used, packages files can be "excluded" from being used to produce documentation markdown file.

- Documentation updated.
2024-04-15 19:31:06 +02:00
Bart Jablonski
0a738cc639 The BasePlus package [ver. 1.38.0]
The BasePlus package [ver. 1.38.0]

Update to the `%rainCloudPlot()` macro, new parameter for "vertical" plots added.

Documentation updated and "cleaned".

---

SHA256 digest for BasePlus: `F*209FB8198270DEAB6151CE31391A352A065B4EE2689F40433FA9550A7F4AAC18`

---
2024-03-12 14:42:23 +01:00
Bart Jablonski
3cf49b5221 The BasePlus package [ver. 1.37.0]
## The BasePlus package [ver. 1.37.0]

Changes:

- Update to the %rainCloudPlot() macro.
- New macro %iffunc() added.
- Documentation updated.

---

SHA256 digest for BasePlus: F*8155BFE82F7833E4B0DA24D81DBDFC58463906D6032B1F0161772DADE84BE790

---
2024-03-10 08:30:04 +01:00
Bart Jablonski
8638902ec3 The BasePlus package [ver. 1.37.0]
## The BasePlus package [ver. 1.37.0]

Changes:

- Update to the %rainCloudPlot() macro.
- New macro %iffunc() added.
- Documentation updated.

---

SHA256 digest for BasePlus: F*8155BFE82F7833E4B0DA24D81DBDFC58463906D6032B1F0161772DADE84BE790

---
2024-03-09 13:53:32 +01:00
28 changed files with 525 additions and 191 deletions

View File

@@ -16,7 +16,7 @@ Don't forget to **STAR** (:star:) the repository! :-)
### Current version: ### Current version:
**The latest version** of SPF is **`20231210`**. **The latest version** of SPF is **`20240423`**.
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). 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).

View File

@@ -6,7 +6,7 @@
when empty the "packages" value is used */ when empty the "packages" value is used */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to list directories pointed by "packages" fileref, version 20231210. Run %extendPackagesFileref(HELP) for help info.' des = 'Macro to list directories pointed by "packages" fileref, version 20240423. Run %extendPackagesFileref(HELP) for help info.'
; ;
%if %QUPCASE(&packages.) = HELP %then %if %QUPCASE(&packages.) = HELP %then
@@ -22,7 +22,7 @@ des = 'Macro to list directories pointed by "packages" fileref, version 20231210
%put ### This is short help information for the `extendPackagesFileref` macro #; %put ### This is short help information for the `extendPackagesFileref` macro #;
%put #-----------------------------------------------------------------------------------------#;; %put #-----------------------------------------------------------------------------------------#;;
%put # #; %put # #;
%put # Macro to list directories pointed by 'packages' fileref, version `20231210` #; %put # Macro to list directories pointed by 'packages' fileref, version `20240423` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;

View File

@@ -3,7 +3,7 @@
Macro to generate SAS packages. Macro to generate SAS packages.
Version 20231210 Version 20240415
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -43,7 +43,7 @@
file name be created */ file name be created */
)/ secure minoperator )/ secure minoperator
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to generate SAS packages, version 20231210. Run %generatePackage() for help info.' des = 'Macro to generate SAS packages, version 20240423. Run %generatePackage() for help info.'
; ;
%if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then %if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then
%do; %do;
@@ -58,7 +58,7 @@ des = 'Macro to generate SAS packages, version 20231210. Run %generatePackage()
%put ### This is short help information for the `generatePackage` macro #; %put ### This is short help information for the `generatePackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to generate SAS packages, version `20231210` #; %put # Macro to generate SAS packages, version `20240423` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -854,7 +854,7 @@ title6 "MD5 hashed fileref of package lowcase name: &_PackageFileref_.";
title8 "Required SAS packages: %qsysfunc(compress(%superq(packageReqPackages),%str(%'%")))" ; /* " */ title8 "Required SAS packages: %qsysfunc(compress(%superq(packageReqPackages),%str(%'%")))" ; /* " */
%end; %end;
footnote1 "SAS Packages Framework, version 20231210"; footnote1 "SAS Packages Framework, version 20240423";
proc print data = &filesWithCodes.(drop=base folderRef fileRef rc folderid _abort_ fileId additionalContent); proc print data = &filesWithCodes.(drop=base folderRef fileRef rc folderid _abort_ fileId additionalContent);
run; run;
@@ -1575,7 +1575,7 @@ data _null_;
%end; %end;
put +(-1) '`.;''' / put +(-1) '`.;''' /
' !! '' %put The macro generated: '' !! put(dtCASLudf, E8601DT19.-L) !! ";"' / ' !! '' %put The macro generated: '' !! put(dtCASLudf, E8601DT19.-L) !! ";"' /
' !! '' %put with the SAS Packages Framework version 20231210.;''' / ' !! '' %put with the SAS Packages Framework version 20240423.;''' /
' !! '' %put ****************************************************************************;''' / ' !! '' %put ****************************************************************************;''' /
' !! '' %GOTO theEndOfTheMacro;''' / ' !! '' %GOTO theEndOfTheMacro;''' /
' !! '' %end;''' ; ' !! '' %end;''' ;
@@ -1740,7 +1740,7 @@ data _null_;
%end; %end;
put +(-1) '`.; '' !!' / put +(-1) '`.; '' !!' /
''' %put The macro generated: ''' " !! put(dtIML, E8601DT19.-L) !! " '''; '' !!' / ''' %put The macro generated: ''' " !! put(dtIML, E8601DT19.-L) !! " '''; '' !!' /
''' %put with the SAS Packages Framework version 20231210.; '' !! ' / ''' %put with the SAS Packages Framework version 20240423.; '' !! ' /
''' %put ****************************************************************************; '' !! ' / ''' %put ****************************************************************************; '' !! ' /
''' %GOTO theEndOfTheMacro; '' !! ' / ''' %GOTO theEndOfTheMacro; '' !! ' /
''' %end; '' !! ' / ''' %end; '' !! ' /
@@ -1894,7 +1894,7 @@ data _null_;
/ ' putlog / @7 "Should you have any problem with finding the file consider moving";' / ' 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 "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 KMFin " "''%sysfunc(pathname(WORK))/%lowcase(&packageName..kmf)''" " lrecl=1 recfm=n;";'
/ ' putlog @7 " filename KMFout ""</directory/of/your/choice>/testpackageclean.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 @7 '' %put *%sysfunc(fcopy(KMFin, KMFout))*(0=success)*;'';'
/ ' putlog / "0a"x / " ";' / ' putlog / "0a"x / " ";'
@@ -2527,7 +2527,7 @@ data _null_;
%end; %end;
put 'put " " / @3 "--------------------------------------------------------------------" / " ";' put 'put " " / @3 "--------------------------------------------------------------------" / " ";'
/ 'put @3 "*SAS package generated by SAS Package Framework, version `20231210`*";' / 'put @3 "*SAS package generated by SAS Package Framework, version `20240423`*";'
/ 'put " " / @3 "--------------------------------------------------------------------";'; / 'put " " / @3 "--------------------------------------------------------------------";';
put 'run; ' /; put 'run; ' /;
@@ -3563,7 +3563,7 @@ data &filesWithCodes.markdown;
%end; %end;
put " " / "--------------------------------------------------------------------" / " " put " " / "--------------------------------------------------------------------" / " "
/ "*SAS package generated by SAS Package Framework, version `20231210`*" / "*SAS package generated by SAS Package Framework, version `20240423`*"
/ " " / "--------------------------------------------------------------------" / " "; / " " / "--------------------------------------------------------------------" / " ";
put "# The `&packageName.` package content"; put "# The `&packageName.` package content";
@@ -3574,6 +3574,25 @@ data &filesWithCodes.markdown;
set &filesWithCodes. end = EOFDS nobs = NOBS curobs = CUROBS; set &filesWithCodes. end = EOFDS nobs = NOBS curobs = CUROBS;
if upcase(type) in: ('TEST') then continue; /* exclude tests */ 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; type2=type;
length link $ 256; length link $ 256;
link=catx("-",compress(fileshort,,"KAD"),type,CUROBS); link=catx("-",compress(fileshort,,"KAD"),type,CUROBS);

View File

@@ -28,7 +28,7 @@
*/ */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to get help about SAS package, version 20231210. Run %helpPackage() for help info.' des = 'Macro to get help about SAS package, version 20240423. Run %helpPackage() for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %do;
@@ -43,7 +43,7 @@ des = 'Macro to get help about SAS package, version 20231210. Run %helpPackage()
%put ### This is short help information for the `helpPackage` macro #; %put ### This is short help information for the `helpPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to get help about SAS packages, version `20231210` #; %put # Macro to get help about SAS packages, version `20240423` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;

View File

@@ -1,5 +1,5 @@
/*+installPackage+*/ /*+installPackage+*/
/* Macros to install SAS packages, version 20231210 */ /* Macros to install SAS packages, version 20240415 */
/* A SAS package is a zip file containing a group of files /* A SAS package is a zip file containing a group of files
with SAS code (macros, functions, data steps generating with SAS code (macros, functions, data steps generating
data, etc.) wrapped up together and %INCLUDEed by data, etc.) wrapped up together and %INCLUDEed by
@@ -22,7 +22,7 @@
/secure /secure
minoperator minoperator
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to install SAS package, version 20231210. Run %%installPackage() for help info.' des = 'Macro to install SAS package, version 20240423. Run %%installPackage() for help info.'
; ;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then %if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
%do; %do;
@@ -37,7 +37,7 @@ des = 'Macro to install SAS package, version 20231210. Run %%installPackage() fo
%put ### This is short help information for the `installPackage` macro #; %put ### This is short help information for the `installPackage` macro #;
%put #--------------------------------------------------------------------------------------------#;; %put #--------------------------------------------------------------------------------------------#;;
%put # #; %put # #;
%put # Macro to install SAS packages, version `20231210` #; %put # Macro to install SAS packages, version `20240423` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;

View File

@@ -3,7 +3,7 @@
Macro to list SAS packages in packages folder. Macro to list SAS packages in packages folder.
Version 20231210 Version 20240415
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -22,7 +22,7 @@
%macro listPackages()/secure PARMBUFF %macro listPackages()/secure PARMBUFF
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20231210.' des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20240423.'
; ;
%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then %if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
%do; %do;
@@ -37,7 +37,7 @@ des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HE
%put ### This is short help information for the `listPackages` macro #; %put ### This is short help information for the `listPackages` macro #;
%put #-----------------------------------------------------------------------------------------#;; %put #-----------------------------------------------------------------------------------------#;;
%put # #; %put # #;
%put # Macro to list available SAS packages, version `20231210` #; %put # Macro to list available SAS packages, version `20240423` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;

View File

@@ -34,7 +34,7 @@
*/ */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to load SAS package, version 20231210. Run %loadPackage() for help info.' des = 'Macro to load SAS package, version 20240423. Run %loadPackage() for help info.'
minoperator minoperator
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
@@ -50,7 +50,7 @@ minoperator
%put ### This is short help information for the `loadPackage` macro #; %put ### This is short help information for the `loadPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to *load* SAS packages, version `20231210` #; %put # Macro to *load* SAS packages, version `20240423` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;

View File

@@ -19,7 +19,7 @@
is provided in required version */ is provided in required version */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to load additional content for a SAS package, version 20231210. Run %loadPackageAddCnt() for help info.' des = 'Macro to load additional content for a SAS package, version 20240423. Run %loadPackageAddCnt() for help info.'
minoperator minoperator
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
@@ -35,7 +35,7 @@ minoperator
%put ### This is short help information for the `loadPackageAddCnt` macro #; %put ### This is short help information for the `loadPackageAddCnt` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to *load* additional content for a SAS package, version `20231210` #; %put # Macro to *load* additional content for a SAS package, version `20240423` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;

View File

@@ -11,7 +11,7 @@
*/ */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to load multiple SAS packages at one run, version 20231210. Run %loadPackages() for help info.' des = 'Macro to load multiple SAS packages at one run, version 20240423. Run %loadPackages() for help info.'
parmbuff parmbuff
; ;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then %if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
@@ -27,7 +27,7 @@ parmbuff
%put ### This is short help information for the `loadPackageS` macro #; %put ### This is short help information for the `loadPackageS` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro wrapper for the loadPackage macro, version `20231210` #; %put # Macro wrapper for the loadPackage macro, version `20240423` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;

View File

@@ -23,7 +23,7 @@
*/ */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to preview content of a SAS package, version 20231210. Run %previewPackage() for help info.' des = 'Macro to preview content of a SAS package, version 20240423. Run %previewPackage() for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %do;
@@ -38,7 +38,7 @@ des = 'Macro to preview content of a SAS package, version 20231210. Run %preview
%put ### This is short help information for the `previewPackage` macro #; %put ### This is short help information for the `previewPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to get previwe of a SAS packages, version `20231210` #; %put # Macro to get preview of a SAS packages, version `20240423` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;

View File

@@ -20,7 +20,7 @@
*/ */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to unload SAS package, version 20231210. Run %unloadPackage() for help info.' des = 'Macro to unload SAS package, version 20240423. Run %unloadPackage() for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %do;
@@ -35,7 +35,7 @@ des = 'Macro to unload SAS package, version 20231210. Run %unloadPackage() for h
%put ### This is short help information for the `unloadPackage` macro #; %put ### This is short help information for the `unloadPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to unload SAS packages, version `20231210` #; %put # Macro to unload SAS packages, version `20240423` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;

View File

@@ -13,7 +13,7 @@
hashing_file() function, SAS 9.4M6 */ hashing_file() function, SAS 9.4M6 */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to verify SAS package with the hash digest, version 20231210. Run %verifyPackage() for help info.' des = 'Macro to verify SAS package with the hash digest, version 20240423. Run %verifyPackage() for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %do;
@@ -28,7 +28,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20231210. Run %
%put ### This is short help information for the `verifyPackage` macro #; %put ### This is short help information for the `verifyPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to verify SAS package with it hash digest, version `20231210` #; %put # Macro to verify SAS package with it hash digest, version `20240423` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;

View File

@@ -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. 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 **`20231210`**. In this repository we are presenting the **SAS Packages Framework** which allows to develop and use SAS packages. The latest version of SPF is **`20240423`**.
**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). **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> ## This is short help information for the `installPackage` macro <a name="installpackage"></a>
-------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------
Macro to install SAS packages, version `20231210` Macro to install SAS packages, version `20240423`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating 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> ## This is short help information for the `helpPackage` macro <a name="helppackage"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to get help about SAS packages, version `20231210` Macro to get help about SAS packages, version `20240423`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating 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> ## This is short help information for the `loadPackage` macro <a name="loadpackage"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to *load* SAS packages, version `20231210` Macro to *load* SAS packages, version `20240423`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating 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> ## This is short help information for the `loadPackageS` macro <a name="loadpackages"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro wrapper for the loadPackage macro, version `20231210` Macro wrapper for the loadPackage macro, version `20240423`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating 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> ## This is short help information for the `unloadPackage` macro <a name="unloadpackage"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to unload SAS packages, version `20231210` Macro to unload SAS packages, version `20240423`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating 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> ## This is short help information for the `listPackages` macro <a name="listpackages"></a>
----------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------
Macro to list available SAS packages, version `20231210` Macro to list available SAS packages, version `20240423`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating 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> ## This is short help information for the `verifyPackage` macro <a name="verifypackage"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to verify SAS package with it hash digest, version `20231210` Macro to verify SAS package with it hash digest, version `20240423`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating 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> ## This is short help information for the `previewPackage` macro <a name="previewpackage"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to get previwe of a SAS packages, version `20231210` Macro to get preview of a SAS packages, version `20240423`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating 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> ## This is short help information for the `generatePackage` macro <a name="generatepackage"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to generate SAS packages, version `20231210` Macro to generate SAS packages, version `20240423`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -868,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> ## This is short help information for the `extendPackagesFileref` macro <a name="extendpackagesfileref"></a>
----------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------
Macro to list directories pointed by 'packages' fileref, version `20231210` Macro to list directories pointed by 'packages' fileref, version `20240423`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -908,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> ## This is short help information for the `loadPackageAddCnt` macro <a name="loadpackageaddcnt"></a>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Macro to load *additional content* for a SAS package, version `20231210` Macro to load *additional content* for a SAS package, version `20240423`
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating

View File

@@ -12,7 +12,7 @@
/* */ /* */
/* Here is the official version: */ /* Here is the official version: */
/* /*
Copyright (c) 2019 - 2023 Bartosz Jablonski (yabwon@gmail.com) Copyright (c) 2019 - 2024 Bartosz Jablonski (yabwon@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -42,7 +42,7 @@
- to unload, or - to unload, or
- to generate SAS packages. - to generate SAS packages.
Version 20231210. Version 20240423.
See examples below. See examples below.
A SAS package is a zip file containing a group of files A SAS package is a zip file containing a group of files
@@ -89,7 +89,7 @@
*/ */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to load SAS package, version 20231210. Run %loadPackage() for help info.' des = 'Macro to load SAS package, version 20240423. Run %loadPackage() for help info.'
minoperator minoperator
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
@@ -105,7 +105,7 @@ minoperator
%put ### This is short help information for the `loadPackage` macro #; %put ### This is short help information for the `loadPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to *load* SAS packages, version `20231210` #; %put # Macro to *load* SAS packages, version `20240423` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -360,7 +360,7 @@ minoperator
*/ */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to unload SAS package, version 20231210. Run %unloadPackage() for help info.' des = 'Macro to unload SAS package, version 20240423. Run %unloadPackage() for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %do;
@@ -375,7 +375,7 @@ des = 'Macro to unload SAS package, version 20231210. Run %unloadPackage() for h
%put ### This is short help information for the `unloadPackage` macro #; %put ### This is short help information for the `unloadPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to unload SAS packages, version `20231210` #; %put # Macro to unload SAS packages, version `20240423` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -524,7 +524,7 @@ des = 'Macro to unload SAS package, version 20231210. Run %unloadPackage() for h
*/ */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to get help about SAS package, version 20231210. Run %helpPackage() for help info.' des = 'Macro to get help about SAS package, version 20240423. Run %helpPackage() for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %do;
@@ -539,7 +539,7 @@ des = 'Macro to get help about SAS package, version 20231210. Run %helpPackage()
%put ### This is short help information for the `helpPackage` macro #; %put ### This is short help information for the `helpPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to get help about SAS packages, version `20231210` #; %put # Macro to get help about SAS packages, version `20240423` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -678,7 +678,7 @@ TODO:
*/ */
/*+installPackage+*/ /*+installPackage+*/
/* Macros to install SAS packages, version 20231210 */ /* Macros to install SAS packages, version 20240415 */
/* A SAS package is a zip file containing a group of files /* A SAS package is a zip file containing a group of files
with SAS code (macros, functions, data steps generating with SAS code (macros, functions, data steps generating
data, etc.) wrapped up together and %INCLUDEed by data, etc.) wrapped up together and %INCLUDEed by
@@ -701,7 +701,7 @@ TODO:
/secure /secure
minoperator minoperator
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to install SAS package, version 20231210. Run %%installPackage() for help info.' des = 'Macro to install SAS package, version 20240423. Run %%installPackage() for help info.'
; ;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then %if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
%do; %do;
@@ -716,7 +716,7 @@ des = 'Macro to install SAS package, version 20231210. Run %%installPackage() fo
%put ### This is short help information for the `installPackage` macro #; %put ### This is short help information for the `installPackage` macro #;
%put #--------------------------------------------------------------------------------------------#;; %put #--------------------------------------------------------------------------------------------#;;
%put # #; %put # #;
%put # Macro to install SAS packages, version `20231210` #; %put # Macro to install SAS packages, version `20240423` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -1170,7 +1170,7 @@ des = 'Macro to install SAS package, version 20231210. Run %%installPackage() fo
Macro to list SAS packages in packages folder. Macro to list SAS packages in packages folder.
Version 20231210 Version 20240415
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -1189,7 +1189,7 @@ des = 'Macro to install SAS package, version 20231210. Run %%installPackage() fo
%macro listPackages()/secure PARMBUFF %macro listPackages()/secure PARMBUFF
des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20231210.' des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HELP) for help, version 20240423.'
; ;
%if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then %if %QUPCASE(&SYSPBUFF.) = %str(%(HELP%)) %then
%do; %do;
@@ -1204,7 +1204,7 @@ des = 'Macro to list SAS packages from `packages` fileref, type %listPackages(HE
%put ### This is short help information for the `listPackages` macro #; %put ### This is short help information for the `listPackages` macro #;
%put #-----------------------------------------------------------------------------------------#;; %put #-----------------------------------------------------------------------------------------#;;
%put # #; %put # #;
%put # Macro to list available SAS packages, version `20231210` #; %put # Macro to list available SAS packages, version `20240423` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -1355,7 +1355,7 @@ options ls = &ls_tmp. ps = &ps_tmp. &notes_tmp. &source_tmp.;
Macro to generate SAS packages. Macro to generate SAS packages.
Version 20231210 Version 20240415
A SAS package is a zip file containing a group A SAS package is a zip file containing a group
of SAS codes (macros, functions, data steps generating of SAS codes (macros, functions, data steps generating
@@ -1395,7 +1395,7 @@ options ls = &ls_tmp. ps = &ps_tmp. &notes_tmp. &source_tmp.;
file name be created */ file name be created */
)/ secure minoperator )/ secure minoperator
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to generate SAS packages, version 20231210. Run %generatePackage() for help info.' des = 'Macro to generate SAS packages, version 20240423. Run %generatePackage() for help info.'
; ;
%if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then %if (%superq(filesLocation) = ) OR (%qupcase(&filesLocation.) = HELP) %then
%do; %do;
@@ -1410,7 +1410,7 @@ des = 'Macro to generate SAS packages, version 20231210. Run %generatePackage()
%put ### This is short help information for the `generatePackage` macro #; %put ### This is short help information for the `generatePackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to generate SAS packages, version `20231210` #; %put # Macro to generate SAS packages, version `20240423` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -2206,7 +2206,7 @@ title6 "MD5 hashed fileref of package lowcase name: &_PackageFileref_.";
title8 "Required SAS packages: %qsysfunc(compress(%superq(packageReqPackages),%str(%'%")))" ; /* " */ title8 "Required SAS packages: %qsysfunc(compress(%superq(packageReqPackages),%str(%'%")))" ; /* " */
%end; %end;
footnote1 "SAS Packages Framework, version 20231210"; footnote1 "SAS Packages Framework, version 20240423";
proc print data = &filesWithCodes.(drop=base folderRef fileRef rc folderid _abort_ fileId additionalContent); proc print data = &filesWithCodes.(drop=base folderRef fileRef rc folderid _abort_ fileId additionalContent);
run; run;
@@ -2927,7 +2927,7 @@ data _null_;
%end; %end;
put +(-1) '`.;''' / put +(-1) '`.;''' /
' !! '' %put The macro generated: '' !! put(dtCASLudf, E8601DT19.-L) !! ";"' / ' !! '' %put The macro generated: '' !! put(dtCASLudf, E8601DT19.-L) !! ";"' /
' !! '' %put with the SAS Packages Framework version 20231210.;''' / ' !! '' %put with the SAS Packages Framework version 20240423.;''' /
' !! '' %put ****************************************************************************;''' / ' !! '' %put ****************************************************************************;''' /
' !! '' %GOTO theEndOfTheMacro;''' / ' !! '' %GOTO theEndOfTheMacro;''' /
' !! '' %end;''' ; ' !! '' %end;''' ;
@@ -3092,7 +3092,7 @@ data _null_;
%end; %end;
put +(-1) '`.; '' !!' / put +(-1) '`.; '' !!' /
''' %put The macro generated: ''' " !! put(dtIML, E8601DT19.-L) !! " '''; '' !!' / ''' %put The macro generated: ''' " !! put(dtIML, E8601DT19.-L) !! " '''; '' !!' /
''' %put with the SAS Packages Framework version 20231210.; '' !! ' / ''' %put with the SAS Packages Framework version 20240423.; '' !! ' /
''' %put ****************************************************************************; '' !! ' / ''' %put ****************************************************************************; '' !! ' /
''' %GOTO theEndOfTheMacro; '' !! ' / ''' %GOTO theEndOfTheMacro; '' !! ' /
''' %end; '' !! ' / ''' %end; '' !! ' /
@@ -3246,7 +3246,7 @@ data _null_;
/ ' putlog / @7 "Should you have any problem with finding the file consider moving";' / ' 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 "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 KMFin " "''%sysfunc(pathname(WORK))/%lowcase(&packageName..kmf)''" " lrecl=1 recfm=n;";'
/ ' putlog @7 " filename KMFout ""</directory/of/your/choice>/testpackageclean.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 @7 '' %put *%sysfunc(fcopy(KMFin, KMFout))*(0=success)*;'';'
/ ' putlog / "0a"x / " ";' / ' putlog / "0a"x / " ";'
@@ -3879,7 +3879,7 @@ data _null_;
%end; %end;
put 'put " " / @3 "--------------------------------------------------------------------" / " ";' put 'put " " / @3 "--------------------------------------------------------------------" / " ";'
/ 'put @3 "*SAS package generated by SAS Package Framework, version `20231210`*";' / 'put @3 "*SAS package generated by SAS Package Framework, version `20240423`*";'
/ 'put " " / @3 "--------------------------------------------------------------------";'; / 'put " " / @3 "--------------------------------------------------------------------";';
put 'run; ' /; put 'run; ' /;
@@ -4915,7 +4915,7 @@ data &filesWithCodes.markdown;
%end; %end;
put " " / "--------------------------------------------------------------------" / " " put " " / "--------------------------------------------------------------------" / " "
/ "*SAS package generated by SAS Package Framework, version `20231210`*" / "*SAS package generated by SAS Package Framework, version `20240423`*"
/ " " / "--------------------------------------------------------------------" / " "; / " " / "--------------------------------------------------------------------" / " ";
put "# The `&packageName.` package content"; put "# The `&packageName.` package content";
@@ -4926,6 +4926,25 @@ data &filesWithCodes.markdown;
set &filesWithCodes. end = EOFDS nobs = NOBS curobs = CUROBS; set &filesWithCodes. end = EOFDS nobs = NOBS curobs = CUROBS;
if upcase(type) in: ('TEST') then continue; /* exclude tests */ 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; type2=type;
length link $ 256; length link $ 256;
link=catx("-",compress(fileshort,,"KAD"),type,CUROBS); link=catx("-",compress(fileshort,,"KAD"),type,CUROBS);
@@ -5172,7 +5191,7 @@ TODO: (in Polish)
*/ */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to load multiple SAS packages at one run, version 20231210. Run %loadPackages() for help info.' des = 'Macro to load multiple SAS packages at one run, version 20240423. Run %loadPackages() for help info.'
parmbuff parmbuff
; ;
%if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then %if (%superq(packagesNames) = ) OR (%qupcase(&packagesNames.) = HELP) %then
@@ -5188,7 +5207,7 @@ parmbuff
%put ### This is short help information for the `loadPackageS` macro #; %put ### This is short help information for the `loadPackageS` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro wrapper for the loadPackage macro, version `20231210` #; %put # Macro wrapper for the loadPackage macro, version `20240423` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -5285,7 +5304,7 @@ parmbuff
hashing_file() function, SAS 9.4M6 */ hashing_file() function, SAS 9.4M6 */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to verify SAS package with the hash digest, version 20231210. Run %verifyPackage() for help info.' des = 'Macro to verify SAS package with the hash digest, version 20240423. Run %verifyPackage() for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %do;
@@ -5300,7 +5319,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20231210. Run %
%put ### This is short help information for the `verifyPackage` macro #; %put ### This is short help information for the `verifyPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to verify SAS package with it hash digest, version `20231210` #; %put # Macro to verify SAS package with it hash digest, version `20240423` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -5479,7 +5498,7 @@ des = 'Macro to verify SAS package with the hash digest, version 20231210. Run %
*/ */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to preview content of a SAS package, version 20231210. Run %previewPackage() for help info.' des = 'Macro to preview content of a SAS package, version 20240423. Run %previewPackage() for help info.'
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
%do; %do;
@@ -5494,7 +5513,7 @@ des = 'Macro to preview content of a SAS package, version 20231210. Run %preview
%put ### This is short help information for the `previewPackage` macro #; %put ### This is short help information for the `previewPackage` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to get previwe of a SAS packages, version `20231210` #; %put # Macro to get preview of a SAS packages, version `20240423` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -5621,7 +5640,7 @@ des = 'Macro to preview content of a SAS package, version 20231210. Run %preview
when empty the "packages" value is used */ when empty the "packages" value is used */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to list directories pointed by "packages" fileref, version 20231210. Run %extendPackagesFileref(HELP) for help info.' des = 'Macro to list directories pointed by "packages" fileref, version 20240423. Run %extendPackagesFileref(HELP) for help info.'
; ;
%if %QUPCASE(&packages.) = HELP %then %if %QUPCASE(&packages.) = HELP %then
@@ -5637,7 +5656,7 @@ des = 'Macro to list directories pointed by "packages" fileref, version 20231210
%put ### This is short help information for the `extendPackagesFileref` macro #; %put ### This is short help information for the `extendPackagesFileref` macro #;
%put #-----------------------------------------------------------------------------------------#;; %put #-----------------------------------------------------------------------------------------#;;
%put # #; %put # #;
%put # Macro to list directories pointed by 'packages' fileref, version `20231210` #; %put # Macro to list directories pointed by 'packages' fileref, version `20240423` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;
@@ -5738,7 +5757,7 @@ filename packages list;
is provided in required version */ is provided in required version */
)/secure )/secure
/*** HELP END ***/ /*** HELP END ***/
des = 'Macro to load additional content for a SAS package, version 20231210. Run %loadPackageAddCnt() for help info.' des = 'Macro to load additional content for a SAS package, version 20240423. Run %loadPackageAddCnt() for help info.'
minoperator minoperator
; ;
%if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then %if (%superq(packageName) = ) OR (%qupcase(&packageName.) = HELP) %then
@@ -5754,7 +5773,7 @@ minoperator
%put ### This is short help information for the `loadPackageAddCnt` macro #; %put ### This is short help information for the `loadPackageAddCnt` macro #;
%put #-------------------------------------------------------------------------------#; %put #-------------------------------------------------------------------------------#;
%put # #; %put # #;
%put # Macro to *load* additional content for a SAS package, version `20231210` #; %put # Macro to *load* additional content for a SAS package, version `20240423` #;
%put # #; %put # #;
%put # A SAS package is a zip file containing a group #; %put # A SAS package is a zip file containing a group #;
%put # of SAS codes (macros, functions, data steps generating #; %put # of SAS codes (macros, functions, data steps generating #;

View File

@@ -86,7 +86,7 @@ SHA256 digest for macroArray: F*3F3893F1FCD78719543703E4353F4CC19811D247C016F220
--- ---
- **BasePlus**\[1.36.0\] adds a bunch of functionalities I am missing in BASE SAS, such as: - **BasePlus**\[1.38.0\] adds a bunch of functionalities I am missing in BASE SAS, such as:
```sas ```sas
call arrMissToRight(myArray); call arrMissToRight(myArray);
call arrFillMiss(17, myArray); call arrFillMiss(17, myArray);
@@ -116,7 +116,7 @@ format x bool.;
%put %monthShift(2023,1,-5); %put %monthShift(2023,1,-5);
``` ```
SHA256 digest for BasePlus: F*B9F1B3243FD3956F0B68652C21EA1EBC19F3EB0931774A57FECE1F02A9448108 SHA256 digest for BasePlus: F*209FB8198270DEAB6151CE31391A352A065B4EE2689F40433FA9550A7F4AAC18
[Documentation for BasePlus](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md "Documentation for BasePlus") [Documentation for BasePlus](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md "Documentation for BasePlus")

View File

@@ -1,3 +1,9 @@
/* 20240312 */
BasePlus: F*209FB8198270DEAB6151CE31391A352A065B4EE2689F40433FA9550A7F4AAC18
/* 20240309 */
BasePlus: F*8155BFE82F7833E4B0DA24D81DBDFC58463906D6032B1F0161772DADE84BE790
/* 20240112 */ /* 20240112 */
BasePlus: F*B9F1B3243FD3956F0B68652C21EA1EBC19F3EB0931774A57FECE1F02A9448108 BasePlus: F*B9F1B3243FD3956F0B68652C21EA1EBC19F3EB0931774A57FECE1F02A9448108

View File

@@ -7,22 +7,22 @@
*The BASE SAS plus a bunch of functionalities I am missing in BASE SAS* *The BASE SAS plus a bunch of functionalities I am missing in BASE SAS*
- Package: BasePlus - Package: BasePlus
- Version: 1.36.0 - Version: 1.38.0
- Generated: 2024-01-12T10:32:46 - Generated: 2024-03-12T14:26:19
- Author(s): Bartosz Jablonski (yabwon@gmail.com), Quentin McMullen (qmcmullen@gmail.com) - Author(s): Bartosz Jablonski (yabwon@gmail.com), Quentin McMullen (qmcmullen@gmail.com)
- Maintainer(s): Bartosz Jablonski (yabwon@gmail.com) - Maintainer(s): Bartosz Jablonski (yabwon@gmail.com)
- License: MIT - License: MIT
- File SHA256: `F*B9F1B3243FD3956F0B68652C21EA1EBC19F3EB0931774A57FECE1F02A9448108` for this version - File SHA256: `F*209FB8198270DEAB6151CE31391A352A065B4EE2689F40433FA9550A7F4AAC18` for this version
- Content SHA256: `C*5A51FA3E5B3A6E9AE2AF37D6604B49B8656D4CC50AFF1F975E546D4419AA0461` for this version - Content SHA256: `C*14C505C4EF488A8BE2404A692D55C8B81FC5A6075D8A35F8B6767B34ACF5E48E` for this version
--- ---
# The `BasePlus` package, version: `1.36.0`; # The `BasePlus` package, version: `1.38.0`;
--- ---
# The BasePlus package [ver. 1.36.0] <a name="baseplus-package"></a> ############################################### # The BasePlus package [ver. 1.38.0] <a name="baseplus-package"></a> ###############################################
The **BasePlus** package implements useful The **BasePlus** package implements useful
functions and functionalities I miss in the BASE SAS. functions and functionalities I miss in the BASE SAS.
@@ -165,6 +165,10 @@ Kudos to all who inspired me to generate this package:
%rainCloudPlot(sashelp.cars,DriveTrain,Invoice) %rainCloudPlot(sashelp.cars,DriveTrain,Invoice)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The output can be seen in the `md` file.
![Example 1x](./baseplus_RainCloudPlot_Ex0.png)
**Example 10**: Zip SAS library. **Example 10**: Zip SAS library.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%zipLibrary(sashelp, libOut=work) %zipLibrary(sashelp, libOut=work)
@@ -345,7 +349,7 @@ run;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 26** Downloading data from the internet to a local dirrectory: **EXAMPLE 26** Downloading data from the internet to a local directory:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%downloadFilesTo(~/directoryA) %downloadFilesTo(~/directoryA)
datalines4; datalines4;
@@ -355,6 +359,13 @@ https://www.lexjansen.com/wuss/2023/WUSS-2023-Paper-189.zip
run; run;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 27** Conditional value assignment:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%let x = A B C;
%let y = %iffunc((%scan(&x.,1)=A),Starts with "A"., Does not start with "A".);
%put &=y.;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- ---
--- ---
@@ -441,20 +452,21 @@ The `BasePlus` package consists of the following content:
62. [`%finddswithvarval()` macro ](#finddswithvarval-macro-62 ) 62. [`%finddswithvarval()` macro ](#finddswithvarval-macro-62 )
63. [`%fmt()` macro ](#fmt-macro-63 ) 63. [`%fmt()` macro ](#fmt-macro-63 )
64. [`%gettitle()` macro ](#gettitle-macro-64 ) 64. [`%gettitle()` macro ](#gettitle-macro-64 )
65. [`%infmt()` macro ](#infmt-macro-65 ) 65. [`%iffunc()` macro ](#iffunc-macro-65 )
66. [`%letters()` macro ](#letters-macro-66 ) 66. [`%infmt()` macro ](#infmt-macro-66 )
67. [`%libpath()` macro ](#libpath-macro-67 ) 67. [`%letters()` macro ](#letters-macro-67 )
68. [`%minclude()` macro ](#minclude-macro-68 ) 68. [`%libpath()` macro ](#libpath-macro-68 )
69. [`%monthshift()` macro ](#monthshift-macro-69 ) 69. [`%minclude()` macro ](#minclude-macro-69 )
70. [`%replist()` macro ](#replist-macro-70 ) 70. [`%monthshift()` macro ](#monthshift-macro-70 )
71. [`%time()` macro ](#time-macro-71 ) 71. [`%replist()` macro ](#replist-macro-71 )
72. [`%today()` macro ](#today-macro-72 ) 72. [`%time()` macro ](#time-macro-72 )
73. [`%translate()` macro ](#translate-macro-73 ) 73. [`%today()` macro ](#today-macro-73 )
74. [`%tranwrd()` macro ](#tranwrd-macro-74 ) 74. [`%translate()` macro ](#translate-macro-74 )
75. [`%workpath()` macro ](#workpath-macro-75 ) 75. [`%tranwrd()` macro ](#tranwrd-macro-75 )
76. [`%workpath()` macro ](#workpath-macro-76 )
93. [License note](#license) 95. [License note](#license)
--- ---
@@ -504,7 +516,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
## >>> `%dedupListC()` macro: <<< <a name="deduplistc-macro"></a> ####################### ## >>> `%dedupListC()` macro: <<< <a name="deduplistc-macro"></a> #######################
The `%dedupListC()` macro deletes duplicated values from The `%dedupListC()` macro deletes duplicated values from
a *COMMA separated* list of values. List, including separators, a *COMMA-separated* list of values. List, including separators,
can be no longer than a value carried by a single macro variable. can be no longer than a value carried by a single macro variable.
Returned value is *unquoted*. Leading and trailing spaces are ignored. Returned value is *unquoted*. Leading and trailing spaces are ignored.
@@ -522,7 +534,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
**Arguments description**: **Arguments description**:
1. `list` - A list of *comma separated* values. 1. `list` - A list of *comma-separated* values.
### EXAMPLES AND USECASES: #################################################### ### EXAMPLES AND USECASES: ####################################################
@@ -565,7 +577,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
## >>> `%dedupListP()` macro: <<< <a name="deduplistp-macro"></a> ####################### ## >>> `%dedupListP()` macro: <<< <a name="deduplistp-macro"></a> #######################
The `%dedupListP()` macro deletes duplicated values from The `%dedupListP()` macro deletes duplicated values from
a *PIPE(`|`) separated* list of values. List, including separators, a *PIPE(`|`)-separated* list of values. List, including separators,
can be no longer than a value carried by a single macro variable. can be no longer than a value carried by a single macro variable.
Returned value is *unquoted*. Leading and trailing spaces are ignored. Returned value is *unquoted*. Leading and trailing spaces are ignored.
@@ -583,7 +595,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
**Arguments description**: **Arguments description**:
1. `list` - A list of *pipe separated* values. 1. `list` - A list of *pipe-separated* values.
### EXAMPLES AND USECASES: #################################################### ### EXAMPLES AND USECASES: ####################################################
@@ -626,7 +638,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
## >>> `%dedupListS()` macro: <<< <a name="deduplists-macro"></a> ####################### ## >>> `%dedupListS()` macro: <<< <a name="deduplists-macro"></a> #######################
The `%dedupListS()` macro deletes duplicated values from The `%dedupListS()` macro deletes duplicated values from
a *SPACE separated* list of values. List, including separators, a *SPACE-separated* list of values. List, including separators,
can be no longer than a value carried by a single macro variable. can be no longer than a value carried by a single macro variable.
Returned value is *unquoted*. Returned value is *unquoted*.
@@ -638,13 +650,13 @@ The `%dedupListS()` macro executes like a pure macro code.
The basic syntax is the following, the `<...>` means optional parameters: The basic syntax is the following, the `<...>` means optional parameters:
~~~~~~~~~~~~~~~~~~~~~~~sas ~~~~~~~~~~~~~~~~~~~~~~~sas
%dedupListS( %dedupListS(
list of space separated values list of space-separated values
) )
~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
**Arguments description**: **Arguments description**:
1. `list` - A list of *space separated* values. 1. `list` - A list of *space-separated* values.
### EXAMPLES AND USECASES: #################################################### ### EXAMPLES AND USECASES: ####################################################
@@ -680,7 +692,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
## >>> `%dedupListX()` macro: <<< <a name="deduplistx-macro"></a> ####################### ## >>> `%dedupListX()` macro: <<< <a name="deduplistx-macro"></a> #######################
The `%dedupListX()` macro deletes duplicated values from The `%dedupListX()` macro deletes duplicated values from
a *X separated* list of values, where the `X` represents a *X-separated* list of values, where the `X` represents
a *single character* separator. List, including separators, a *single character* separator. List, including separators,
can be no longer than a value carried by a single macro variable. can be no longer than a value carried by a single macro variable.
@@ -702,7 +714,7 @@ XlistXofXxXseparatedXvalues
**Arguments description**: **Arguments description**:
1. `list` - A list of *X separated* values. 1. `list` - A list of *X-separated* values.
### EXAMPLES AND USECASES: #################################################### ### EXAMPLES AND USECASES: ####################################################
@@ -761,7 +773,7 @@ and subdirectories of a given `root` directory.
The extracted info may be just a list of files and subdirectories or, if The extracted info may be just a list of files and subdirectories or, if
the `details=` parameter is set to 1, additional operating system information the `details=` parameter is set to 1, additional operating system information
is extracted (information is OSS dependent and gives different results for Linux is extracted (information is OS-dependent and gives different results for Linux
and for Windows) and for Windows)
The extracted info can be narrowed down to files (`keepFiles=1`) or to The extracted info can be narrowed down to files (`keepFiles=1`) or to
@@ -1081,12 +1093,12 @@ The basic syntax is the following, the `<...>` means optional parameters:
%put *%str(%')%bquote(%getVars(sashelp.class,sep=''))%str(%')*; %put *%str(%')%bquote(%getVars(sashelp.class,sep=''))%str(%')*;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c) coma separated double quote list: c) comma-separated double quote list:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%put *"%getVars(sashelp.class,sep=%str(", "))"*; %put *"%getVars(sashelp.class,sep=%str(", "))"*;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
d) coma separated single quote list: d) comma-separated single quote list:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%put *%str(%')%getVars(sashelp.class,sep=', ')%str(%')*; %put *%str(%')%getVars(sashelp.class,sep=', ')%str(%')*;
%let x = %str(%')%getVars(sashelp.class,sep=', ')%str(%'); %let x = %str(%')%getVars(sashelp.class,sep=', ')%str(%');
@@ -1151,12 +1163,12 @@ a) one single or double qiote:
%put *%QgetVars(sashelp.class,quote='')*; %put *%QgetVars(sashelp.class,quote='')*;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c) coma separated double quote list: c) comma-separated double quote list:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%put *%getVars(sashelp.class,sep=%str(,),quote=%str(%"))*; %put *%getVars(sashelp.class,sep=%str(,),quote=%str(%"))*;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
d) coma separated single quote list: d) comma-separated single quote list:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%let x = %getVars(sashelp.class,sep=%str(,),quote=%str(%')); %let x = %getVars(sashelp.class,sep=%str(,),quote=%str(%'));
%put &=x.; %put &=x.;
@@ -1534,8 +1546,8 @@ The basic syntax is the following, the `<...>` means optional parameters:
) )
~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
The text string is concider as *"only dataset name"*, i.e. macro does not The text string is consider as *"only dataset name"*, i.e. macro does not
assume it contain library as prefix or data set options as sufix. assume it contain library as prefix or data set options as suffix.
See the `%LDSN()` macro for comparison. See the `%LDSN()` macro for comparison.
--- ---
@@ -1766,7 +1778,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
## >>> `%QdedupListX()` macro: <<< <a name="qdeduplistx-macro"></a> ####################### ## >>> `%QdedupListX()` macro: <<< <a name="qdeduplistx-macro"></a> #######################
The `%QdedupListX()` macro deletes duplicated values from The `%QdedupListX()` macro deletes duplicated values from
a *X separated* list of values, where the `X` represents a *X-separated* list of values, where the `X` represents
a *single character* separator. List, including separators, a *single character* separator. List, including separators,
can be no longer than a value carried by a single macro variable. can be no longer than a value carried by a single macro variable.
@@ -1788,7 +1800,7 @@ XlistXofXxXseparatedXvalues
**Arguments description**: **Arguments description**:
1. `list` - A list of *X separated* values. 1. `list` - A list of *X-separated* values.
### EXAMPLES AND USECASES: #################################################### ### EXAMPLES AND USECASES: ####################################################
@@ -1898,9 +1910,9 @@ See examples in `%getVars()` help for the details.
The zipEvalf() and QzipEvalf() macro functions The zipEvalf() and QzipEvalf() macro functions
allow to use a function on elements of pair of allow to use a function on elements of pair of
space separated lists. space-separated lists.
For two space separated lists of text strings the corresponding For two space-separated lists of text strings the corresponding
elements are taken and the macro applies a function, provided by user, elements are taken and the macro applies a function, provided by user,
to calculate result of the function on taken elements. to calculate result of the function on taken elements.
@@ -1932,9 +1944,9 @@ The basic syntax is the following, the `<...>` means optional parameters:
**Arguments description**: **Arguments description**:
1. `first` - *Required*, a space separated list of texts. 1. `first` - *Required*, a space-separated list of texts.
2. `second` - *Required*, a space separated list of texts. 2. `second` - *Required*, a space-separated list of texts.
* `function = cat` - *Optional*, default value is `cat`, * `function = cat` - *Optional*, default value is `cat`,
a function which will be applied a function which will be applied
@@ -1951,18 +1963,18 @@ The basic syntax is the following, the `<...>` means optional parameters:
* `argBf =` - *Optional*, default value is empty, * `argBf =` - *Optional*, default value is empty,
arguments of the function inserted arguments of the function inserted
*before* elements the first list. *before* elements the first list.
If multiple should be comma separated. If multiple should be comma-separated.
* `argMd =` - *Optional*, default value is empty, * `argMd =` - *Optional*, default value is empty,
arguments of the function inserted arguments of the function inserted
*between* elements the first list and *between* elements the first list and
the second list. the second list.
If multiple should be comma separated. If multiple should be comma-separated.
* `argAf =` - *Optional*, default value is empty, * `argAf =` - *Optional*, default value is empty,
arguments of the function inserted arguments of the function inserted
*after* elements the second list. *after* elements the second list.
If multiple should be comma separated. If multiple should be comma-separated.
* `format=` - *Optional*, default value is empty, * `format=` - *Optional*, default value is empty,
indicates a format which should be used indicates a format which should be used
@@ -1983,8 +1995,8 @@ See examples in `%zipEvalf()` help for the details.
## >>> `%RainCloudPlot()` macro: <<< <a name="raincloudplot-macro"></a> ####################### ## >>> `%RainCloudPlot()` macro: <<< <a name="raincloudplot-macro"></a> #######################
The RainCloudPlot() macro allow to plot Rain Cloud plots, i.e. pots of The RainCloudPlot() macro allow to plot Rain Cloud plots, i.e.
kernel density estimates, jitter data values, and box-and-whiskers plot. plots of kernel density estimates, jitter data values, and box-and-whiskers plot.
See examples below for the details. See examples below for the details.
@@ -2018,6 +2030,8 @@ The basic syntax is the following, the `<...>` means optional parameters:
<,y2axis=> <,y2axis=>
<,y2axisLevels=> <,y2axisLevels=>
<,y2axisValueAttrs=> <,y2axisValueAttrs=>
<,y2axisFormat=>
<,y2axisLines=>
<,catAxisValueAttrs=> <,catAxisValueAttrs=>
<,xaxisValueAttrs=> <,xaxisValueAttrs=>
<,xaxisTickstyle=> <,xaxisTickstyle=>
@@ -2028,8 +2042,10 @@ The basic syntax is the following, the `<...>` means optional parameters:
<,VSCALE=> <,VSCALE=>
<,KERNEL_K=> <,KERNEL_K=>
<,KERNEL_C=> <,KERNEL_C=>
<,VSCALEmax=>
<,cleanTempData=> <,cleanTempData=>
<,codePreview=>
) )
~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
@@ -2091,44 +2107,50 @@ The basic syntax is the following, the `<...>` means optional parameters:
For details see notes below. For details see notes below.
* `catLabels` - *Optional*, default value is empty. * `catLabels` - *Optional*, default value is empty.
List of values for group axix labels (vertical). List of values for group axis labels (vertical).
When empty a grouping variable name is used. When empty a grouping variable name is used.
For details see notes below. For details see notes below.
* `xLabels` - *Optional*, default value is empty. * `xLabels` - *Optional*, default value is empty.
List of values for data variable axix labels (horizontal). List of values for data variable axis labels (horizontal).
When empty a data variable name is used. When empty a data variable name is used.
For details see notes below. For details see notes below.
* `catLabelPos` - *Optional*, default value `DATACENTER`. * `catLabelPos` - *Optional*, default value `DATACENTER`.
Indicates position of the label on group axix (vertical). Indicates position of the label on group axis (vertical).
Allowed values are `BOTTOM`, `CENTER`, `DATACENTER`, and `TOP`. Allowed values are `BOTTOM`, `CENTER`, `DATACENTER`, and `TOP`.
* `xLabelPos` - *Optional*, default value `DATACENTER`. * `xLabelPos` - *Optional*, default value `DATACENTER`.
Indicates position of the label on data axix (horizontal). Indicates position of the label on data axis (horizontal).
Allowed values are `LEFT`, `CENTER`, `DATACENTER`, and `RIGHT`. Allowed values are `LEFT`, `CENTER`, `DATACENTER`, and `RIGHT`.
* `catLabelAttrs` - *Optional*, default value is empty. * `catLabelAttrs` - *Optional*, default value is empty.
List of attributes for group axix labels (vertical). List of attributes for group axis labels (vertical).
For details see notes below. For details see notes below.
* `xLabelAttrs` - *Optional*, default value is empty. * `xLabelAttrs` - *Optional*, default value is empty.
List of attributes for data variable axix labels (horizontal). List of attributes for data variable axis labels (horizontal).
For details see notes below. For details see notes below.
* `formated` - *Optional*, default value `0`. * `formated` - *Optional*, default value `0`.
Indicates if values of the grouping variable should be formated. Indicates if values of the grouping variable should be formatted.
* `y2axis` - *Optional*, default value `1`. * `y2axis` - *Optional*, default value `1`.
Indicates if the right vertical axix should be displayed. Indicates if the right vertical axis should be displayed.
* `y2axisLevels` - *Optional*, default value `4`. * `y2axisLevels` - *Optional*, default value `4`.
Indicates if the number of expected levels of values printed Indicates if the number of expected levels of values printed
on the right vertical axix. on the right vertical axis.
* `y2axisValueAttrs` - *Optional*, default value `Color=Grey`. * `y2axisValueAttrs` - *Optional*, default value `Color=Grey`.
Allows to modify Y2 axis values attributes. Allows to modify Y2 axis values attributes.
* `y2axisFormat` - *Optional*, default value `12.2-L`.
Allows to modify Y2 axis values format.
* `y2axisLines` - *Optional*, default value `0`.
If `1`, adds horizontal lines for Y2 axis values.
* `catAxisValueAttrs` - *Optional*, default value `Color=Black`. * `catAxisValueAttrs` - *Optional*, default value `Color=Black`.
Allows to modify category (Y) axis values attributes. Allows to modify category (Y) axis values attributes.
@@ -2152,6 +2174,12 @@ The basic syntax is the following, the `<...>` means optional parameters:
By default only the: `width=`, `height=`, and `antialiasmax=` By default only the: `width=`, `height=`, and `antialiasmax=`
are modified. are modified.
* `vertical` - *Optional*, default value is `0`.
Set value to `1` to plot "clouds & boxes" vertically.
**NOTE:** *Before setting the parameter to `1`, first
prepare the plot in the "horizontal" version since all
other parameters assume that orientation(!) and then are
converted accordingly.*
***Stat related options***: ***Stat related options***:
@@ -2171,11 +2199,21 @@ The basic syntax is the following, the `<...>` means optional parameters:
Specifies standardized bandwidth parameter *C* to compute kernel density estimates. Specifies standardized bandwidth parameter *C* to compute kernel density estimates.
Allowed values are between `0` and `1`, Allowed values are between `0` and `1`,
* `VSCALEmax` - *Optional*, default value is empty.
Provides maximal value for Y2 axis scale. When used an information
note is displayed in the log. Recommended values are:
For `VSCALE=PERCENT` between 0 and 100,
for `VSCALE=PROPORTION` between 0 and 1, and
for `VSCALE=COUNT` between 0 and N (sample size).
***Other options***: ***Other options***:
* `cleanTempData` - *Optional*, default value `1`. * `cleanTempData` - *Optional*, default value `1`.
Indicates if temporary data sets should be deleted. Indicates if temporary data sets should be deleted.
* `codePreview` - *Optional*, default value `0`.
Indicates if source code should be MPRINTed to log.
--- ---
### NOTES: ################################################################### ### NOTES: ###################################################################
@@ -2190,20 +2228,24 @@ The basic syntax is the following, the `<...>` means optional parameters:
Use the `%str()` or `%nrstr()` macro-function to handle special characters. Use the `%str()` or `%nrstr()` macro-function to handle special characters.
The `%unquote()` is used when resolving the parameter. The `%unquote()` is used when resolving the parameter.
* The `catLabels` and `xLabels` should be quoted comma separated lists enclosed with brackets, * The `catLabels` and `xLabels` should be quoted comma-separated lists enclosed with brackets,
e.g. `catLabels=("Continent of Origin", "Car Type")`, see Example below. e.g. `catLabels=("Continent of Origin", "Car Type")`, see Example below.
* The `catLabelAttrs` and `xLabelAttrs` should be space separated lists of `key=value` pairs, * The `catLabelAttrs` and `xLabelAttrs` should be space-separated lists of `key=value` pairs,
e.g. `xLabelAttrs=size=12 color=Pink weight=bold`, see Example below. e.g. `xLabelAttrs=size=12 color=Pink weight=bold`, see Example below.
* Kernel density estimates and basic statistics are calculated with `PROC UNIVARIATE`. * Kernel density estimates and basic statistics are calculated with `PROC UNIVARIATE`.
* Plot is generated by `PROC SGPLOT` with `BAND`, `SCATTE`, and `POLYGON` plots. * Plot is generated by `PROC SGPLOT` with `BAND`, `SCATTER`, and `POLYGON` plots.
* After execution the ODS graphics dimension parameters are set to `800px` by `600px`. * After execution the ODS graphics dimension parameters are set to `800px` by `600px`.
* SAS notes (`NOTE:`) are disabled for the execution time. * SAS notes (`NOTE:`) are disabled for the execution time.
* Before setting the `vertical=` parameter to `1`, first prepare the plot
in the "horizontal" version since all other parameters assume that orientation(!)
and then are converted accordingly.
* List of predefined colours is: * List of predefined colours is:
`BlueViolet`, `RoyalBlue`, `OliveDrab`, `Gold`, `HotPink`, `Crimson`, `BlueViolet`, `RoyalBlue`, `OliveDrab`, `Gold`, `HotPink`, `Crimson`,
`MediumPurple`, `CornflowerBlue`, `YellowGreen`, `Goldenrod`, `Orchid`, `IndianRed`. `MediumPurple`, `CornflowerBlue`, `YellowGreen`, `Goldenrod`, `Orchid`, `IndianRed`.
@@ -2211,12 +2253,12 @@ The basic syntax is the following, the `<...>` means optional parameters:
### BOX-AND-WHISKERS PLOT: ################################################################### ### BOX-AND-WHISKERS PLOT: ###################################################################
The box-and-whiskers plot has the following interpretation: The box-and-whiskers plot has the following interpretation:
- left vertical bar indicates the minimum, - left vertical bar indicates the *minimum*,
- left whisker line starts at `max(Q1 - 1.5IQR, minimum)` and ends at lower quartile (Q1), - left whisker line starts at `max(Q1 - 1.5IQR, minimum)` and ends at lower quartile (Q1),
- diamond indicates mean, - diamond indicates mean,
- vertical bar inside of the box indicates median, - vertical bar inside of the box indicates median,
- right whisker line starts at upper quartile (Q3) and ends at `min(Q3 + 1.5IQR, maximum)`, - right whisker line starts at upper quartile (Q3) and ends at `min(Q3 + 1.5IQR, maximum)`,
- right vertical bar indicates the maximum. - right vertical bar indicates the *maximum*.
With above setup it may happen that With above setup it may happen that
there is a gap between the minimum marker and the beginning of the left whisker there is a gap between the minimum marker and the beginning of the left whisker
@@ -2236,6 +2278,7 @@ See examples below.
g = "Aaa"; g = "Aaa";
do _N_ = 1 to 50; do _N_ = 1 to 50;
x = rannor(42); x = rannor(42);
y = ranuni(42);
output; output;
end; end;
@@ -2246,22 +2289,26 @@ See examples below.
when(6,7,8) x = 0.5*rannor(42)+3; when(6,7,8) x = 0.5*rannor(42)+3;
otherwise x = 0.5*rannor(42)+5; otherwise x = 0.5*rannor(42)+5;
end; end;
y = ranuni(42)+1;
output; output;
end; end;
g = "C"; g = "C";
do _N_ = 1 to 60; do _N_ = 1 to 60;
x = 3*rannor(42)+7; x = 3*rannor(42)+7;
y = ranuni(42)+2;
output; output;
end; end;
run; run;
%RainCloudPlot(have, g, x) %RainCloudPlot(have, g, x y)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The output: The output can be seen in the `md` file.
![Example 1](./baseplus_RainCloudPlot_Ex1.png) ![Example 1x](./baseplus_RainCloudPlot_Ex1x.png)
![Example 1y](./baseplus_RainCloudPlot_Ex1y.png)
**EXAMPLE 2.** Rain Cloud plot for `sashelp.cars` dataset **EXAMPLE 2.** Rain Cloud plot for `sashelp.cars` dataset
with groups by Origin or Type with groups by Origin or Type
@@ -2281,7 +2328,7 @@ The output:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The output: The output can be seen in the `md` file.
![Example 2a](./baseplus_RainCloudPlot_Ex2a.png) ![Example 2a](./baseplus_RainCloudPlot_Ex2a.png)
![Example 2b](./baseplus_RainCloudPlot_Ex2b.png) ![Example 2b](./baseplus_RainCloudPlot_Ex2b.png)
@@ -2316,29 +2363,71 @@ The output:
data test; data test;
do system = 1 to 3; do system = 1 to 3;
do i = 1 to 50; do i = 1 to 50;
x = rannor(123)/system; x = 2*rannor(123)/system - system;
output; output;
end; end;
end; end;
format system system.; format system system.;
run; run;
%RainCloudPlot(test, system, x %RainCloudPlot(test, system, x
, colorslist=CX88CCEE CX44AA99 CX117733 , colorslist=CX88CCEE CX44AA99 CX117733
, formated=1 , formated=1
, sganno=annotation , sganno=annotation
, sgPlotOptions=noborder , sgPlotOptions=noborder
, WidthPX=1000 , WidthPX=1000
, HeightPX=320 , HeightPX=380
, catAxisValueAttrs=Color=Green weight=bold , catAxisValueAttrs=Color=Green weight=bold
, VSCALE=percent
, cleanTempData=0
, y2axisLevels=5
, y2axisFormat=words20.-L
, VSCALEmax=60
, codePreview=1
, y2axisValueAttrs=Color=Grey size=10px
, y2axisLines=1
, xLabels="variable X"
, title = %nrstr(title1;
title2 JUSTIFY=L "Rain Cloud plot for &list_g. by " %unquote(&xLabel.);
title3 JUSTIFY=C "Rain Cloud plot for &list_g. by " %unquote(&xLabel.);
title4 JUSTIFY=R "Rain Cloud plot for &list_g. by " %unquote(&xLabel.);
)
) )
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The output: The output can be seen in the `md` file.
![Example 3](./baseplus_RainCloudPlot_Ex3.png) ![Example 3](./baseplus_RainCloudPlot_Ex3.png)
**EXAMPLE 4.** Rain Cloud plot for `sashelp.cars` dataset
with groups by Drive Train for Weight (LBS)
variable ploted "vertically":
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%RainCloudPlot(
sashelp.cars
, DriveTrain
, Weight
, HeightPX=400
, colorslist=Red Green Blue
, y2axisLevels=5
, catLabels=("DriveTrain")
, xLabels="Weight (LBS)"
, xLabelAttrs=size=12 color=Black weight=bold
, y2axisLines=1
, vscale=percent
, vscalemax=50
, vertical = 1
, title = %nrstr(title1 J=C HEIGHT=3 "The VERTICAL plotting is cool, ...";)
, footnote = %nrstr(footnote1 J=L HEIGHT=2 "... isn't it?";)
)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The output can be seen in the `md` file.
![Example 4](./baseplus_RainCloudPlot_Ex4.png)
--- ---
@@ -2672,7 +2761,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
## >>> `%unzipArch()` macro: <<< <a name="unziparch-macro"></a> ####################### ## >>> `%unzipArch()` macro: <<< <a name="unziparch-macro"></a> #######################
The unzipArch() macro allows to unzip content of a ZIP archive. The unzipArch() macro allows to unzip content of a ZIP archive.
Macro is OS independent, the `XCMD` option is not required. Macro is OS-independent, the `XCMD` option is not required.
The `dlCreateDir` option is used under the hood. The `dlCreateDir` option is used under the hood.
@@ -2905,7 +2994,7 @@ run;
## >>> `%zipArch()` macro: <<< <a name="ziparch-macro"></a> ####################### ## >>> `%zipArch()` macro: <<< <a name="ziparch-macro"></a> #######################
The zipArch() macro allows to ZIP content of a directory. The zipArch() macro allows to ZIP content of a directory.
Macro is OS independent, the `XCMD` option is not required. Macro is OS-independent, the `XCMD` option is not required.
Content of zipped archive can be listed in the log. Content of zipped archive can be listed in the log.
@@ -3042,9 +3131,9 @@ run;
The zipEvalf() and QzipEvalf() macro functions The zipEvalf() and QzipEvalf() macro functions
allow to use a function on elements of pair of allow to use a function on elements of pair of
space separated lists. space-separated lists.
For two space separated lists of text strings the corresponding For two space-separated lists of text strings the corresponding
elements are taken and the macro applies a function, provided by user, elements are taken and the macro applies a function, provided by user,
to calculate result of the function on taken elements. to calculate result of the function on taken elements.
@@ -3076,9 +3165,9 @@ The basic syntax is the following, the `<...>` means optional parameters:
**Arguments description**: **Arguments description**:
1. `first` - *Required*, a space separated list of texts. 1. `first` - *Required*, a space-separated list of texts.
2. `second` - *Required*, a space separated list of texts. 2. `second` - *Required*, a space-separated list of texts.
* `function = cat` - *Optional*, default value is `cat`, * `function = cat` - *Optional*, default value is `cat`,
a function which will be applied a function which will be applied
@@ -3095,18 +3184,18 @@ The basic syntax is the following, the `<...>` means optional parameters:
* `argBf =` - *Optional*, default value is empty, * `argBf =` - *Optional*, default value is empty,
arguments of the function inserted arguments of the function inserted
*before* elements the first list. *before* elements the first list.
If multiple should be comma separated. If multiple should be comma-separated.
* `argMd =` - *Optional*, default value is empty, * `argMd =` - *Optional*, default value is empty,
arguments of the function inserted arguments of the function inserted
*between* elements the first list and *between* elements the first list and
the second list. the second list.
If multiple should be comma separated. If multiple should be comma-separated.
* `argAf =` - *Optional*, default value is empty, * `argAf =` - *Optional*, default value is empty,
arguments of the function inserted arguments of the function inserted
*after* elements the second list. *after* elements the second list.
If multiple should be comma separated. If multiple should be comma-separated.
* `format=` - *Optional*, default value is empty, * `format=` - *Optional*, default value is empty,
indicates a format which should be used indicates a format which should be used
@@ -5709,7 +5798,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
1. `number` - *Optional*, default value is empty, 1. `number` - *Optional*, default value is empty,
indicates numbers of titles to be extracted. indicates numbers of titles to be extracted.
Space separated list is expected. Space-separated list is expected.
If empty or `_ALL_` extract all non-missing. If empty or `_ALL_` extract all non-missing.
*. `type` - *Optional*, default value is `T`. *. `type` - *Optional*, default value is `T`.
@@ -5763,7 +5852,208 @@ The basic syntax is the following, the `<...>` means optional parameters:
--- ---
## `%infmt()` macro <a name="infmt-macro-65"></a> ###### ## `%iffunc()` macro <a name="iffunc-macro-65"></a> ######
## >>> `%iffunc()` macro: <<< <a name="iffunc-macro"></a> #######################
The iffunc() macro function is a "lazy typer" wrapping up conditional execution.
Instead typing:
~~~~~~~~~~~~~~~~~~~~~~~sas
%let x = 1;
%if (1=&x.) %then
%do;
%let test = TRUE;
%end;
%else
%do;
%let test = FALSE;
%end;
%put &=test.;
~~~~~~~~~~~~~~~~~~~~~~~
you can make it:
~~~~~~~~~~~~~~~~~~~~~~~sas
%let x = 1;
%let test = %iffunc((1=&x.),TRUE,FALSE);
%put &=test.;
~~~~~~~~~~~~~~~~~~~~~~~
The `%iffunc()` macro ca be nested in open code
in contrary to standard `%IF-%THEN-%ELSE`.
The `minoperator` option is used to handle `IN` operator,
but the `IN` operator in the condition *has* to be surrounded
by spaces, e.g. `&x. in (1 2 3)`.
Condition of the form `&x. in(1 2 3)` (no space after `in`) will
result with an error.
See examples below for the details.
The `%iffunc()` macro executes like a pure macro code.
### SYNTAX: ###################################################################
The basic syntax is the following, the `<...>` means optional parameters:
~~~~~~~~~~~~~~~~~~~~~~~sas
%iffunc(
cond
,true
,false
<,v=>
)
~~~~~~~~~~~~~~~~~~~~~~~
**Arguments description**:
1. `cond` - *Required*, is a condition to be evaluated.
It **has** to be provided in brackets,
e.g., `(1=&x.)` or `(%scan(&x.,1)=A)`.
2. `true` - *Required*, value returned when condition is true.
3. `false` - *Required*, value returned when condition is false.
4 `v=` - *Optional*, v for verbose. If set to `1` extra notes
are printed.
---
### EXAMPLES AND USECASES: ####################################################
**EXAMPLE 1.** Simple test:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%let x = 1;
%let test = %iffunc((&x.=1),True,False);
%put &=test.;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 2.** Verbose with `v=` in the `%put` statement:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%put %iffunc((TRUE=true),TRUE,FALSE,v=1);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 3.** Condition can be with decimals or text:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%put True: %iffunc((9.9<10),TRUE,FALSE);
%put False: %iffunc((A>B),TRUE,FALSE);
%put True: %iffunc((1=1.0),TRUE,FALSE);
%put False: %iffunc((1/3 = 0.5),TRUE,FALSE);
%put True: %iffunc((.1+.1+.1+.1+.1+.1+.1+.1+.1+.1 = 1),TRUE,FALSE);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 4.** Macro-Functions works too:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%let x = A B C;
%put %iffunc((%scan(&x.,1)=A),Starts with "A"., Does not start with "A".);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 5.** Simple nesting (in open code):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%let x=0;
%let y=0;
%put
%iffunc((&x.)
,It is X.
,%iffunc((&y.)
,It is Y.
,It is Z.
,v=1)
,v=1)
;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 6.** Special characters have to be masked:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%put %iffunc(1,%str(,),%str(;));
%put %iffunc(0,%str(,),%str(;));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 7.** If you want to call macros there is a price.
The `%nrstr()` and `%unquote()` are required:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%macro doX(a,b);
%put >>> &a. &b;
data do_X;
set sashelp.class;
run;
%mend;
%macro doY(a,b);
%put ### &a. &b;
data do_Y;
set sashelp.cars;
run;
%mend;
%macro doZ(a,b);
%put @@@ &a. &b;
data do_Z;
set sashelp.iris;
run;
%mend;
%let x=0;
%let y=0;
%unquote(
%iffunc((&x.)
,%nrstr(%doX(1,2))
,%iffunc((&y.)
,%nrstr(%doY(3,4))
,%nrstr(%doZ(5,6))
,v=1)
,v=1)
)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 8.** Traffic lights with `NOTE:` and `ERROR:`,
Remember to handle the `IN` operator with an extra care.
Spaces are required around the `IN` operator.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%let x = A;
%put %iffunc((&x. IN (A B C)),NOTE:,ERROR:) x=%superq(x);
%let x = 7;
%put %iffunc((&x. IN (1 3 5)),NOTE:,ERROR:) x=%superq(x);
%let x = 1.1;
%put %iffunc((&x. IN (1.1 2.1 3.1)),NOTE:,ERROR:) x=%superq(x);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**EXAMPLE 9.** Mixing `IN` operator with non-integer evaluation
requires `%sysevalf()` function:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%let x = Y;
%let y = 9.9;
%put THIS will be False: %iffunc((&x. in (y Y) AND &y.<10),TRUE,FALSE);
%put THIS will be True: %iffunc((&x. in (y Y) AND %sysevalf(&y.<10)),TRUE,FALSE);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
---
## `%infmt()` macro <a name="infmt-macro-66"></a> ######
## >>> `%infmt()` macro: <<< <a name="infmt-macro"></a> ####################### ## >>> `%infmt()` macro: <<< <a name="infmt-macro"></a> #######################
@@ -5820,7 +6110,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
--- ---
## `%letters()` macro <a name="letters-macro-66"></a> ###### ## `%letters()` macro <a name="letters-macro-67"></a> ######
## >>> `%letters()` macro: <<< <a name="letters-macro"></a> ####################### ## >>> `%letters()` macro: <<< <a name="letters-macro"></a> #######################
@@ -5875,7 +6165,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
### EXAMPLES AND USECASES: #################################################### ### EXAMPLES AND USECASES: ####################################################
**EXAMPLE 1.** Space separated list of capital letters from A to Z: **EXAMPLE 1.** Space-separated list of capital letters from A to Z:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
%put %letters(1:26:1); %put %letters(1:26:1);
@@ -5938,7 +6228,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
--- ---
## `%libpath()` macro <a name="libpath-macro-67"></a> ###### ## `%libpath()` macro <a name="libpath-macro-68"></a> ######
## >>> `%libPath()` macro: <<< <a name="libpath-macro"></a> ####################### ## >>> `%libPath()` macro: <<< <a name="libpath-macro"></a> #######################
@@ -5983,7 +6273,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
--- ---
## `%minclude()` macro <a name="minclude-macro-68"></a> ###### ## `%minclude()` macro <a name="minclude-macro-69"></a> ######
## >>> `%mInclude()` macro: <<< <a name="minclude-macro"></a> ####################### ## >>> `%mInclude()` macro: <<< <a name="minclude-macro"></a> #######################
@@ -6196,7 +6486,7 @@ quit;
--- ---
## `%monthshift()` macro <a name="monthshift-macro-69"></a> ###### ## `%monthshift()` macro <a name="monthshift-macro-70"></a> ######
## >>> `%monthShift()` macro: <<< <a name="monthshift-macro"></a> ####################### ## >>> `%monthShift()` macro: <<< <a name="monthshift-macro"></a> #######################
@@ -6345,7 +6635,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
--- ---
## `%replist()` macro <a name="replist-macro-70"></a> ###### ## `%replist()` macro <a name="replist-macro-71"></a> ######
## >>> `%repList()` macro: <<< <a name="replist-macro"></a> ####################### ## >>> `%repList()` macro: <<< <a name="replist-macro"></a> #######################
@@ -6373,9 +6663,9 @@ The basic syntax is the following, the `<...>` means optional parameters:
**Arguments description**: **Arguments description**:
1. `list` - *Required*, a list of elements to be repeated. 1. `list` - *Required*, a list of elements to be repeated.
List can be space or comma separated. List can be space or comma-separated.
Elements can be in quotes. Elements can be in quotes.
For comma separated list add brackets For comma-separated list add brackets
e.g., `%repList((A,B,C,D),times=5)`. e.g., `%repList((A,B,C,D),times=5)`.
The list separators are: `<{[( ,;)]}>`. The list separators are: `<{[( ,;)]}>`.
@@ -6461,7 +6751,7 @@ run;
--- ---
## `%time()` macro <a name="time-macro-71"></a> ###### ## `%time()` macro <a name="time-macro-72"></a> ######
## >>> `%time()` macro: <<< <a name="time-macro"></a> ####################### ## >>> `%time()` macro: <<< <a name="time-macro"></a> #######################
@@ -6504,7 +6794,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
--- ---
## `%today()` macro <a name="today-macro-72"></a> ###### ## `%today()` macro <a name="today-macro-73"></a> ######
## >>> `%today()` macro: <<< <a name="today-macro"></a> ####################### ## >>> `%today()` macro: <<< <a name="today-macro"></a> #######################
@@ -6547,7 +6837,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
--- ---
## `%translate()` macro <a name="translate-macro-73"></a> ###### ## `%translate()` macro <a name="translate-macro-74"></a> ######
## >>> `%translate()` macro: <<< <a name="translate-macro"></a> ####################### ## >>> `%translate()` macro: <<< <a name="translate-macro"></a> #######################
@@ -6611,7 +6901,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
--- ---
## `%tranwrd()` macro <a name="tranwrd-macro-74"></a> ###### ## `%tranwrd()` macro <a name="tranwrd-macro-75"></a> ######
## >>> `%tranwrd()` macro: <<< <a name="tranwrd-macro"></a> ####################### ## >>> `%tranwrd()` macro: <<< <a name="tranwrd-macro"></a> #######################
@@ -6678,7 +6968,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
--- ---
## `%workpath()` macro <a name="workpath-macro-75"></a> ###### ## `%workpath()` macro <a name="workpath-macro-76"></a> ######
## >>> `%workPath()` macro: <<< <a name="workpath-macro"></a> ####################### ## >>> `%workPath()` macro: <<< <a name="workpath-macro"></a> #######################

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB