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-white.png

🚨 Early Bird Rate Extended!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Lock in the best rate now before the price increases on April 1.

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
  • 2098 views
  • 1 like
  • 2 in conversation