Help using Base SAS procedures

Import txt data with tab-delimited values

Accepted Solution Solved
Reply
Contributor
Posts: 57
Accepted Solution

Import txt data with tab-delimited values

Hi,

I know there are already a lot of old posts to this question. I read them through but I still cannot solve my problem.

I have an excel table with more than 255 columns. that is why i saved the excel data to a .txt data with tab-delimited values. and then i used the following code to read it into SAS:

PROC IMPORT OUT=libl.texttest

DATAFILE="R:\Test\myfile.txt";

DBMS=DLM REPLACE;

GETNAMES=YES;

DELIMITER='09'x;

SCANTEXT=YES;

RUN;

when i look at the log, it shows error 180-322.

can someone help me solve this problem or give me a hint, how it came out like this? I am very grateful for that.

BR  Dingdang


Accepted Solutions
Solution
‎11-07-2013 12:03 PM
N/A
Posts: 1

Re: Import txt data with tab-delimited values

It looks like you've got an extra semi-colon in the import, after the datafile spec.

PROC IMPORT OUT=libl.texttest

DATAFILE="R:\Test\myfile.txt";  * <~~~ Remove this semi-colon;

DBMS=DLM REPLACE;

GETNAMES=YES;

DELIMITER='09'x;

SCANTEXT=YES;

RUN;

View solution in original post


All Replies
Occasional Contributor
Posts: 7

Re: Import txt data with tab-delimited values

Hi Dingdang,

Try delimiter=tab. 

Hope this helps.

Brandy

Contributor
Posts: 57

Re: Import txt data with tab-delimited values

hi Brandy,

thanks for your quick help. just tried it but still i got the same error message error 180 Smiley Sad

BR  Dingdang

Solution
‎11-07-2013 12:03 PM
N/A
Posts: 1

Re: Import txt data with tab-delimited values

It looks like you've got an extra semi-colon in the import, after the datafile spec.

PROC IMPORT OUT=libl.texttest

DATAFILE="R:\Test\myfile.txt";  * <~~~ Remove this semi-colon;

DBMS=DLM REPLACE;

GETNAMES=YES;

DELIMITER='09'x;

SCANTEXT=YES;

RUN;

Contributor
Posts: 57

Re: Import txt data with tab-delimited values

hi AJPeters,

thanks, that was one of the errors that i made. In addition i deleted the row "SCANTEXT=YES" and then it worked well.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 304 views
  • 0 likes
  • 3 in conversation