<?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 Transpose data for two columns based on two sectors in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Transpose-data-for-two-columns-based-on-two-sectors/m-p/846340#M334594</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;The below test data contain information of two sectors (emea, fda).&lt;BR /&gt;I want to isolate the datasets for &lt;STRONG&gt;score and event&lt;/STRONG&gt; variable based on individual sectors (value for col E-F as '&lt;STRONG&gt;emea'&lt;/STRONG&gt;, newly added col G-H as '&lt;STRONG&gt;fda'&lt;/STRONG&gt;)&lt;/P&gt;
&lt;P&gt;e.g. for record 3, 6,7,8 --&amp;gt; value populated from E-F where as blank for G-H&lt;BR /&gt;for record 4,5 --&amp;gt; value populated from G-H where as blank for E-F&lt;/P&gt;
&lt;P&gt;Can you please help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data test;
  input pid age gender race event2 $ &lt;STRONG&gt;sector&lt;/STRONG&gt; $ score;
cards;
101 21 1 1 fever EMEA 25
102 21 2 2 pain FDA 45 
103 31 1 3 headac FDA 54
104 43 2 4 joint EMEA 66
105 43 2 5 cold EMEA 100
106 75 2 6 anemia EMEA 232
;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Expected output&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="123.png" style="width: 772px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77711i4C32B98C43D8B7E2/image-size/large?v=v2&amp;amp;px=999" role="button" title="123.png" alt="123.png" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Nov 2022 15:48:35 GMT</pubDate>
    <dc:creator>abraham1</dc:creator>
    <dc:date>2022-11-25T15:48:35Z</dc:date>
    <item>
      <title>Transpose data for two columns based on two sectors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose-data-for-two-columns-based-on-two-sectors/m-p/846340#M334594</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;The below test data contain information of two sectors (emea, fda).&lt;BR /&gt;I want to isolate the datasets for &lt;STRONG&gt;score and event&lt;/STRONG&gt; variable based on individual sectors (value for col E-F as '&lt;STRONG&gt;emea'&lt;/STRONG&gt;, newly added col G-H as '&lt;STRONG&gt;fda'&lt;/STRONG&gt;)&lt;/P&gt;
&lt;P&gt;e.g. for record 3, 6,7,8 --&amp;gt; value populated from E-F where as blank for G-H&lt;BR /&gt;for record 4,5 --&amp;gt; value populated from G-H where as blank for E-F&lt;/P&gt;
&lt;P&gt;Can you please help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data test;
  input pid age gender race event2 $ &lt;STRONG&gt;sector&lt;/STRONG&gt; $ score;
cards;
101 21 1 1 fever EMEA 25
102 21 2 2 pain FDA 45 
103 31 1 3 headac FDA 54
104 43 2 4 joint EMEA 66
105 43 2 5 cold EMEA 100
106 75 2 6 anemia EMEA 232
;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Expected output&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="123.png" style="width: 772px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77711i4C32B98C43D8B7E2/image-size/large?v=v2&amp;amp;px=999" role="button" title="123.png" alt="123.png" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2022 15:48:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose-data-for-two-columns-based-on-two-sectors/m-p/846340#M334594</guid>
      <dc:creator>abraham1</dc:creator>
      <dc:date>2022-11-25T15:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose data for two columns based on two sectors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose-data-for-two-columns-based-on-two-sectors/m-p/846356#M334598</link>
      <description>&lt;P&gt;You can produce that report without changing the dataset.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=test;
column pid age gender race sector,(event2 score);
define pid / group;
define age/group;
define gender/group;
define race/group;
define sector/across;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1669396458434.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77720iE23466A75353E23E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_0-1669396458434.png" alt="Tom_0-1669396458434.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2022 17:14:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose-data-for-two-columns-based-on-two-sectors/m-p/846356#M334598</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-11-25T17:14:24Z</dc:date>
    </item>
  </channel>
</rss>

