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