Announcement

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

  • Problem importing SAS formats

    I'm trying to import SAS formats for CDC's Youth Risk Behavior Survey. I have the SAS data set file and format catalog. They work in SAS, but when I try to import them into Stata they bomb.
    My command is:

    import sas using "C:\yrbs\yrbs2019.sas7bdat", bcat("C:\yrbs\formats.sas7bcat") case(lower)

    But I get a series of error messages, even though the SAS formats are legal and work in SAS.

    note: invalid string value for value label H1S, skipped
    note: invalid string value 1 for value label H1S, skipped
    note: invalid string value 2 for value label H1S, skipped
    note: invalid string value 3 for value label H1S, skipped
    note: invalid string value 4 for value label H1S, skipped
    note: invalid string value 5 for value label H1S, skipped
    note: invalid string value 6 for value label H1S, skipped
    note: invalid string value 7 for value label H1S, skipped
    note: no values defined for value label H1S, removed

    Any thoughts on how to fix this?

  • #2
    Without showing us the output of the format catalog, it's hard to say. However, there are several formats in SAS that are simply incompatible with Stata which could be causing the issue. In my experience, when these sorts of formats arise, Stata ignores them and carries on importing the data.

    Off the top of my head, the incompatibilities include:
    1) formatting of numeric values
    2) SAS "picture" formats
    3) labels for values that are otherwise unspecified
    4) labeling value ranges/extrema

    Translating value labels from SAS (or any other software) requires some thought as to how to convey the same information in a way that is sensible within Stata.

    Comment

    Working...
    X