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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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