Sorry, could you give examples of where you would want to use a variable name of 128 characters, or how programming with that would be beneficial? A simple keep= statement could end up taking a whole page just keep a few variabels. Remember we used to be limited to 8 characters and worked fine with that for many years, the expansion to 32 characters is both a benefit and a downside. Personally if I have variables longer than 32 characters, or had to work with data like that I would be very unhappy. I have yet to see a production database which has variable names longer than 32 as well. Personally I would be quite happy if they restricted it back to 16.
Why not go the whole way in making code unreadable and increase it to 64k?
A length limit of 32 is not a bug, in my eyes it's a wonderful feature keeping the smaller minds from cluttering themselves and making living harder for the rest of us.
For descriptions, the labels can be used.
You could use explicit pass through to rename your variables and make them fit.
.. I added the example for ODBC, because I am using it.
I appreciate the discussion raised by @alecwh22. The 32-byte limitation on a variable name does rear up often -- mostly as SAS users are trying to interface with database tables that have long column names. There are a number of strategies to work around (PRESERVE_COL_NAMES, passthrough, and newer programming languages in SAS like DS2 and FedSQL) -- these are worth exploring if you need an approach that works today.
I agree with others that long column names (even in databases) present a programming and maintenance challenge in general, but often SAS programmers are consumers of the database, and not the designers.
"There is a bug in SAS that aggressively limits the length of variable names and cripples SAS's ability to interface with any well maintained literally name database. "
And then the troll comes and accuses others of trolling.
Hi @KurtBremser, I think we're all on the same page here now. This conversation began on Twitter and I'm glad to have it here instead, as there is more room for thoughtful sharing and debate. "bug" or "limitation" is semantics, and as a SAS developer I use the term "limitation" or even "as designed" -- but I can appreciate when something doesn't seem to work as a user needs it, and the perception that it's something that needs to be addressed.
Can I suggest that this is kept as a system option. I am just searching the languages I know and not one of them recommends having long variable names. My concern is that if the length is lengthed we will see programs which are vastly over sized with variable names such as:
This doesn't add anything to the programming, and should be held in the label property of the variable.
I can give several posts from the Communities on this kind of topic now, the missunderstanding of variable name and label, even with the increase from 8 to 32 we are starting to see a rise of descriptive names, and no label, which makes programming a fair bit harder.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.