<?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 exporting text formatted values to STATA in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/exporting-text-formatted-values-to-STATA/m-p/480695#M15003</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value $sex
1="Female"
2="Male"
;
value $ethnic
1="Chinese"
2="Malay"
3-"Indian"
4="Others"
other="Unknown"
;
run;



data dm;
 infile datalines ;
 input pat $ sex $ ethnic $ brthdat : date9.;
 format sex $sex. ethnic $ethnic.;
datalines;
001 1 1 23Jan1970
002 1 2 28Mar1977
003 1 3 31Aug1964
004 1 4 14Feb1967
005 2 1 09Apr1987
006 2 2 12Apr1956
007 2 3 05Dec1990
008 2 4 09Sep1983
009 1 . .
010 2 . .
;
run;

proc print;
format brthdat date9.;
run;

proc export data=work.dm file="c:\dm.dta" dbms=stata replace;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The DTA file is only showing the data values for SEX and ETHNIC variables. How do i export the formatted values to STATA?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Jul 2018 02:52:55 GMT</pubDate>
    <dc:creator>Dennis_K</dc:creator>
    <dc:date>2018-07-24T02:52:55Z</dc:date>
    <item>
      <title>exporting text formatted values to STATA</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/exporting-text-formatted-values-to-STATA/m-p/480695#M15003</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value $sex
1="Female"
2="Male"
;
value $ethnic
1="Chinese"
2="Malay"
3-"Indian"
4="Others"
other="Unknown"
;
run;



data dm;
 infile datalines ;
 input pat $ sex $ ethnic $ brthdat : date9.;
 format sex $sex. ethnic $ethnic.;
datalines;
001 1 1 23Jan1970
002 1 2 28Mar1977
003 1 3 31Aug1964
004 1 4 14Feb1967
005 2 1 09Apr1987
006 2 2 12Apr1956
007 2 3 05Dec1990
008 2 4 09Sep1983
009 1 . .
010 2 . .
;
run;

proc print;
format brthdat date9.;
run;

proc export data=work.dm file="c:\dm.dta" dbms=stata replace;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The DTA file is only showing the data values for SEX and ETHNIC variables. How do i export the formatted values to STATA?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jul 2018 02:52:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/exporting-text-formatted-values-to-STATA/m-p/480695#M15003</guid>
      <dc:creator>Dennis_K</dc:creator>
      <dc:date>2018-07-24T02:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: exporting text formatted values to STATA</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/exporting-text-formatted-values-to-STATA/m-p/480812#M15004</link>
      <description>&lt;P&gt;Easiest would likely be to add variables with the applied format such as:&lt;/P&gt;
&lt;PRE&gt;data dm;
 infile datalines ;
 input pat $ sex $ ethnic $ brthdat : date9.;
 format sex $sex. ethnic $ethnic.;
 sexf= put(sex,$sex.);
 ethnicf=put(ethnic,$ethnic.);
 drop sex ethnic;
datalines;
001 1 1 23Jan1970
002 1 2 28Mar1977
003 1 3 31Aug1964
004 1 4 14Feb1967
005 2 1 09Apr1987
006 2 2 12Apr1956
007 2 3 05Dec1990
008 2 4 09Sep1983
009 1 . .
010 2 . .
;
run;&lt;/PRE&gt;
&lt;P&gt;Another might be to Proc Print the data with the formats applied to a text file (ods listing) and use STATA import tools. I am not familiar with STATA to know if that may be easy or not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc Export doesn't use formats for any of the output destinations that I've ever used.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jul 2018 14:47:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/exporting-text-formatted-values-to-STATA/m-p/480812#M15004</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-07-24T14:47:36Z</dc:date>
    </item>
  </channel>
</rss>

