<?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: transposing/changing format of data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/transposing-changing-format-of-data/m-p/743226#M232641</link>
    <description>&lt;P&gt;Fantastic, thanks!&lt;/P&gt;</description>
    <pubDate>Sun, 23 May 2021 14:33:05 GMT</pubDate>
    <dc:creator>sasprogramming</dc:creator>
    <dc:date>2021-05-23T14:33:05Z</dc:date>
    <item>
      <title>transposing/changing format of data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/transposing-changing-format-of-data/m-p/743223#M232639</link>
      <description>&lt;DIV id="tinyMceEditorsasprogramming_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;I am having trouble converting my 'have' data to my 'want' data type. I have tried a few tranpose functions but I just can't seem to get it working&lt;/P&gt;
&lt;P&gt;have:&lt;/P&gt;
&lt;DIV id="tinyMceEditorsasprogramming_1" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="tinyMceEditorsasprogramming_2" class="mceNonEditable lia-copypaste-placeholder"&gt;&lt;IMG src="https://i.stack.imgur.com/Tp2UF.png" border="0" /&gt;&lt;/DIV&gt;
&lt;P&gt;want:&lt;/P&gt;
&lt;TABLE width="552"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="120"&gt;DATE&lt;/TD&gt;
&lt;TD width="72"&gt;missing&lt;/TD&gt;
&lt;TD width="72"&gt;low&lt;/TD&gt;
&lt;TD width="72"&gt;low medium&lt;/TD&gt;
&lt;TD width="72"&gt;average&lt;/TD&gt;
&lt;TD width="72"&gt;high&lt;/TD&gt;
&lt;TD width="72"&gt;excellent&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2019-04&lt;/TD&gt;
&lt;TD&gt;228221&lt;/TD&gt;
&lt;TD&gt;3168&lt;/TD&gt;
&lt;TD&gt;807&lt;/TD&gt;
&lt;TD&gt;640&lt;/TD&gt;
&lt;TD&gt;1880&lt;/TD&gt;
&lt;TD&gt;1880&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2019-05&lt;/TD&gt;
&lt;TD&gt;3120&lt;/TD&gt;
&lt;TD&gt;230281&lt;/TD&gt;
&lt;TD&gt;2626&lt;/TD&gt;
&lt;TD&gt;845&lt;/TD&gt;
&lt;TD&gt;519&lt;/TD&gt;
&lt;TD&gt;1931&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 May 2021 14:23:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/transposing-changing-format-of-data/m-p/743223#M232639</guid>
      <dc:creator>sasprogramming</dc:creator>
      <dc:date>2021-05-23T14:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: transposing/changing format of data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/transposing-changing-format-of-data/m-p/743225#M232640</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose
  data=have
  out=want (drop=_name_)
;
by date;
id income;
var count;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Post the log if it throws WARNINGs or ERRORs. You may have to change "low medium" to "low_medium" first to get a valid SAS name.&lt;/P&gt;
&lt;P&gt;If this is for reporting purposes, use PROC REPORT and income as a ACROSS variable.&lt;/P&gt;</description>
      <pubDate>Sun, 23 May 2021 14:28:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/transposing-changing-format-of-data/m-p/743225#M232640</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-05-23T14:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: transposing/changing format of data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/transposing-changing-format-of-data/m-p/743226#M232641</link>
      <description>&lt;P&gt;Fantastic, thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 23 May 2021 14:33:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/transposing-changing-format-of-data/m-p/743226#M232641</guid>
      <dc:creator>sasprogramming</dc:creator>
      <dc:date>2021-05-23T14:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: transposing/changing format of data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/transposing-changing-format-of-data/m-p/743228#M232643</link>
      <description>WARNING: 25 observations omitted due to missing ID values.&lt;BR /&gt;How do I keep the missing row?</description>
      <pubDate>Sun, 23 May 2021 14:47:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/transposing-changing-format-of-data/m-p/743228#M232643</guid>
      <dc:creator>sasprogramming</dc:creator>
      <dc:date>2021-05-23T14:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: transposing/changing format of data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/transposing-changing-format-of-data/m-p/743229#M232644</link>
      <description>&lt;P&gt;You need to search for the observations with missing income, and decide which value to set there.&lt;/P&gt;</description>
      <pubDate>Sun, 23 May 2021 14:55:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/transposing-changing-format-of-data/m-p/743229#M232644</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-05-23T14:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: transposing/changing format of data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/transposing-changing-format-of-data/m-p/743231#M232645</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sasprogramming_0-1621781919757.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59692i1F7FE4CEC78CDD49/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sasprogramming_0-1621781919757.png" alt="sasprogramming_0-1621781919757.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;missing values, show up as ".", is there a way I can include them in the transpose? since I want to keep them&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 May 2021 14:59:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/transposing-changing-format-of-data/m-p/743231#M232645</guid>
      <dc:creator>sasprogramming</dc:creator>
      <dc:date>2021-05-23T14:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: transposing/changing format of data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/transposing-changing-format-of-data/m-p/743232#M232646</link>
      <description>&lt;P&gt;So it looks that this is in fact a numeric variable with a custom format that does not cover missing values.&lt;/P&gt;
&lt;P&gt;Change your preceding code so that it does not generate these missing values, or expand the format with a display value for missing.&lt;/P&gt;</description>
      <pubDate>Sun, 23 May 2021 15:05:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/transposing-changing-format-of-data/m-p/743232#M232646</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-05-23T15:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: transposing/changing format of data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/transposing-changing-format-of-data/m-p/743235#M232649</link>
      <description>&lt;DIV class="sasSource"&gt;can't seem to get it working...&lt;/DIV&gt;
&lt;PRE&gt;
 73         proc format;
 74         value income_fmt
 75         . = "missing"
 76               low   -&amp;lt;  0 = "low"
 77               1 -&amp;lt;  30 = "low-medium"
 78               30 -&amp;lt;  60 = "average"
 79               60 -&amp;lt; 90 = "high"
 80              90 - high = "excellent";
 81         run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;
&lt;DIV class="sasSource"&gt;This creates the missing values, however when I tranpose my data it still loses these?&lt;/DIV&gt;</description>
      <pubDate>Sun, 23 May 2021 15:44:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/transposing-changing-format-of-data/m-p/743235#M232649</guid>
      <dc:creator>sasprogramming</dc:creator>
      <dc:date>2021-05-23T15:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: transposing/changing format of data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/transposing-changing-format-of-data/m-p/743294#M232685</link>
      <description>&lt;P&gt;Use the format to make a CHARACTER variable you can use to name the variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data step1 ;
  set have;
  name = put(income,income_fmt.);
run;
proc transpose data=step1 out=want ;
  by date;
  id name ;
  var count;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 May 2021 03:40:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/transposing-changing-format-of-data/m-p/743294#M232685</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-05-24T03:40:18Z</dc:date>
    </item>
  </channel>
</rss>

