I am trying to create a SAS table from a flat file while excluding headers. Currently I have set the writer to start on line two. However it still pulls my headers from line one.
Is there an easy solution to creating a SAS table from a flat file without reading in headers?
One suggestion: bypass the import task and simply submit the desired code. e.g., if it's 3 numeric columns:
data want; infile '/folders/myfolders/testdata.txt' firstobs=2; input col1-col3; run;
Art, CEO, AnalystFinder.com
Are you using DI Studio or SAS Base?
If you're using SAS BASE you can try the datarow option in PROC IMPORT or FIRSTOBS in a data step.
If you're using SAS DI Studio then you need to define the first line to be read on the External File object as shown below.
Do you mean that you want to ignore the variable names in the first row and have SAS just assign variable names?
Do you mean that your file doesn't have variable names in the first row?
Do you mean that SAS is trying the read the variable names in the first row as part of the data?
Or that you want to find the variable names in a later row? Perhaps you are reading from some type of report that has one or more report titles before the lines of data?
Thank you all, I got it to read in properly.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.