mirror of
https://github.com/sasjs/core.git
synced 2026-01-03 07:40:04 +00:00
fix: updating return codes
This commit is contained in:
@@ -4,12 +4,11 @@
|
||||
@details You can probably do without this macro as it is just a one liner.
|
||||
Mainly it is here as a convenient way to remember the syntax!
|
||||
|
||||
For this macro, if the fileref exists but the underlying file does not exist
|
||||
|
||||
@param fref the fileref to detect
|
||||
|
||||
@return output returns 1 if found AND the file exists. 0 is returned if not
|
||||
found, and -1 is returned if the fileref is found but the file does not exist.
|
||||
@return output Returns 1 if found and 0 if not found. Note - it is possible
|
||||
that the fileref is found, but the file does not (yet) exist. If you need
|
||||
to test for this, you may as well use the fileref function directly.
|
||||
|
||||
@version 8
|
||||
@author [Allan Bowe](https://www.linkedin.com/in/allanbowe/)
|
||||
@@ -17,15 +16,12 @@
|
||||
|
||||
%macro mf_existfileref(fref
|
||||
)/*/STORE SOURCE*/;
|
||||
%local result;
|
||||
%let result=%sysfunc(fileref(&fref));
|
||||
%if &result>0 %then %do;
|
||||
0
|
||||
%end;
|
||||
%else %if &result=0 %then %do;
|
||||
|
||||
%if %sysfunc(fileref(&fref))=0 %then %do;
|
||||
1
|
||||
%end;
|
||||
%else %do;
|
||||
-1
|
||||
0
|
||||
%end;
|
||||
|
||||
%mend;
|
||||
Reference in New Issue
Block a user