Increasing of SAS variable name length

Reply
Contributor
Posts: 39

Increasing of SAS variable name length

Hi All,

 

As far as I know, we can have maximum 32 chars as variable name length.

 

Is there any option/any way to increase the length?

 

Currently we extract the data from source database where we have variable name length more than 32 chars.

 

We want to preserver the same name in our platform.

 

Could you please suggest a solution for this?

 

Thanks,
Sampath

 

Super User
Posts: 10,568

Re: Increasing of SAS variable name length

Posted in reply to bmsampath

You can put the longer names into variable labels.

More than 32 characters are not possible in SAS, as there is only place for 32 characters in the SAS dataset file structure (among other things).

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
PROC Star
Posts: 1,400

Re: Increasing of SAS variable name length

Posted in reply to bmsampath

what kind of source database?

 

There has been a few suggestions to workarounds in here, among others in this thread:

 

https://communities.sas.com/t5/SAS-Data-Management/Dealing-with-32-character-restrictions/td-p/10003...

 

Super User
Super User
Posts: 9,840

Re: Increasing of SAS variable name length

Posted in reply to bmsampath

Variable names are used in programming, is the expectation that programmers will need to type in variable names of > 32 characters each time, sounds like a massive waste of resources.  I remember working with oracle tables, and that is a real pain typing.  You do have labels where long text can be put, so as to identify the columns, that would be the ideal solution.  You can also use named variable 'xyx'n, however that is horrendous and shouldn't be used unless absolutely necessary.  Me, I would shrink all the variable names down.

Super User
Posts: 10,568

Re: Increasing of SAS variable name length

Concur. Some DB designers need to be reminded that they are not Leo Tolstoy.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Ask a Question
Discussion stats
  • 4 replies
  • 83 views
  • 3 likes
  • 4 in conversation