1

Around a year ago, I used the 'haven'-package to import two .sas7bdat files along with their respective .sas7bcat formats and it worked wonderfully.

For some reason, however, it does not any longer even though all the SAS-files incl. format files have remained unchanged since then.

When I try running the code now, R gives me the following error:

Error in df_parse_sas_file(spec_data, spec_cat, encoding = encoding,
  catalog_encoding = catalog_encoding,  :    Failed to parse P:/SAS
  files/formats.sas7bcat: Invalid file, or file has unsupported features.

R and the 'haven'-package have been reinstalled to their newest versions since the first time when it worked, so I imagine that this might be the reason since all the SAS-files and the code remains unchanged.

For this reason, I tried to reinstall the old version of 'haven' but cannot since this apparently requires a manual installation of 'Rtools' which is not allowed on my computer, so I am a bit stuck here.

Any suggestions will be greatly appreciated, thanks.

RobC
  • 16,905
  • 14
  • 51
  • 62
ChrE
  • 13
  • 3
  • If you can find the package you can do a manual installation after downloading it. Not simple but not super difficult either. – Reeza Oct 15 '19 at 15:55

1 Answers1

0

A potential workaround is that the package sas7bdat can also read SAS files. I don't know how much extra work this might involve for you though

You can read in a dataset with the code

read.sas7bdat("filename.sas7bdat")