BookmarkSubscribeRSS Feed
dbrownin
Calcite | Level 5
i'm trying to perform a one to one merge to link two datasets with a uniqueid (common key) that is a text veriable. these data currently reside as two separate Excel files and i use the IMPORT function.

the issue i've encountered is that in one dataset the uniqueid is 8 characters long and in the other it is 30 characters long (excel formatting?). is there a way to specify var length when importing data from an excel file?

thanks in advance.
dawn
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi, Dawn:
When you import from Excel into SAS, you are probably using PROC IMPORT or the Libname engine for Excel. Neither of those methods has any involvement with ODS.

Your best bet for figuring out import issues is to contact Tech Support. They can determine which method you are using and can advise you on the best method to use to get your var length set correctly. Since you are programming a merge, Tech Support can also help you figure out whether a simple LENGTH statement would work or whether there's a different method that works better.

Generally speaking, in a merge, if you list the file with the longer variable in the merge statement first, SAS uses that length for the length in the merged file. But there may be other issues with the particular technique that you're using. Tech Support could help with that.

To find out how to contact Tech Support, refer to:
http://support.sas.com/techsup/contact/index.html
Good Luck!
cynthia

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1 reply
  • 626 views
  • 0 likes
  • 2 in conversation