Skip to content

read_sas, Unable to allocate memory, when dataset has no variables #420

Closed

Description

Dear developer,

It seems that a read_sas() fails whenever a SAS dataset has no variables. This happens with haven 1.1.2 and higher. Probably it would be better to inform user that dataset does not have variables rather than failing. For example, If you have a dataset created with the following code:

libname out '~';

data out.some_data;
run;

and then you read with haven::read_sas('~/some_data.sas7bdat') it gives the following error:

ReadStat: Error parsing page 0, bytes 74752-149503
Error in df_parse_sas_file(spec_data, spec_cat, encoding = encoding, catalog_encoding = catalog_encoding,  : 
  Failed to parse /opt/bee/home_NEW/manukyae/some_data.sas7bdat: Unable to allocate memory.
> R.version
               _                           
platform       x86_64-pc-linux-gnu         
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          3                           
minor          5.1                         
year           2018                        
month          07                          
day            02                          
svn rev        74947                       
language       R                           
version.string R version 3.5.1 (2018-07-02)
nickname       Feather Spray  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorreadstat

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions