DATA Step, Macro, Functions and more

proc import wizard problem...

Reply
Contributor
Posts: 40

proc import wizard problem...

HI,

I'm using the import wizard with SAS to import a MS Excel CSV file.  The problem is that SAS imports the entire file as a header with no observations.

 

For example,

SAS shows a 10 variable dataset with 0 observations:

RSID  FULLNAME  Priv  Date  EMAIL  Ugkdd10  Jason Thomas  DBA  2008  jt@hotmail.com

 

I need SAS to show me a 5 variable dataset with 1 observation:

RSID,           FULLNAME,         Priv,     Date,       EMAIL

Ugkdd10      Jason Thomas      DBA     2008        jt@hotmail.com

 

I couldn't find any documentation of how to do this.  Maybe proc transpose with some other formula?

 

Do I need to figure out a way to recreate the dataset with SAS code (i.e., SCAN, SUBSTR, etc)?

 

Any help is very much appreciated.

Super User
Super User
Posts: 8,267

Re: proc import wizard problem...

I bet you are using Excel on a MAC?

Excel is too stupid to understand that Mac's are now using Unix and that text files should use linefeed as the end of line marker and not carriage return.

Either use the SAVE AS feature and pick a different file format that uses the right end of line markers.

Or tell SAS that the end of line marker is CR.

filename mycsv 'filename' termstr=cr;
Contributor
Posts: 40

Re: proc import wizard problem...

Nah, not a Mac.  Using proc import wizard via Windows PC.

Super User
Posts: 4,016

Re: proc import wizard problem...

Try another FILE SAVE AS CSV making sure you just choose the plain CSV option  and not CSV (MAC).

PROC Star
Posts: 624

Re: proc import wizard problem...

Make sure you saved the right CSV file. If you save your file as CSV(Macintosh) and try to import it into SAS then you will have the records in a single line.

@Tom You maybe right they maybe saved as Mac files.

Test.png

 

 

 

 

 

 

Thanks,
Suryakiran
SAS Super FREQ
Posts: 9,424

Re: proc import wizard problem...

Posted in reply to SuryaKiran

Hi:

  One possible solution has also been posted here: https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-... in your other posting on the same question.

Cynthia

Ask a Question
Discussion stats
  • 5 replies
  • 156 views
  • 2 likes
  • 5 in conversation