I need to create a SAS dataset from a binary file. My code is:
data test;
infile 'D:\test\T201.bin' lrecl=12 recfm=f;
input time IB4. v1 IB4. v2 IB4. ;
run;
Is there a way to just read particular row numbers from the input file? For example, suppose I want to keep rows 42000 to 44000. I could add this:
if 42000<=_n_<=44000
but I’m wondering if there is a more efficient way to do this. My understanding is that this approach would cause SAS to read all rows but only keep the ones specified in the output data set. Is there a way that SAS can jump directly to specific rows? (Efficiency is very important here because I have terabytes of data to process.)
I don’t know the exact performance but you may try
firstobs and obs options. It will enable reading a range of records from the middle of a file.