I have a large SAS file to read on a smaller memory machine. I know how to use skip
and n_max
in combination in a read_sas
call using haven
package to actually read the file in chunks and process. However, I am wondering if there is a way to get the row count and even the list of columns in the SAS file before reading it in.
In python, this works (Read SAS file to get meta information):
import pyreadstat
df, meta = pyreadstat.read_sas7bdat('sasFile.sas7bdat', metadataonly=True)
meta.number_rows
Need equivalent in R.