<?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: Change data format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Change-data-format/m-p/491552#M128936</link>
    <description>&lt;P&gt;Or if you don't want formats:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  length genderc $20;
  if gender=0 then genderc="male";
  if gender=1 then genderc="female";
run;&lt;/PRE&gt;</description>
    <pubDate>Fri, 31 Aug 2018 07:59:20 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-08-31T07:59:20Z</dc:date>
    <item>
      <title>Change data format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-data-format/m-p/491521#M128918</link>
      <description>&lt;P&gt;how we change the format like&amp;nbsp;&lt;/P&gt;&lt;P&gt;gender 0,1&lt;/P&gt;&lt;P&gt;to gender&lt;/P&gt;&lt;P&gt;0=male&lt;/P&gt;&lt;P&gt;1=female&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 05:58:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-data-format/m-p/491521#M128918</guid>
      <dc:creator>akkivsviddu</dc:creator>
      <dc:date>2018-08-31T05:58:55Z</dc:date>
    </item>
    <item>
      <title>format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-data-format/m-p/491525#M128926</link>
      <description>&lt;P&gt;how we change the format&lt;/P&gt;&lt;P&gt;for gender&amp;nbsp;&lt;/P&gt;&lt;P&gt;0=male&lt;/P&gt;&lt;P&gt;1=female&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 06:06:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-data-format/m-p/491525#M128926</guid>
      <dc:creator>akkivsviddu</dc:creator>
      <dc:date>2018-08-31T06:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Change data format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-data-format/m-p/491526#M128927</link>
      <description>&lt;P&gt;It's always a very good idea to provide usable test/example data (in a data step with datalines, see my footnotes for converting existing data to such a step, and how to post it).&lt;/P&gt;
&lt;P&gt;So I have to guess that you have a numeric variable that only contains ones and zeroes.&lt;/P&gt;
&lt;P&gt;Create a value format with proc format:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format lib=work;
value gender
  0 = 'male'
  1 = 'female"
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then you can use that format, eg by assigning in a data step, or with proc print:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=have;
format sex gender.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 Aug 2018 07:20:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-data-format/m-p/491526#M128927</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-31T07:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: Change data format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-data-format/m-p/491536#M128928</link>
      <description>&lt;P&gt;I also merged the double-post.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 07:19:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-data-format/m-p/491536#M128928</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-31T07:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Change data format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-data-format/m-p/491552#M128936</link>
      <description>&lt;P&gt;Or if you don't want formats:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  length genderc $20;
  if gender=0 then genderc="male";
  if gender=1 then genderc="female";
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 Aug 2018 07:59:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-data-format/m-p/491552#M128936</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-08-31T07:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-data-format/m-p/491586#M128959</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;If we take an example of class dataset...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc sql;&lt;BR /&gt;create table class1 as&lt;BR /&gt;Select name,&lt;/P&gt;&lt;P&gt;case when sex='M' then 0 else 1 end as Sex ,&lt;/P&gt;&lt;P&gt;age,height,weight from sashelp.class;&lt;BR /&gt;Quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture1.PNG" style="width: 428px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/22920iC8CB7FB8512D9518/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture1.PNG" alt="Capture1.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture2.PNG" style="width: 414px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/22921i92A33D532DC632AE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture2.PNG" alt="Capture2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And vice versa..&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 10:54:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-data-format/m-p/491586#M128959</guid>
      <dc:creator>divekarcm</dc:creator>
      <dc:date>2018-08-31T10:54:46Z</dc:date>
    </item>
  </channel>
</rss>

