BookmarkSubscribeRSS Feed
sbrundage
Calcite | Level 5

Hello, Everyone.

I have a .xlsx spreadsheet that I am trying to import using Enterprise Guide.  I select the data source in Step 1 of the Import Wizard, then, in Step 2, I make sure that both "First row of range contains field names" and "Rename columns to comply with SAS naming conventions" are checked.  Then, in Step 3, "Define Field Attributes", all of the values in the "Name" column (except those that didn't contain a space in the source) are being set to something like 'Column Name'n, instead of Column_Name, which is what I would expect.  If I copy any header cell from the source and paste it into Notepad, I see that each column header has a line break at the end.  I tried trimming them using excel's trim(), but the line break seems to be added in again.  Also, it's odd that this problem only arises for those column headers that contain a space character in the source.  I have a column in the source called PID.  If I copy it into notepad, I still see the line return character, but SAS EG imports it and names it properly.

I'd appreciate any help you all can provide.  I'm using Enterprise Guide 6.100.0.4025 on a 64-bit Windows 7 machine with Microsoft Excel 2010.

Thanks.

Steve

4 REPLIES 4
Reeza
Super User

Try running Option validvarname=V7 and then reimport process?

sbrundage
Calcite | Level 5

Thanks for the response, Reeza.  I did that but it didn't seem to work.  I read elsewhere about your solution, and the directions noted there mentioned going into Tools > Options > Tasks General and specifying the validvarname there, but either my version of EG is too old or too new, because I see no additional SAS code section there.  Anyway, thanks again.  For now, I'm just going through my 80 or so columns and renaming them manually in Step 3.  I swear the import worked just fine less than a week ago, so maybe something in my environment has changed recently.

sbrundage
Calcite | Level 5

For anyone who is interested, although the original problem still exists, I used this simple workaround to avoid having to modify each variable name manually in the Import Wizard.

In Excel:

1.  Create a new row under the first row in the spreadsheet (which contains your variable names)

2.  Use =substitute("A1"," ","_") in the cell below each cell in the original variable names row

3.  Copy this newly created row and Paste Special > Values right over what you just copied.

4.  Delete the original column headers, save the workbook, and go do the import in Enterprise Guide.

This works fine for me, as I assume Enterprise Guides sees the incoming variable names as already being SAS-compliant, so it doesn't try to perform it's own modifications on the variable names.

Technolero
Pyrite | Level 9

This is a new behavior in 6.1.  5.1 Added underscores for us. I had many 5.1 projects break because of it.  I reported it to Chris Hemendinger at the Global Forum and he suggested that I submit it as an issue to the EG team.  I haven't gotten around to that yet.  In the meantime, I just manually added underscores in my import tasks...

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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