<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SAS format to Stata in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SAS-format-to-Stata/m-p/306681#M61039</link>
    <description>&lt;P&gt;Looks like your code is correct. Have you confirmed that your SURVEY dataset has the required formats defined on the columns prior to exporting? Also that your FORMATS catalog actually contains the formats - you can use proc format with the FMTLIB option for this.&lt;/P&gt;</description>
    <pubDate>Mon, 24 Oct 2016 03:36:13 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2016-10-24T03:36:13Z</dc:date>
    <item>
      <title>SAS format to Stata</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-format-to-Stata/m-p/306533#M61030</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm trying to convert my SAS dataset to Stata using the export procedure.&lt;/P&gt;
&lt;P&gt;I have a dataset called 'survey' which I can successully export to Stata.&lt;/P&gt;
&lt;P&gt;The resulting Stata file has the proper variable label. However, the formats does not carry over to the Stata dataset.&lt;/P&gt;
&lt;P&gt;For example, a SAS variable 'sex' should have the format 1='Male, 2='Female'. The Stata dataset value label for sex&amp;nbsp;is just '1' and '2'. I would preper that I don't have to code all the values in Stata.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the export code i used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;libname data&amp;nbsp;'C:\data\';&lt;BR /&gt;libname library 'C:\Data\Formats';&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc export data=data.survey&lt;BR /&gt;file="C:\data\stata\survey"&lt;BR /&gt;dbms=STATA&lt;BR /&gt;replace;&lt;BR /&gt;fmtlib=library;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for any guidance'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--Tim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2016 07:41:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-format-to-Stata/m-p/306533#M61030</guid>
      <dc:creator>tallkell</dc:creator>
      <dc:date>2016-10-22T07:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: SAS format to Stata</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-format-to-Stata/m-p/306681#M61039</link>
      <description>&lt;P&gt;Looks like your code is correct. Have you confirmed that your SURVEY dataset has the required formats defined on the columns prior to exporting? Also that your FORMATS catalog actually contains the formats - you can use proc format with the FMTLIB option for this.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 03:36:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-format-to-Stata/m-p/306681#M61039</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-10-24T03:36:13Z</dc:date>
    </item>
  </channel>
</rss>

