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;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.