<?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 How can I convert the value to be a part of a column with EG 5.1(change the Table structure) in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-the-value-to-be-a-part-of-a-column-with-EG-5-1/m-p/144212#M11469</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got stuck with a request, need to convert the value to be a part of a column, I knew there is a functionality named 'Transpose' which allows user to convert a value into a column.&lt;/P&gt;&lt;P&gt;But this time I might need to merge one particular value with some columns in the table. let me give u the example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the original table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 470px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="64"&gt;ID&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;Status&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="104"&gt;Parameter1&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="131"&gt;Parameter2&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="107"&gt;Parameter3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;"&gt;10023&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;AFH2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;2.1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;50.1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;"&gt;10023&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;AFH1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;3.3&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;78.2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;77&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And here is the target table I wanted&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="835"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="64"&gt;ID&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="176"&gt;Parameter1_AFH2&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="119"&gt;Parameter2_AFH2&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="119"&gt;Parameter3_AFH2&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="119"&gt;Parameter1_AFH1&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="119"&gt;Parameter2_AFH1&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="119"&gt;Parameter3_AFH1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;"&gt;10023&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;2.1&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;50.1&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;30&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;3.3&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;78.2&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;77&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you saw, the purse is to exclude the duplicated rows. Does anyone know how to convert the structure like this ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Dec 2014 10:01:39 GMT</pubDate>
    <dc:creator>Daree</dc:creator>
    <dc:date>2014-12-10T10:01:39Z</dc:date>
    <item>
      <title>How can I convert the value to be a part of a column with EG 5.1(change the Table structure)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-the-value-to-be-a-part-of-a-column-with-EG-5-1/m-p/144212#M11469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got stuck with a request, need to convert the value to be a part of a column, I knew there is a functionality named 'Transpose' which allows user to convert a value into a column.&lt;/P&gt;&lt;P&gt;But this time I might need to merge one particular value with some columns in the table. let me give u the example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the original table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 470px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="64"&gt;ID&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;Status&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="104"&gt;Parameter1&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="131"&gt;Parameter2&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="107"&gt;Parameter3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;"&gt;10023&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;AFH2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;2.1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;50.1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;"&gt;10023&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;AFH1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;3.3&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;78.2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;77&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And here is the target table I wanted&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="835"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="64"&gt;ID&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="176"&gt;Parameter1_AFH2&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="119"&gt;Parameter2_AFH2&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="119"&gt;Parameter3_AFH2&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="119"&gt;Parameter1_AFH1&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="119"&gt;Parameter2_AFH1&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="119"&gt;Parameter3_AFH1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;"&gt;10023&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;2.1&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;50.1&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;30&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;3.3&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;78.2&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;77&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you saw, the purse is to exclude the duplicated rows. Does anyone know how to convert the structure like this ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 10:01:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-the-value-to-be-a-part-of-a-column-with-EG-5-1/m-p/144212#M11469</guid>
      <dc:creator>Daree</dc:creator>
      <dc:date>2014-12-10T10:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: How can I convert the value to be a part of a column with EG 5.1(change the Table structure)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-the-value-to-be-a-part-of-a-column-with-EG-5-1/m-p/144213#M11470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well, my first question would be why do you want to have variables like that.&amp;nbsp; As your data expands you could end up with hundreds of them.&lt;/P&gt;&lt;P&gt;Anyways, the way I would go about it is to first normalize your data:&lt;/P&gt;&lt;P&gt;data inter (keep=id status param res);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array parameter{3};&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Note you could find this number 3 from max from sashelp.vcolumn */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do I=1 to3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param=I;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; res=param{I};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You now have a table which looks like:&lt;/P&gt;&lt;P&gt;id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; status&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; res;&lt;/P&gt;&lt;P&gt;10023&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AFH2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.1&lt;/P&gt;&lt;P&gt;10023&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AFH2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 50.1&lt;/P&gt;&lt;P&gt;10023&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AFH2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Me, I would stop at that point as you can then do most functions grouping by id, status, param.&amp;nbsp; However, you can take it one level higher I suppose by:&lt;/P&gt;&lt;P&gt;data inter;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set inter;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length tran_val $50;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tran_val="Parameter_"||strip(put(param,best.))||"_"||strip(status);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc transpose data=inter out=want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var res;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by id;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id tran_val;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; idlabel tran_val;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 10:23:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-the-value-to-be-a-part-of-a-column-with-EG-5-1/m-p/144213#M11470</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-12-10T10:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: How can I convert the value to be a part of a column with EG 5.1(change the Table structure)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-the-value-to-be-a-part-of-a-column-with-EG-5-1/m-p/144214#M11471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your data step with the array needs some attention PARAM can't be array and variable.&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt; &lt;/DIV&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; status;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;infile&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;cards&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;expandtabs&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; (ID&amp;nbsp; Status)($)&amp;nbsp; Parameter1&amp;nbsp; Parameter2&amp;nbsp; Parameter3;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;cards&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffc0;"&gt;10023 AFH2&amp;nbsp; 2.1&amp;nbsp;&amp;nbsp; 50.1&amp;nbsp; 30&lt;BR /&gt;10023 AFH1&amp;nbsp; 3.3&amp;nbsp;&amp;nbsp; 78.2&amp;nbsp; 77&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;;;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; inter (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;keep&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=id status param res);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; status;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; parameter{*} parameter:;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; background-color: #ffffff;"&gt;/* You don't need the three at all if you use a SAS Variable List*/&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; param=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; dim(parameter);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; res=parameter{param};&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;output&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;end&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 12:22:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-the-value-to-be-a-part-of-a-column-with-EG-5-1/m-p/144214#M11471</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-12-10T12:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can I convert the value to be a part of a column with EG 5.1(change the Table structure)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-the-value-to-be-a-part-of-a-column-with-EG-5-1/m-p/144215#M11472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is fairly easy with two transposes and the new features of the ID statement make creating the new variables easier than it used to be.&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; status;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;infile&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;cards&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;expandtabs&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; (ID&amp;nbsp; Status)($)&amp;nbsp; Parameter1&amp;nbsp; Parameter2&amp;nbsp; Parameter3;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;cards&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffc0;"&gt;10023 AFH2&amp;nbsp; 2.1&amp;nbsp;&amp;nbsp; 50.1&amp;nbsp; 30&lt;BR /&gt;10023 AFH1&amp;nbsp; 3.3&amp;nbsp;&amp;nbsp; 78.2&amp;nbsp; 77&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;;;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;transpose&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=step1;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; id status &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;notsorted&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; parameter:;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;print&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;transpose&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=step2(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=_name_) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;delim&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=_;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; id;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; col1;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;id&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; _name_ status;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;print&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;IMG alt="12-10-2014 6-29-07 AM.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/8329_12-10-2014 6-29-07 AM.png" width="450" /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 12:30:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-the-value-to-be-a-part-of-a-column-with-EG-5-1/m-p/144215#M11472</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-12-10T12:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: How can I convert the value to be a part of a column with EG 5.1(change the Table structure)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-the-value-to-be-a-part-of-a-column-with-EG-5-1/m-p/144216#M11473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply,RW9. I was trying to make a chart break down the data by several status which requires the id should be uniqe in the table. Thanks again for the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 13:09:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-the-value-to-be-a-part-of-a-column-with-EG-5-1/m-p/144216#M11473</guid>
      <dc:creator>Daree</dc:creator>
      <dc:date>2014-12-10T13:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: How can I convert the value to be a part of a column with EG 5.1(change the Table structure)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-the-value-to-be-a-part-of-a-column-with-EG-5-1/m-p/144217#M11474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro trans (base, vars);&lt;/P&gt;&lt;P&gt;%let i=1;&lt;/P&gt;&lt;P&gt;%do %until(%scan(&amp;amp;vars, &amp;amp;i) = );&lt;/P&gt;&lt;P&gt;proc transpose data=&amp;amp;base out=want&amp;amp;i (drop=_name_) prefix=Parameter&amp;amp;i;&lt;BR /&gt;by id;&lt;BR /&gt;id status;&lt;BR /&gt;var Parameter&amp;amp;i;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%let i=%eval(&amp;amp;i+1);&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;merge want1-want%eval(&amp;amp;i-1);&lt;BR /&gt;by id;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%mend trans;&lt;/P&gt;&lt;P&gt;%trans(have, Parameter1 Parameter2 Parameter3)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 13:11:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-the-value-to-be-a-part-of-a-column-with-EG-5-1/m-p/144217#M11474</guid>
      <dc:creator>Loko</dc:creator>
      <dc:date>2014-12-10T13:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: How can I convert the value to be a part of a column with EG 5.1(change the Table structure)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-the-value-to-be-a-part-of-a-column-with-EG-5-1/m-p/144218#M11475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Really appreciate&amp;nbsp; your help. Have a good day:smileylaugh:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 13:13:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-the-value-to-be-a-part-of-a-column-with-EG-5-1/m-p/144218#M11475</guid>
      <dc:creator>Daree</dc:creator>
      <dc:date>2014-12-10T13:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: How can I convert the value to be a part of a column with EG 5.1(change the Table structure)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-the-value-to-be-a-part-of-a-column-with-EG-5-1/m-p/144219#M11476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But NULL's code is not efficient when you have a big table , and you also need to re-order the variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data status;
&amp;nbsp;&amp;nbsp; infile cards expandtabs; 
&amp;nbsp;&amp;nbsp; input (ID&amp;nbsp; Status)($)&amp;nbsp; Parameter1&amp;nbsp; Parameter2&amp;nbsp; Parameter3;
&amp;nbsp;&amp;nbsp; cards; 
10023 AFH2&amp;nbsp; 2.1&amp;nbsp;&amp;nbsp; 50.1&amp;nbsp; 30
10023 AFH1&amp;nbsp; 3.3&amp;nbsp;&amp;nbsp; 78.2&amp;nbsp; 77
;;;;
&amp;nbsp;&amp;nbsp; run; 

proc sql;
 select distinct 'status(where=(id="'||strip(id)||'" and status="'||strip(status)||'"&amp;nbsp; )
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rename=(Parameter1=Parameter1_'||strip(status)||' 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Parameter2=Parameter2_'||strip(status)||'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Parameter3=Parameter3_'||strip(status)||'))' into : list separated by ' ' from status;
quit;
%put &amp;amp;list ;

data want;
 merge &amp;amp;list ;
 by id;
 drop Status;
run;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Dec 2014 07:54:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-the-value-to-be-a-part-of-a-column-with-EG-5-1/m-p/144219#M11476</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-12-14T07:54:43Z</dc:date>
    </item>
  </channel>
</rss>

