Variable Length

Other topics

Assigning length to a character variable

data table;
set table;
length state_full $8;
if state = 'KS' then state_full = 'Kansas';
else if state = 'CO' then state_full = 'Colorado';
else state_full = 'Other';
run;

Syntax:

  • LENGTH variable(s) <$>length;

Parameters:

ParameterDetails
variable(s)variable(s) you wish to assign a length to
$optional parameter that specifies if your variable is a character variable
lengthinteger that specifies the length of the variable

Contributors

Topic Id: 7883

Example Ids: 25612

This site is not affiliated with any of the contributors.