# Locate an SPSS 'system' file and get info on variables, their labels etc.
ZA5302 <- spss.system.file("Daten/ZA5302_v6-0-0.sav",to.lower=FALSE)
# Convert labels etc. from 'latin1' to the encoding of the current locale.
ZA5302 <- Iconv(ZA5302,from="latin1")
# Write out the codebook
writeLines(as.character(codebook(ZA5302)),
con="ZA5302-cdbk.txt")
# Write out the description of the varialbes (their 'variable labels')
writeLines(as.character(description(ZA5302)),
con="ZA5302-description.txt")
Run the code above in your browser using DataLab