SASUnit Examples  Version 1.5.0
_abspath.sas
Go to the documentation of this file.
1 
21 %MACRO _abspath (i_root
22  ,i_path
23  );
24 
25  %IF "&i_path" EQ "" %THEN %RETURN;
26 
27  %IF %length(&i_root) %THEN %DO;
28  %LET i_root = %qsysfunc(translate(&i_root,/,\));
29  %IF "%substr(&i_root,%length(&i_root),1)" = "/" %THEN
30  %LET i_root=%substr(&i_root,1,%eval(%length(&i_root)-1));
31  %END;
32 
33  %LET i_path = %qsysfunc(translate(&i_path,/,\));
34  %IF "%substr(&i_path,1,1)" = "/" OR "%substr(&i_path,2,2)" = ":/" %THEN &i_path;
35  %ELSE %IF %length(&i_root) %THEN &i_root/&i_path;
36  %ELSE &i_path;
37 
38 %MEND _abspath;