Type : CREATION_INTERNE
The macro does not process any datasets. It interacts with the SAS environment by reading and modifying a system option (`SASAUTOS`) via the `%sysfunc(getoption(...))` and `OPTIONS APPEND` functions.
| 1 | %macro _insertAutoCallPath(autocallpath); |
| 2 | |
| 3 | %local |
| 4 | l_currentAutoCallPath |
| 5 | l_found |
| 6 | l_autoCallPath |
| 7 | l_paramIsFileRef |
| 8 | ; |
| 9 | |
| 10 | %IF (%LENGTH(&autocallpath.)=0) %THEN %goto exit; |
| 11 | |
| 12 | %*-- %_issueTraceMessage (&g_currentLogger., Searching for Autocallpath &autocallpath); --*; |
| 13 | |
| 14 | %let l_currentAutoCallPath=%sysfunc (getoption (SASAUTOS)); |
| 15 | %let l_found=%sysfunc (findw (&l_currentAutoCallPath., &autocallpath., %str(% %"%(%)), I)); |
| 16 | |
| 17 | %if (&l_found. > 0) %then %do; |
| 18 | %*-- %_issueDebugMessage (&g_currentLogger., Autocallpath &autocallpath already set.); --*; |
| 19 | %end; |
| 20 | %else %do; |
| 21 | %let l_paramIsFileRef = 0; |
| 22 | %if (%length(&autocallpath.) <= 8) %then %do; |
| 23 | %let l_paramIsFileRef = %eval(%sysfunc (fileref (&autocallpath.))=0); |
| 24 | %end; |
| 25 | |
| 26 | %if (&l_paramIsFileRef.) %then %do; |
| 27 | options append=(SASAUTOS=(&autocallpath.)); |
| 28 | %end; |
| 29 | %else %do; |
| 30 | options append=(SASAUTOS=("&autocallpath.")); |
| 31 | %END; |
| 32 | %END; |
| 33 | |
| 34 | %exit: |
| 35 | %mend _insertAutoCallPath; |