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
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
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.