diff --git a/README.md b/README.md index 90c42fd..730aa1f 100644 --- a/README.md +++ b/README.md @@ -168,12 +168,12 @@ SHA256 digest for BasePlus: A60A300E083628C65DD6899E7EF95588916F8F66B6A25B32B322 [Documentation for BasePlus](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md "Documentation for BasePlus") -- **GSM** (Generate Secure Macros)\[0.18\], package allows +- **GSM** (Generate Secure Macros)\[0.19\], package allows to create secured macros stored in SAS Proc FCMP functions. The dataset with functions can be shared between different operating systems and allows to generate macros on site without showing their code. -SHA256 digest for GSM: 8D730316043A6523A3AF2AA15D2820BB75A46E06307F2B8916D30AC102AEE31D +SHA256 digest for GSM: F63B8C602C1DB02F4107D9AF78182D87CD64AEA6521163067B7EB6D5C1B368AF [Documentation for GSM](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/gsm.md "Documentation for GSM") diff --git a/packages/README.md b/packages/README.md index 5fba128..8c2c0f0 100644 --- a/packages/README.md +++ b/packages/README.md @@ -114,12 +114,12 @@ SHA256 digest for BasePlus: A60A300E083628C65DD6899E7EF95588916F8F66B6A25B32B322 --- -- **GSM** (Generate Secure Macros)\[0.18\], package allows +- **GSM** (Generate Secure Macros)\[0.19\], package allows to create secured macros stored in SAS Proc FCMP functions. The dataset with functions can be shared between different operating systems and allows to generate macros on site without showing their code. -SHA256 digest for GSM: 8D730316043A6523A3AF2AA15D2820BB75A46E06307F2B8916D30AC102AEE31D +SHA256 digest for GSM: F63B8C602C1DB02F4107D9AF78182D87CD64AEA6521163067B7EB6D5C1B368AF [Documentation for GSM](https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/gsm.md "Documentation for GSM") diff --git a/packages/SHA256_for_packages.txt b/packages/SHA256_for_packages.txt index cce3f9a..2eb747c 100644 --- a/packages/SHA256_for_packages.txt +++ b/packages/SHA256_for_packages.txt @@ -1,3 +1,6 @@ +/* 20220307 */ +GSM: F63B8C602C1DB02F4107D9AF78182D87CD64AEA6521163067B7EB6D5C1B368AF + /* 20220307 */ GSM: 8D730316043A6523A3AF2AA15D2820BB75A46E06307F2B8916D30AC102AEE31D diff --git a/packages/gsm.md b/packages/gsm.md index b10ced9..69b060f 100644 --- a/packages/gsm.md +++ b/packages/gsm.md @@ -8,7 +8,7 @@ --- -# The GSM package [ver. 0.18] ############################################### +# The GSM package [ver. 0.19] ############################################### The **GSM** (a.k.a. *Generate Secure Macros*) package allows to create secured macros stored in SAS Proc FCMP functions. @@ -54,8 +54,33 @@ Recording of presentation with "how it works" description, in Polish, is avaliab ``` - Share generated `ZIP` file (unzip and run the code). -*Limitations:* - Single macro file cannot be longer than 32760 bytes. +**Limitations:** + - Single macro file cannot be longer than 32760 bytes. + + - Multiline text variable. Consider the following code text file: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +%macro~test()/SECURE;~#@ +data~test;~#@ +a~=~"abc~#@ +~#@ +def";~#@ +put~a~hex20.;~#@ +run;~#@ +%mend~test;~#@ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +where `~` symbols the space character, +`#` symbols the carriage return (`0D`), +and `@` symbols the line feed (`0A`). +The code file is scanned and inserted into +the `resolve()` function argument in a "byte by byte" +fashion hence also the "end of line" characters are included. +As the result value of variable `a` will be: + +`a = "abc~#@~#@def"`. + +If you want to use the `GSM` package avoid +such "style" of coding in your macros. + --- @@ -69,7 +94,7 @@ Required SAS Components: * SAS package generated by generatePackage, version 20220113 * The SHA256 hash digest for package GSM: -`8D730316043A6523A3AF2AA15D2820BB75A46E06307F2B8916D30AC102AEE31D` +`F63B8C602C1DB02F4107D9AF78182D87CD64AEA6521163067B7EB6D5C1B368AF` ## >>> `%GSM()` macro: <<< ####################### @@ -92,7 +117,7 @@ be added to the macro definition. See the example: As a result a zip file, containing dataset with functions and -code to be executed on site, is generated. +code to be executed on site, is generated. Since encrypted code is stored in a SAS dataset it has no limitation in sharing between operating systems (like catalogs have). @@ -117,6 +142,7 @@ The basic syntax is the following, the `<...>` means optional parameters: <,outpath=> <,encodingRestricted=> <,secret=> + <,lineEnd=> ) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -125,10 +151,6 @@ The basic syntax is the following, the `<...>` means optional parameters: 1. `path` - *Required*, indicates a directory which contains files with macros. Only files with `sas` extension are used. -* `trim=` - *Optional*, the default value is `0`. - If set to `1` then lines of macro code are trimmed. - If set to `2` then lines of macro code are stripped. - * `cmplib=` - *Optional*, the default value is `work.generateMacros`. Names the dataset which will contain generated functions. @@ -151,8 +173,20 @@ The basic syntax is the following, the `<...>` means optional parameters: Required to execute the `resolve()` function. User who do not know the value will not be able to run the `_maxro_XX_()` function. ---- +* `lineEnd=` - *Optional*, the default value is `0D0A`, indicates which of: + line feed, carriage return, or both, or a space be inserted + at the end of line in the intermediate code file that is generated. + Value has to be hexadecimal code (_NOT_ null), + since the value is resolved as `"&lineEnd."x`, so use e.g. + `0A` for line feed, `0D` for carriage return, + `0D0A` for both, and `20` for space. + +* `trim=` - *Deprecated*, the default value is `0`. + *Kept for backward compatibility.* + + +--- ### Example: ################################################################### @@ -197,8 +231,7 @@ run; %GSM(&path., cmplib=work.myMacros) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -## >>> `%GSMpck_makeFCMPcode()` macro: <<< ####################### +## >>> `%GSMpck_makeFCMPcode()` macro: <<< ####################### The `%GSMpck_makeFCMPcode()` macro is an internal macro of the **GSM** (a.k.a. *Generate Secure Macros*) package. @@ -219,11 +252,11 @@ The basic syntax is the following, the `<...>` means optional parameters: %GSMpck_makeFCMPcode( path ,number - <,trim=0> <,outlib=work.generateMacros.secure> <,source2=> <,fileNameCode=FNC> <,secret=123456789> + <,lineEnd=0A> ) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -234,9 +267,6 @@ The basic syntax is the following, the `<...>` means optional parameters: 2. `number` - *Required*, a sequential number. -* `trim=` - *Optional*, the default value is `0`. - If set to `1` then lines of macro code are trimmed. - If set to `2` then lines of macro code are stripped. * `cmplib=` - *Optional*, the default value is `work.generateMacros`. Names the dataset which will contain generated functions. @@ -253,6 +283,17 @@ The basic syntax is the following, the `<...>` means optional parameters: function. User who do not know the value will not be able to run the `_maxro_XX_()` function. +* `lineEnd=` - *Optional*, the default value is `0D0A`, indicates which of: + line feed, carriage return, or both, or a space be inserted + at the end of line in the intermediate code file that is generated. + Value has to be hexadecimal code (_NOT_ null), + since the value is resolved as `"&lineEnd."x`, so use e.g. + `0A` for line feed, `0D` for carriage return, + `0D0A` for both, and `20` for space. + +* `trim=` - *Deprecated*, the default value is `0`. + *Kept for backward compatibility.* + --- diff --git a/packages/gsm.zip b/packages/gsm.zip index 18ab59c..65a31b9 100644 Binary files a/packages/gsm.zip and b/packages/gsm.zip differ