1.

Explain how %Let and macro parameters can be used to create micro variables in SAS programming?

Answer»

%LET: %Let is GENERALLY used to create MICRO variables and assign values to them. You can define it inside or OUTSIDE a macro. 

Syntax: %LET macro-variable-name = value;

Any number, text or date can be entered in the Value field, depending on what the program requires.  

How to use the Micro Variable?

Whenever referencing macro variables, an AMPERSAND (&) is used followed by the macro variable name as shown below: 

& <Macro variable Name>

Macro Parameters: Macros have variables called parameters whose values you set when you invoke the macro. The parameters are added to a macro by naming them in parenthesis in %macro.

Syntax: 

%MACRO macro-name (parameter-1= , parameter-2= , ......parameter-n = ); Macro Statements; %MEND;

How to call a Macro?

To call/use micro variables, we use % followed by the macro variable name and then pass parameters.
%macro_name(par1,par2,....parn);



Discussion

No Comment Found