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;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: