Special Characters in Directory Names

If the directory names that are used in the macros contain any of the following special characters, you must mask the characters by using the %STR macro quoting function. For more information, see the %STR function and macro string quoting topic in SAS Macro Language: Reference.
Character
How to Represent
blank1
%str( )
*2
%str(*)
;
%str(;)
,
%str(,)
=
%str(=)
+
%str(+)
-
%str(-)
>
%str(>)
<
%str(<)
^
%str(^)
|
%str(|)
&
%str(&)
#
%str(#)
/
%str(/)
~
%str(~)
%
%str(%%)
'
%str(%')
"
%str(%")
(
%str(%()
)
%str(%))
¬
%str(¬)
1Only leading blanks require the %STR function, but you should avoid using leading blanks in directory names.
2Asterisks are allowed in UNIX directory names. Asterisks are not allowed in Windows directory names. In general, you should avoid using asterisks in directory names.
Here are some examples of directory names with special characters:
Directory
Code Representation
c:\temp\Sales(part1)
c:\temp\Sales%str(%()part1%str(%))
c:\temp\Drug “trial” X
c:\temp\Drug %str(%")trial(%str(%") X
c:\temp\Disc's 50% Y
c:\temp\Disc%str(%')s 50%str(%%) Y
c:\temp\Pay,Emp=Z
c:\temp\Pay%str(,)Emp%str(=)Z