Hello all,
sas variable name length is 32 character,however sas says that character variables can be up to 32,767 bytes long.it is confusing for me .character length is 32 or 32,767? I appreciate if anyone enlighten me.
The name of the variable can be up to 32 bytes long. The value that is stored in the variable can be up to 32,767 bytes long.
It is like the difference in the number of letters in the title of a book and the number of letters on the pages of the book.
The name of the variable can be up to 32 bytes long. The value that is stored in the variable can be up to 32,767 bytes long.
It is like the difference in the number of letters in the title of a book and the number of letters on the pages of the book.
Labels for variables may contain more text to describe variables though, 256 characters currently and can contain spaces and some special characters.
See this code for a brief example:
data example;
x=123;
label x='This is a demonstration label for a generic variable named X';
run;
proc print data=example label;
var x;
run;
some procedures will default to showing all or part of a label when used, others like print want an explicit instruction to use the labels.
Labels may be permanent, as assigned in the step that creates them or temporary for a specific procedure call:
proc print data=example label;
var x;
label x='Shorter label for x';
run;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.