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

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!

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
  • 591 views
  • 0 likes
  • 2 in conversation