Skip to content

SAS doesn't support byte-compress SPSS files #614

@Robert-Krajcik

Description

@Robert-Krajcik

I had a process in place to send R data to SAS by way of an SPSS dataset, using the "inefficient uncompressed format."
With Haven 2.4.0 and above, the data read into SAS is now garbled.

Why wasn't there an option for doing the byte compressed format? Or at least keeping the uncompressed format?
SAS Proc Import cannot read this new format.
This is not something the authors of "The Pragmatic Programmer" would approve of -- blindly making changes to code and having something downstream you are not aware of break.

sample R script:

library(dplyr)
library(haven)

data("iris")
set.seed(34567)
sampl_iris <- iris %>% 
  group_by(Species) %>% 
  slice_sample(n = 5) 

xdir <- "."
write_sav(sampl_iris,file.path(xdir, "irisdata.sav"))

Sample SAS code:

filename sav_file "./irisdata.sav";
proc import out = irisdata
            datafile = sav_file
            dbms = SAV replace;
run;

proc print data=irisdata;
title1 "sample iris data";
run;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions