Type : CREATION_INTERNE
The `DATA _NULL_` step manipulates character strings to construct a file path based on existing macro variables and arguments passed to the macro. No data is read or processed from external sources or SASHELP tables directly in this script. The main output is the creation of a global macro variable.
| 1 | %macro os_fvars (mvar=, projpath=); |
| 2 | |
| 3 | %** SETUP GLOBAL MACRO VARIABLE ***; |
| 4 | %global &mvar; |
| 5 | DATA _null_; |
| 6 | mvar=upcase("&mvar"); |
| 7 | %IF &projpath= %THEN %DO; |
| 8 | path="&_projpre"||"&_suffix"; |
| 9 | %END; |
| 10 | %ELSE %DO; |
| 11 | path="&_projpre"||"&_divider"||trim(left(tranwrd("&projpath",":","&_divider"))) |
| 12 | ||"&_suffix"; |
| 13 | %END; |
| 14 | call symput(mvar,trim(left(path))); |
| 15 | put "NOTE: os_fvars macro has set-up the following global macro variable:-"; |
| 16 | put "NOTE: " mvar ": " path; |
| 17 | RUN; |
| 18 | |
| 19 | %mend os_fvars; |