Merge pull request #42 from yabwon/main

The GSM package [ver. 0.19]
This commit is contained in:
Bart Jablonski
2022-03-13 20:45:35 +01:00
committed by GitHub
5 changed files with 64 additions and 20 deletions

View File

@@ -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")

View File

@@ -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")

View File

@@ -1,3 +1,6 @@
/* 20220307 */
GSM: F63B8C602C1DB02F4107D9AF78182D87CD64AEA6521163067B7EB6D5C1B368AF
/* 20220307 */
GSM: 8D730316043A6523A3AF2AA15D2820BB75A46E06307F2B8916D30AC102AEE31D

View File

@@ -8,7 +8,7 @@
---
# The GSM package [ver. 0.18] <a name="gsm-package"></a> ###############################################
# The GSM package [ver. 0.19] <a name="gsm-package"></a> ###############################################
The **GSM** (a.k.a. *Generate Secure Macros*) package allows
to create secured macros stored in SAS Proc FCMP functions.
@@ -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: <<< <a name="gsm-macro"></a> #######################
@@ -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: <<< <a name="gsmpck-makefcmpcode-macro"></a> #######################
## >>> `%GSMpck_makeFCMPcode()` macro: <<< <a name="GSMpck-makeFCMPcode-macro"></a> #######################
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.*
---

Binary file not shown.