@sasjs/core 5.3.1 → 5.3.2

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.
@@ -29,26 +29,26 @@
29
29
 
30
30
  %macro mf_getvalue(libds,variable,filter=1,fetchobs=1,warn=0
31
31
  )/*/STORE SOURCE*/;
32
- %local dsid rc vartype;
32
+ %local dsid rc vartype result;
33
33
 
34
34
  %let vartype = %mf_getvartype(&libds,&variable);
35
35
 
36
36
  %let dsid=%sysfunc(open(&libds(where=(&filter))));
37
37
  %if (&dsid) %then %do;
38
- %syscall set(dsid);
39
38
  %let rc = %sysfunc(fetchobs(&dsid,&fetchobs));
40
39
  %if (&rc ne 0) %then %do;
41
- %put %sysfunc(sysmsg());
42
- /* Set the requested variable to a missing value */
43
- /* Need only consider numerics - char variables are already empty*/
44
- %if (&vartype eq N) %then %let &variable = .;
40
+ /* Fetchobs() failed - Log any issue that was not 'read past end' */
41
+ %if (&rc ne -1) %then %put %sysfunc(sysmsg());
42
+ /* Set the result to a missing value dependent on type. */
43
+ %if (&vartype eq N) %then %let result = .;
44
+ %else %let result = ;
45
+
45
46
  %if (&warn) %then %do;
46
47
  %if (&rc eq -1) %then %do; /* read past end of data */
47
48
  %put %sysfunc(
48
49
  compbl(
49
- %quote(WARN%str(ING): Missing value returned as no rows were)
50
- %quote(found in &libds for filter (%superq(filter)))
51
- %quote(and/or fetchobs (&fetchobs).)
50
+ %quote(WARN%str(ING): Missing value returned for variable)
51
+ %quote(&variable after reading past end of &libds..)
52
52
  )
53
53
  );
54
54
  %let rc=4;
@@ -57,9 +57,17 @@
57
57
  /* And update SYSCC if the &rc value is higher */
58
58
  %let syscc = %sysfunc(max(&syscc,&rc));
59
59
  %end;
60
+ %else %do;
61
+ %let result = %sysfunc(
62
+ getvar&vartype(
63
+ &dsid
64
+ ,%sysfunc(varnum(&dsid,&variable))
65
+ )
66
+ );
67
+ %end;
60
68
  %let rc = %sysfunc(close(&dsid));
61
69
 
62
- %trim(&&&variable)
70
+ %trim(&result)
63
71
 
64
72
  %end;
65
73
  %else %do;
package/package.json CHANGED
@@ -43,5 +43,5 @@
43
43
  "devDependencies": {
44
44
  "@nogoo9/gitleaks": "8.30.1-post.2"
45
45
  },
46
- "version": "5.3.1"
46
+ "version": "5.3.2"
47
47
  }