Monday, 15 August 2011

variables - Difference between defining SAS macrovariables via %let and call symput? -


I'm not sure what the difference is

% m = product and cal symput ('

To define macro variables based on text or expression to solve text "Itemprop =" text ">

% is used. It is called in an open code, or macro. % give And trim the macro variable of trailing spaces The zygote can be found.

call simpt (documentation) is used to specify the contents of the SAS dataset variable, an expression that has a SAS dataset variable (or a PDV variable), the value of a character, or an expression that resolves a character value (a numerical value, which in turn determines the equivalent of its character, usually BEST12). call simulation does no trim or forwarding is empty, for example expression

 % x = 5; Put% [& amp; X];   

gives you slightly different results than expression

  data_null_; Call simpat ('y', 5); Run; Put% [& amp; Y];   

call simpt (available from 9.2) has the same results as % let , which are major and backward For Records This is especially useful for macro variables created from numbers, because usually there are several major spaces in the example above.

% let and call symput \ symputx also have some differences in scoping when both open code (or data phase in a macro) , Then the macro variable will be placed in the global table, but in the macro % will place the variable in the most local table, if it is already; That is, if you have global variable and myvar then % myvar = 5; will modify the global variable and myvar , do not create a local scope variable call prompt will replace the variable in the most local non-receipt symbol table even if Whether it is not already a global one or not. call simptics will do this, unless you do not indicate any alternative argument that the table you want will be kept.

No comments:

Post a Comment