Chapter Contents

Previous

Next
SYMPUT and SYMPUTN

SYMPUT and SYMPUTN



Store a value in a SAS macro variable

Category: Macro


Syntax
Details
Examples
Example 1: Using the SYMPUT Routine
Example 2: Using the SYMPUTN Routine
See Also

Syntax

CALL SYMPUT(macro-var,cval);
CALL SYMPUTN(macro-var,nval);

macro-var
is the macro variable to store a value in.

Type: Character

cval
is the character value for SYMPUT to store in macro-var.

Type: Character

nval
is the numeric value for SYMPUTN to store in macro-var.

Type: Numeric


Details

SYMPUT stores a character value in a SAS macro variable, whereas SYMPUTN stores a numeric value in a SAS macro variable. If macro-variable does not exist, SYMPUT and SYMPUTN create it. SYMPUT and SYMPUTN make a macro variable assignment when the program executes.


Examples

Example 1: Using the SYMPUT Routine

Store the value of the SCL variable SCLVAR in the macro variable TBL:

call symput('tbl',sclvar);

Example 2: Using the SYMPUTN Routine

Store the numeric value 1000 in the macro variable UNIT:

call symputn('unit',1000);

See Also

SYMGET and SYMGETN


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.