DATA Step, Macro, Functions and more

Why are libref and fileref limited to 8 characters?

Accepted Solution Solved
Reply
Learner
Posts: 1
Accepted Solution

Why are libref and fileref limited to 8 characters?

Hi there,

 

can anybody explain to me in simple words why libref and fileref are limited to 8 characters?

What is the reason why we can't use .. I don't know .. 32 characters?

 

Thanks in advance.


Accepted Solutions
Solution
‎09-27-2016 02:37 AM
Super User
Posts: 7,766

Re: Why are libref and fileref limited to 8 characters?

SAS was developed on IBM mainframes, and so SAS object names resemble typical OS/360 / MVS / z/OS file names, and those have a restriction that every level can have a maximum of 8 characters (so the names look like PROD.SOURCE.CNTL, but PROD.JOBSOURCE.CNTL is impossible), this is a legacy restriction coming from the early development of SAS.

It depends on the internal quality of the code repository if changing the underlying type from 8 to 32 characters will break something or not.

 

OTOH, I've never felt the need for more characters in file/librefs. And as a longtime programmer (and UNIX at that), I hate unnecessary typing. So 8 character libnames and 32 character dataset names is enough for me.

 

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Super User
Posts: 5,426

Re: Why are libref and fileref limited to 8 characters?

I think that this question is best directed to the SAS development team.
I think that one obstacle towards longer librefs is z/os naming restictions.
Data never sleeps
Super User
Posts: 19,772

Re: Why are libref and fileref limited to 8 characters?

Legacy restrictions. 

8 chars is one byte so that may have something to do with it. 

Solution
‎09-27-2016 02:37 AM
Super User
Posts: 7,766

Re: Why are libref and fileref limited to 8 characters?

SAS was developed on IBM mainframes, and so SAS object names resemble typical OS/360 / MVS / z/OS file names, and those have a restriction that every level can have a maximum of 8 characters (so the names look like PROD.SOURCE.CNTL, but PROD.JOBSOURCE.CNTL is impossible), this is a legacy restriction coming from the early development of SAS.

It depends on the internal quality of the code repository if changing the underlying type from 8 to 32 characters will break something or not.

 

OTOH, I've never felt the need for more characters in file/librefs. And as a longtime programmer (and UNIX at that), I hate unnecessary typing. So 8 character libnames and 32 character dataset names is enough for me.

 

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 332 views
  • 3 likes
  • 4 in conversation