I'm reading in all CSV files from a given directory. I need to limit the observations to only read between the 4th and 128th record. When I use the firstobs and the obs options to limit the observation numbers, it applies to all files at once, limiting my data to the first file read in as they all have over 200 records.
How can I limit the number of records read in from EACH CSV file using this process?
Code below:
data mydata;
%let _EFIERR_ = 0; /* set the ERROR detection macro variable */
length FNAME $175.;
infile 'M:\Load Forecasts\Woods & Poole Download_Files_2017\SP_2017_MT_WY\WPGEO\MT Counties\*.csv'
delimiter = ',' MISSOVER DSD lrecl=32767 filename=fname /*firstobs=4 obs=128*/;
length desc $100;
input desc $ Y1969-Y2050 $;
if _ERROR_ then call symputx('_EFIERR_',1);
filename=fname;
run;
proc print data= mydata (obs=10); run;
EOV=
option on theINFILE
statement? Or you could test iffname=lag(fname)
to see when filename changes. – Tom