My input file is in “CSV” but I have 2 problems here
1. My variable name start in line3 , how can I write the code to start reading name from line3 and take value from line4 ?
2. acct_num has some typo ( space , – dash ) this force error in the process, so I couldn’t get the file import to sasdataset. ( I know I do this in sasdataset , but not sure how can I get this import to SAS)
PROC IMPORT DATAFILE="c:\temp\bad.csv" OUT=table1 DBMS=CSV REPLACE;
GETNAMES=YES;
DATAROW=2;
RUN;
line1 Title_name
line2
line3 acct_name acct_num
line4 A 12345
line5 B 12 345
line6 C 12-345
line7 D 1234
line8 E 123
SAS dummy
I couldn’t get the import to do what you wanted, maybe another answer will help with PROC IMPORT….however, you can use an INFILE statement. This solution assumes you know your variable names.
Assuming your file looks something like this:
the below code will start reading on line 4.
Update your question with additional questions if this is an acceptable solution and you need help maninpulating the data that is read in.