mirror of
https://github.com/sasjs/core.git
synced 2025-12-11 06:24:35 +00:00
fix: avoid open file handle when the variable to find is not provided (in mf_existvar)
Includes a test that was failing and is now passing
This commit is contained in:
12
all.sas
12
all.sas
@@ -312,13 +312,17 @@ https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md#functionex
|
||||
%local dsid rc;
|
||||
%let dsid=%sysfunc(open(&libds,is));
|
||||
|
||||
%if &dsid=0 or %length(&var)=0 %then %do;
|
||||
%if &dsid=0 %then %do;
|
||||
%put %sysfunc(sysmsg());
|
||||
0
|
||||
0
|
||||
%end;
|
||||
%else %if %length(&var)=0 %then %do;
|
||||
0
|
||||
%let rc=%sysfunc(close(&dsid));
|
||||
%end;
|
||||
%else %do;
|
||||
%sysfunc(varnum(&dsid,&var))
|
||||
%let rc=%sysfunc(close(&dsid));
|
||||
%sysfunc(varnum(&dsid,&var))
|
||||
%let rc=%sysfunc(close(&dsid));
|
||||
%end;
|
||||
|
||||
%mend mf_existvar;
|
||||
|
||||
Reference in New Issue
Block a user