BookmarkSubscribeRSS Feed
RAmarapuram
Obsidian | Level 7

Hi Team

We have recently migrated from SAS EG 4.1 to SAS EG 7.1.

In the older version (4.1), we have used PROC IMPORT to import a CSV file.While importing, if any variable had spaces, then the spaces would be replaced by _.

For Eg: Account Number would be replaced by Account_Number.

In the Newer version (7.1), the same code is importing the variable name with spaces. Eg: Account Number and it is NOT replacing spaces with _. I have tried options validvarname=V7; but it isn't working.

Please advice.

I am using the below code:

options validvarname=v7;

proc import  datafile="TT3.csv"

out=HPI dbms=CSV;

run;

proc contents data= HPI;

run;

Thanks

Rajesh

3 REPLIES 3
AnneOKeefe
Fluorite | Level 6

This has also happened to me with an excel file.  When I use proc import in SAS 9.4  (on Win7 64bit), the space is replaced by a "_" (which is what I expect it to do).  However when the exact same code is run in EG 7.1, the space is not replaced.   (SAS PC Files Server is installed and running.)

proc import file="u:\report1.xls"

out=report1_in dbms=xls replace;

  namerow=13;

  startrow=15;

  getnames=yes;

run;

Anne

SASKiwi
PROC Star

This behaviour is controlled by EG settings under Data General. You can change these settings permanently for all EG sessions, but you have to be careful if you run the same code outside of EG then you may require additional SAS OPTIONs:

screenshot6.jpg

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