SAS Enterprise Guide

Desktop productivity for business analysts and programmers
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sethuraman_ram
Obsidian | Level 7

Has anyone faced problems while loading an SQL table with long column names? When i try to drag a table having long column names onto a process flow from a library , I get the error that an Open data operation and the error is that the variable < long column name> is not foind in the file.

It appears to me that the SAS/Access engine for SQL server is not able to recognize long column names. If anyone has experienced this, would love to know what workarounds are avaialbe for this issue.

 

Thanks,

Sethu

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

Try this SAS option: options validvarname = V7;

 

This should truncate on-the-fly any long SQL Server column names to no more than 32 characters.

View solution in original post

4 REPLIES 4
Reeza
Super User

One workaround is to create a view that has the variable renamed to something that's shorter.

Then load the view.

sethuraman_ram
Obsidian | Level 7

Thanks for the reply.

I also posed this question to SAS technical support and they came back with the following solution:

"

For the long column names, in EG go to Tools>Options>SAS Programs.  

Put a check mark beside "Submit SAS code when server is connected" and click the Edit box.  Enter:

 

  options validvarname=v7;"

 

This has the effect of truncating the long variable names but it allows me to proceed with defining tasks on EG

SASKiwi
PROC Star

Cool - problem solved. Please be aware the 32 character limit also applies to table names. If you have table names > 32 characters they will not show in your data libraries / server list at all and you will need to use SQL passthru to read them.

SASKiwi
PROC Star

Try this SAS option: options validvarname = V7;

 

This should truncate on-the-fly any long SQL Server column names to no more than 32 characters.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 3855 views
  • 7 likes
  • 3 in conversation