haven
haven copied to clipboard
dataset with zero observations fails to parse, one observation reads in cleanly
not sure if haven
fails to read datasets with zero observations? these two sas files.zip were created off the same source SAS file, keeping zero and then one record with these data steps:
data x.zero_observations;
set x.pu2018 (obs=0);
run;
data x.one_observation;
set x.pu2018 (obs=1);
run;
SAS pops up an error when opening the zero-observation dataset, but then allows the user to examine the column names and labels.. haven
doesn't allow them to be read in at all
x <- haven::read_sas("one_observation.sas7bdat")
# works
y <- haven::read_sas("zero_observations.sas7bdat")
# Error: Failed to parse C:/Users/AnthonyD/Desktop/zero_observations.sas7bdat: Invalid file, or file has unsupported features.
thanks!!!
Hey @ajdamico, this is an error coming from ReadStat.
@evanmiller can you please have a look? I've tried the linked zero observations file directly in ReadStat and get the same error.