<?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 Proc transpose only non-missing in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-only-non-missing/m-p/143844#M38263</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="mtxt"&gt;I have a dataset with 5 variables A, B, C, D and E.&amp;nbsp; A is the primary key ,&amp;nbsp; B and C are numeric variables, D and E are character variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mtxt"&gt;I would like to transpose with A as the by variable in such&amp;nbsp; a way that only non-missing numeric and character variable should be transposed for B,C,D,E. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mtxt"&gt;I am using below code and I am getting period (.) for missing numeric variable in the transposed column.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mtxt"&gt;PROC TRANSPOSE DATA=X OUT=Y&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mtxt"&gt;BY A;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mtxt"&gt;VAR B C D E;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mtxt"&gt;Run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Oct 2014 19:14:08 GMT</pubDate>
    <dc:creator>rakeshvvv</dc:creator>
    <dc:date>2014-10-27T19:14:08Z</dc:date>
    <item>
      <title>Proc transpose only non-missing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-only-non-missing/m-p/143844#M38263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="mtxt"&gt;I have a dataset with 5 variables A, B, C, D and E.&amp;nbsp; A is the primary key ,&amp;nbsp; B and C are numeric variables, D and E are character variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mtxt"&gt;I would like to transpose with A as the by variable in such&amp;nbsp; a way that only non-missing numeric and character variable should be transposed for B,C,D,E. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mtxt"&gt;I am using below code and I am getting period (.) for missing numeric variable in the transposed column.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mtxt"&gt;PROC TRANSPOSE DATA=X OUT=Y&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mtxt"&gt;BY A;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mtxt"&gt;VAR B C D E;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mtxt"&gt;Run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 19:14:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-only-non-missing/m-p/143844#M38263</guid>
      <dc:creator>rakeshvvv</dc:creator>
      <dc:date>2014-10-27T19:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose only non-missing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-only-non-missing/m-p/143845#M38264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Post some example input data and what you want the output to look like.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 19:27:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-only-non-missing/m-p/143845#M38264</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-10-27T19:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose only non-missing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-only-non-missing/m-p/143846#M38265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When both character(D,E)&amp;nbsp; and numeric (B,C) variables are transposed the numeric variables are converted to character using the format associated with the variable.&amp;nbsp; Since standard missing is usually displayed as . you get . in the new character value.&amp;nbsp; Probably . with leading spaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want the missing numeric variables to have blank values after transposing use&lt;/P&gt;&lt;P&gt;OPTIONS MISSING=' ';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then add this.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; OUT=Y&lt;/SPAN&gt;(where=(not missing(col1)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: data _null_&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 19:27:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-only-non-missing/m-p/143846#M38265</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-10-27T19:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose only non-missing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-only-non-missing/m-p/143847#M38266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am posting an example.... my output should look like z dataset instead of y...only non missing should be transposed.....&lt;/P&gt;&lt;P&gt;data x ;&lt;/P&gt;&lt;P&gt;set sashelp.class;&lt;/P&gt;&lt;P&gt;IF _N_ LT 5;&lt;/P&gt;&lt;P&gt;where sex='M';&lt;/P&gt;&lt;P&gt;IF AGE=14 THEN DO;&lt;/P&gt;&lt;P&gt;SEX="";&lt;/P&gt;&lt;P&gt;AGE=.;END;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC TRANSPOSE DATA=X OUT=Y;&lt;/P&gt;&lt;P&gt;BY NAME;&lt;/P&gt;&lt;P&gt;VAR AGE SEX HEIGHT WEIGHT;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA Z;&lt;/P&gt;&lt;P&gt;SET Y;&lt;/P&gt;&lt;P&gt;IF MISSING(COL1) OR COL1='&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .' THEN DELETE;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 19:56:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-only-non-missing/m-p/143847#M38266</guid>
      <dc:creator>rakeshvvv</dc:creator>
      <dc:date>2014-10-27T19:56:21Z</dc:date>
    </item>
  </channel>
</rss>

