I uploaded this txt file and the output data displays everything in only one column. How do I get it show the data in the seperate columns. Here's the code I used and attached are screenshots.
/* Generated Code (IMPORT) */
/* Source File: hbat tabs.txt */
/* Source Path: /home/tmaciver7840/my_content */
/* Code generated on: Friday, June 24, 2016 3:03:23 PM */
%web_drop_table(WORK.IMPORT3);
FILENAME REFFILE "/home/tmaciver7840/my_content/hbat tabs.txt" TERMSTR=CR;
PROC IMPORT DATAFILE=REFFILE
DBMS=DLM
OUT=WORK.IMPORT3;
GETNAMES=YES;
RUN;
PROC CONTENTS DATA=WORK.IMPORT3; RUN;
%web_open_table(WORK.IMPORT3);
Hi
From the name of the file and how it behaves, I assume you have a tab delimited file. So your Proc IMPORT code should say DBMS=TAB
proc import
out=work.book
datafile="c:\temp\book1_tab.txt"
dbms=tab
replace
;
getnames=yes;
run;
Bruno
Hi
From the name of the file and how it behaves, I assume you have a tab delimited file. So your Proc IMPORT code should say DBMS=TAB
proc import
out=work.book
datafile="c:\temp\book1_tab.txt"
dbms=tab
replace
;
getnames=yes;
run;
Bruno
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!
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.