Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Save Stata dataset labels when importing to SAS

    Hello,

    I am currently trying to save a large Stata dataset and then open it in SAS - WITH all the variable labels and value labels in Stata. Whenever I do this just by regularly saving the Stata dataset (File-Save), I lose all labels when I import to SAS. Does anyone know a fix for this? (May be more of SAS question).

    Thanks,
    Clare

  • #2
    This is indeed a SAS question. Your variable labels and value labels are stored with your Stata data within your Stata dataset's .dta file. If SAS can read your data from your Stata dataset, but does not read variable labels and value labels, it's SAS's problem. The SAS/ACCESS® 9.4 Interface to PC Files: Reference, Fourth Edition at the URL below suggests it does import variable labels and value labels.

    https://documentation.sas.com/?docse...n1p81kxwasvg91

    With that said, Stata also supports creating SAS Version 8 transport (XPORT) files, and will create a file SAS commands to create SAS value labels. My recollection is that SAS transport files had their own odd limitations, but perhaps this will be adequate for what you are doing. See
    Code:
    help export sasxport8
    for details.

    And if all else fails, the commercial product StatTransfer can often work wonders.

    Comment

    Working...
    X