<?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: PROC Transpose missing values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-Transpose-missing-values/m-p/450155#M113347</link>
    <description>&lt;P&gt;I have experienced similar problem in the past. What you have to do&amp;nbsp; prior to transpose is to set the missing value to let us say 999 so that you dont have a blank space for missing data point. You can easily do this by&amp;nbsp; using array so that it would fill all missing values across all the variables with 999 if that is the code you prefer to use as missing. You can't use 999 if any of your real data value has 999. Then you can now transpose. After transposing, replace all 999 back to missing value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Moshood&lt;/P&gt;</description>
    <pubDate>Sat, 31 Mar 2018 15:46:15 GMT</pubDate>
    <dc:creator>mbakare</dc:creator>
    <dc:date>2018-03-31T15:46:15Z</dc:date>
    <item>
      <title>PROC Transpose missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-Transpose-missing-values/m-p/450136#M113339</link>
      <description>&lt;P&gt;I'm attempting to transpose data to create a single instance for each primary key.&amp;nbsp; The problem is some of the data items are missing so when I transpose the data the missing values are filled with the next observation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a subset of the data (it's in text format).&amp;nbsp; The first CompanyID has no missing codes, the second Company ID has codes missing (e.g., data for code 14)&lt;/P&gt;&lt;P&gt;CompanyID | DataID | Value&lt;/P&gt;&lt;P&gt;0C000006SR|2|AXM Pharma&lt;BR /&gt;0C000006SR|3|AXM Pharma Inc&lt;BR /&gt;0C000006SR|4|AXM Pharma Inc&lt;BR /&gt;0C000006SR|5|USA&lt;BR /&gt;0C000006SR|6|1113643&lt;BR /&gt;0C000006SR|9|U&lt;BR /&gt;0C000006SR|10|12&lt;BR /&gt;0C000006SR|11|N&lt;/P&gt;&lt;P&gt;0C000006SR|12|0P0000003F&lt;BR /&gt;0C000006SR|13|AXMP&lt;BR /&gt;0C000006SR|14|PINX&lt;BR /&gt;0C000006SR|15|USA&lt;BR /&gt;0C000006SR|16|ENG&lt;BR /&gt;0C000006SR|17|Lopez, Blevins, Bork &amp;amp; Associates&lt;BR /&gt;0C000006SR|18|ENG&lt;BR /&gt;0C000006SR|19|Lopez, Blevins, Bork &amp;amp; Associates&lt;BR /&gt;0C000006SR|20|ENG&lt;BR /&gt;0C000006SR|21|0&lt;BR /&gt;0C000006SR|22|0&lt;BR /&gt;0C000006SR|23|PINX&lt;BR /&gt;0C000006SR|24|1&lt;BR /&gt;0C000006SR|25|1999&lt;BR /&gt;0C000006SR|26|0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;0C000006YV|2|Bodisen Biotech&lt;BR /&gt;0C000006YV|3|Bodisen Biotech Inc&lt;BR /&gt;0C000006YV|4|Bodisen Biotech Inc&lt;BR /&gt;0C000006YV|5|USA&lt;BR /&gt;0C000006YV|6|1178552&lt;BR /&gt;0C000006YV|9|U&lt;BR /&gt;0C000006YV|10|12&lt;BR /&gt;0C000006YV|11|N&lt;BR /&gt;0C000006YV|12|0P000000TS&lt;BR /&gt;0C000006YV|13|BBCZ&lt;BR /&gt;0C000006YV|15|CHN&lt;BR /&gt;0C000006YV|16|ENG&lt;BR /&gt;0C000006YV|17|Clement C. W. Chan &amp;amp; Co&lt;BR /&gt;0C000006YV|18|ENG&lt;BR /&gt;0C000006YV|19|Clement C. W. Chan &amp;amp; Co&lt;BR /&gt;0C000006YV|20|ENG&lt;BR /&gt;0C000006YV|21|0&lt;BR /&gt;0C000006YV|22|0&lt;BR /&gt;0C000006YV|24|1&lt;BR /&gt;0C000006YV|25|2000&lt;BR /&gt;0C000006YV|26|0&lt;BR /&gt;0C000006YV|27|2013-12-31&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The 2nd set of data is missing DataID 14 so it moves data item 15 into that location.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data=sashelp out=need; by companyid DataID;&lt;BR /&gt;proc transpose data=need out=want;&lt;BR /&gt;by companyid ;&lt;BR /&gt;var value;&lt;BR /&gt;proc print; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output is attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 31 Mar 2018 14:32:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-Transpose-missing-values/m-p/450136#M113339</guid>
      <dc:creator>jbighitter</dc:creator>
      <dc:date>2018-03-31T14:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Transpose missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-Transpose-missing-values/m-p/450139#M113342</link>
      <description>&lt;P&gt;Sounds like you want to include an ID variable and possibly a prefix. e.g.:&lt;/P&gt;
&lt;PRE&gt;proc transpose data=need prefix=ID_ out=want;
  by companyid ;
  var value;
  id DataID;
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 31 Mar 2018 14:50:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-Transpose-missing-values/m-p/450139#M113342</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-03-31T14:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Transpose missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-Transpose-missing-values/m-p/450155#M113347</link>
      <description>&lt;P&gt;I have experienced similar problem in the past. What you have to do&amp;nbsp; prior to transpose is to set the missing value to let us say 999 so that you dont have a blank space for missing data point. You can easily do this by&amp;nbsp; using array so that it would fill all missing values across all the variables with 999 if that is the code you prefer to use as missing. You can't use 999 if any of your real data value has 999. Then you can now transpose. After transposing, replace all 999 back to missing value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Moshood&lt;/P&gt;</description>
      <pubDate>Sat, 31 Mar 2018 15:46:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-Transpose-missing-values/m-p/450155#M113347</guid>
      <dc:creator>mbakare</dc:creator>
      <dc:date>2018-03-31T15:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Transpose missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-Transpose-missing-values/m-p/450165#M113352</link>
      <description>&lt;P&gt;Thanks!&amp;nbsp; Works great.&amp;nbsp; I was hoping for a simple solution and your's surely was.&lt;/P&gt;</description>
      <pubDate>Sat, 31 Mar 2018 17:30:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-Transpose-missing-values/m-p/450165#M113352</guid>
      <dc:creator>jbighitter</dc:creator>
      <dc:date>2018-03-31T17:30:10Z</dc:date>
    </item>
  </channel>
</rss>

