BookmarkSubscribeRSS Feed
Phoenix9
Calcite | Level 5
Hi,

I am a beginner in SAS Enterprise Guide. I am trying to import a file that has columns of multiple widths. The file is space-delimited.

Sample:

Country State Score Rank
USA AZ 974 2
USA CA 978 1
USA OH 72 4 (2 spaces after OH. 72 is right indented)
USA IL 773 3

In this example, the third record which has two spaces after OH is my error. I am importing a missing value after OH and 7 (from 72) is read as Rank.

Can someone show me how to fix this.

Thanks.
1 REPLY 1
Patrick
Opal | Level 21
The following for EG 4.1:
I haven't found a way to resolve this issue with consecutive blanks using the import wizard.

What you can do:
Use the import wizard as you've done it already, copy the last submitted code (or from wizard: "preview code") into a new Code window, delete the infile option "DSD", run the code.

This should resolve the issue as "DSD" changes how SAS treats consecutive delimiters (http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000146932.htm)

HTH
Patrick

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