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
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.