I am trying to import text file in sas. Data as below:
AccNumber Name Date of Birth Type City Score
1211111111 Mmmmm Ggggg 01-Dec-1989 Base Nanded 111
7222222222 Rannnn Sssss 14-Jan-1989 Silver mumbai 222
FILENAME REFFILE '/folders/myshortcuts/MyFolder/AccountChar.txt';
PROC IMPORT DATAFILE=REFFILE
DBMS=csv
OUT=WORK.IMPORT2;
GETNAMES=YES;
delimiter='09'x;
RUN;
PROC CONTENTS DATA=WORK.IMPORT2; RUN;
But, after import, I got a dataset with 107 columns and only Account number column is showing correct data.
Need help.
Log output:
NOTE: 296 records were read from the infile REFFILE.The minimum record length was 128.The maximum record length was 150.
NOTE: The data set WORK.IMPORT5 has 296 observations and 1 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds
296 rows created in WORK.IMPORT5 from REFFILE.
NOTE: WORK.IMPORT5 data set was successfully created. NOTE: The data set WORK.IMPORT5 has 296 observations and 1 variables. NOTE: PROCEDURE IMPORT used (Total process time): real time 0.14 seconds cpu time 0.13 seconds PROC CONTENTS DATA=WORK.IMPORT5; RUN;
data _null_; infile '/folders/myshortcuts/MyFolder/AccountChar.txt' obs=2; input; list; run;
– Tom