Desktop productivity for business analysts and programmers

Error importing unformatted data through Enterprise Guide

Reply
N/A
Posts: 1

Error importing unformatted data through Enterprise Guide

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.
Respected Advisor
Posts: 3,825

Re: Error importing unformatted data through Enterprise Guide

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
Ask a Question
Discussion stats
  • 1 reply
  • 69 views
  • 0 likes
  • 2 in conversation