BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Tommac72584
Fluorite | Level 6

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);


Screen Shot 2016-06-24 at 11.12.19 AM.pngScreen Shot 2016-06-24 at 11.11.59 AM.png
1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

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

View solution in original post

2 REPLIES 2
BrunoMueller
SAS Super FREQ

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

Tommac72584
Fluorite | Level 6
Yes it is a tab delimited. This fixed it. Thank you Bruno!

sas-innovate-2024.png

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.

 

Register now!

How to connect to databases in SAS Viya

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.

Discussion stats
  • 2 replies
  • 1490 views
  • 1 like
  • 2 in conversation