BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
fatemeh
Quartz | Level 8

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

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.

 

View solution in original post

2 REPLIES 2
Tom
Super User Tom
Super User

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.

 

ballardw
Super User

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;

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2971 views
  • 4 likes
  • 3 in conversation