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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 4 replies
  • 3030 views
  • 7 likes
  • 3 in conversation