@sasjs/core 3.11.1 → 3.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,77 @@
1
+ /**
2
+ @file
3
+ @brief Returns the length of a numeric value
4
+ @details
5
+ Returns the length, in bytes, of a numeric value. If the value is
6
+ missing, then 0 is returned.
7
+
8
+ The function itself takes the following (positional) parameters:
9
+
10
+ | PARAMETER | DESCRIPTION |
11
+ |---|---|
12
+ | var | variable (or value) to be tested|
13
+
14
+ Usage:
15
+
16
+ %mcf_length(wrap=YES, insert_cmplib=YES)
17
+
18
+ data _null_;
19
+ ina=1;
20
+ inb=10000000;
21
+ inc=12345678;
22
+ ind=.;
23
+ outa=mcf_length(ina);
24
+ outb=mcf_length(inb);
25
+ outc=mcf_length(inc);
26
+ outd=mcf_length(ind);
27
+ put (out:)(=);
28
+ run;
29
+
30
+ Returns:
31
+
32
+ > outa=3 outb=4 outc=5 outd=0
33
+
34
+ @param [out] wrap= (NO) Choose YES to add the proc fcmp wrapper.
35
+ @param [out] insert_cmplib= (NO) Choose YES to insert the package into the
36
+ CMPLIB reference.
37
+ @param [out] lib= (work) The output library in which to create the catalog.
38
+ @param [out] cat= (sasjs) The output catalog in which to create the package.
39
+ @param [out] pkg= (utils) The output package in which to create the function.
40
+ Uses a 3 part format: libref.catalog.package
41
+
42
+ <h4> Related Macros </h4>
43
+ @li mcf_length.test.sas
44
+
45
+ **/
46
+
47
+ %macro mcf_length(wrap=NO
48
+ ,insert_cmplib=NO
49
+ ,lib=WORK
50
+ ,cat=SASJS
51
+ ,pkg=UTILS
52
+ )/*/STORE SOURCE*/;
53
+
54
+ %if &wrap=YES %then %do;
55
+ proc fcmp outlib=&lib..&cat..&pkg;
56
+ %end;
57
+
58
+ function mcf_length(var);
59
+ if missing(var) then len=0;
60
+ else if trunc(var,3)=var then len=3;
61
+ else if trunc(var,4)=var then len=4;
62
+ else if trunc(var,5)=var then len=5;
63
+ else if trunc(var,6)=var then len=6;
64
+ else if trunc(var,7)=var then len=7;
65
+ else len=8;
66
+ return(len);
67
+ endsub;
68
+
69
+ %if &wrap=YES %then %do;
70
+ quit;
71
+ %end;
72
+
73
+ %if &insert_cmplib=YES %then %do;
74
+ options insert=(CMPLIB=(&lib..&cat));
75
+ %end;
76
+
77
+ %mend mcf_length;
package/package.json CHANGED
@@ -35,5 +35,5 @@
35
35
  "devDependencies": {
36
36
  "@sasjs/cli": "3.6.0"
37
37
  },
38
- "version": "3.11.1"
38
+ "version": "3.12.0"
39
39
  }