I'm using proc import for a .txt file and the delimiter in it is |.
My DBMS line had been DBMS = TAB REPLACE; but that does not work with the | delimiter.
I've also tried
DBMS = DLM = '|' REPLACE;
DBMS = DLM REPLACE;
DBMS = '|' REPLACE;
None of them work. Anyone with any idea what would work? Any info is appreciated.
proc import datafile="path to your txt file" out=mydata dbms=dlm replace;
delimiter="|";
getnames=yes;
run;
@n6 wrote:
I'm using proc import for a .txt file and the delimiter in it is |.
My DBMS line had been DBMS = TAB REPLACE; but that does not work with the | delimiter.
I've also tried
DBMS = DLM = '|' REPLACE;
DBMS = DLM REPLACE;
DBMS = '|' REPLACE;
None of them work. Anyone with any idea what would work? Any info is appreciated.
proc import datafile="path to your txt file" out=mydata dbms=dlm replace;
delimiter="|";
getnames=yes;
run;
@n6 wrote:
I'm using proc import for a .txt file and the delimiter in it is |.
My DBMS line had been DBMS = TAB REPLACE; but that does not work with the | delimiter.
I've also tried
DBMS = DLM = '|' REPLACE;
DBMS = DLM REPLACE;
DBMS = '|' REPLACE;
None of them work. Anyone with any idea what would work? Any info is appreciated.
It works. Beautiful. Thank you.
@n6 wrote:
I'm using proc import for a .txt file and the delimiter in it is |.
My DBMS line had been DBMS = TAB REPLACE; but that does not work with the | delimiter.
I've also tried
DBMS = DLM = '|' REPLACE;
DBMS = DLM REPLACE;
DBMS = '|' REPLACE;
None of them work. Anyone with any idea what would work? Any info is appreciated.
What did you log show? Expect several different errors.
The example from the documentation gives you pretty clear example:
proc import datafile=<your filename goes here> dbms=dlm out=<your data set name goes here> replace; delimiter='|'; getnames=yes; run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.