1. Can I use SAS functions within the macro facility?Answer:Yes, by using the %SYSFUNC macrofunction.

Example: %put %sysfunc(date(),worddate20.);

2. What quoting function should I use to mask special characters?

Depends. Use compile-time or execution-time quoting functions for your situation.

Compile-time quoting functions:

%STR–masks commas, mnemonics, and unmatched quotation marks and parentheses.%NRSTR–masks percent signs and ampersands in addition to the other special characters. Execution-time quoting functions:

%BQUOTE–masks special characters and mnemonics in resolved values during macro execution.%SUPERQ–masks special characters and mnemonics during macro execution. However, it also prevents further resolution of any macros or macro variables.

4. How do I resolve error messages when output that was generated with the MPRINT system option looks fine?

Use the %UNQUOTE function

5. What are the differences between the autocall facility and the stored compiled macro facility?

Autocall Facility

Macro source code is implicitly included and compiled to the WORK.SASMACR catalog. To use autocall macros, you have to set the MAUTOSOURCE and the SASAUTOS= system options. The MAUTOSOURCE option activates the autocall facility. The SASAUTOS= option specifies the autocall library or libraries

Stored Compiled Macro Facility

The stored compiled macro facility provides access to permanent SAS catalogs from which you can invoke compiled macros directly. To use these stored compiled macros, you have to set the MSTORED and the SASMSTORE= system options. The MSTORED option searches for the compiled macros in a SAS catalog that you reference with the SASMSTORE= option. The SASMSTORE= option specifies the libref for the SAS library that contains the stored compiled macros.

The macro variable might not resolve for a few reasons:macro variable scope: Local macro variables versus global macro variables.no step boundary:The DATA step does not have an ending RUN statement before a CALL SYMPUT or a CALL SYMPUTX routine.

Example: No RUN statement before %PUT statement:data test;x="MYVALUE";call symputx('macvar',x);%put WILL I RESOLVE &macvar?;

timing issues: a result of using the CALL EXECUTE and CALL SYMPUT routines together.

8. How can I use macros to loop through all files in a directory?

Use the %DO statement

9. Can I use DATA step variables in a %IF-%THEN statement?

No, DATA step variables cannot be usedin %IF-%THEN statements.

10. Why am I getting an error that states that a character operand was found in the %EVAL function?