Functions and CALL Routines |
Category: | Macro |
Syntax | |
Arguments | |
Comparisons | |
Examples | |
See Also |
Syntax |
CALL SYMPUTX(macro-variable, value <,symbol-table>); |
a character string that is a SAS name, enclosed in quotation marks.
the name of a character variable whose values are SAS names.
a character expression that produces a macro variable name. This form is useful for creating a series of macro variables.
specifies a character or numeric constant, variable, or expression. If value is numeric, SAS converts the value to a character string using the BEST. format and does not issue a note to the SAS log. Leading and trailing blanks are removed, and the resulting character string is assigned to the macro variable.
specifies a character constant, variable, or expression. The value of symbol-table is not case sensitive. The first non-blank character in symbol-table specifies the symbol table in which to store the macro variable. The following values are valid as the first non-blank character in symbol-table:
Note: If you omit symbol-table, or if symbol-table is blank, CALL SYMPUTX stores the macro variable in the same symbol table as does the CALL SYMPUT routine.
Comparisons |
CALL SYMPUTX is similar to CALL SYMPUT except that
CALL SYMPUTX does not write a note to the SAS log when the second argument is numeric. CALL SYMPUT, however, writes a note to the log stating that numeric values were converted to character values.
CALL SYMPUTX uses a field width of up to 32 characters when it converts a numeric second argument to a character value. CALL SYMPUT uses a field width of up to 12 characters.
CALL SYMPUTX left-justifies both arguments and trims trailing blanks. CALL SYMPUT does not left-justify the arguments, and trims trailing blanks from the first argument only. Leading blanks in the value of name cause an error.
CALL SYMPUTX enables you to specify the symbol table in which to store the macro variable, whereas CALL SYMPUT does not.
Examples |
The following example shows the results of using CALL SYMPUTX.
data _null_; call symputx(' items ', ' leading and trailing blanks removed ', 'lplace'); call symputx(' x ', 123.456); run; %put items=!&items!; %put x=!&x!;
The following lines are written to the SAS log:
----+----1----+----2----+----3----+----4----+----5 items=!leading and trailing blanks removed! x=!123.456!
See Also |
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.