<?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: Inserting value in new column based on existing value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Inserting-value-in-new-column-based-on-existing-value/m-p/474583#M121952</link>
    <description>&lt;P&gt;Proc Transpose will handle this generally:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc transpose data=have
     out=want;
by name;
var plannum;
id PlanType;
run;&lt;/PRE&gt;
&lt;P&gt;If you data isn't sorted by the name you either should sort the data or use By NOTSORTED &amp;nbsp;name.&lt;/P&gt;
&lt;P&gt;If you really want the variables to end with _NUM then you can add a Suffix='_num' to the proc statement.&lt;/P&gt;
&lt;P&gt;If plan type is duplicated per name though there'll be errors.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jun 2018 20:44:35 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-06-29T20:44:35Z</dc:date>
    <item>
      <title>Inserting value in new column based on existing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-value-in-new-column-based-on-existing-value/m-p/474580#M121951</link>
      <description>&lt;P&gt;I'd like to transform table from :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Name&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;PlanType&amp;nbsp; &amp;nbsp; &amp;nbsp;PlanNum&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;David&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PlanA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10101&lt;/P&gt;&lt;P&gt;David&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PlanB&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20202&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;David&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PlanC&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 30303&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Name&amp;nbsp; &amp;nbsp; PlanA_Num&amp;nbsp; &amp;nbsp; &amp;nbsp;PlanB_Num&amp;nbsp; &amp;nbsp;PlanC_Num&lt;/P&gt;&lt;P&gt;David&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10101&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20202&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30303&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any thoughts? using proc sql; or data steps..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 20:38:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-value-in-new-column-based-on-existing-value/m-p/474580#M121951</guid>
      <dc:creator>BrighterWay</dc:creator>
      <dc:date>2018-06-29T20:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting value in new column based on existing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-value-in-new-column-based-on-existing-value/m-p/474583#M121952</link>
      <description>&lt;P&gt;Proc Transpose will handle this generally:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc transpose data=have
     out=want;
by name;
var plannum;
id PlanType;
run;&lt;/PRE&gt;
&lt;P&gt;If you data isn't sorted by the name you either should sort the data or use By NOTSORTED &amp;nbsp;name.&lt;/P&gt;
&lt;P&gt;If you really want the variables to end with _NUM then you can add a Suffix='_num' to the proc statement.&lt;/P&gt;
&lt;P&gt;If plan type is duplicated per name though there'll be errors.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 20:44:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-value-in-new-column-based-on-existing-value/m-p/474583#M121952</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-06-29T20:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting value in new column based on existing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-value-in-new-column-based-on-existing-value/m-p/474584#M121953</link>
      <description>&lt;P&gt;PROC TRANSPOSE&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/218512"&gt;@BrighterWay&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'd like to transform table from :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Name&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;PlanType&amp;nbsp; &amp;nbsp; &amp;nbsp;PlanNum&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;David&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PlanA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10101&lt;/P&gt;
&lt;P&gt;David&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PlanB&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20202&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;David&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PlanC&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 30303&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Name&amp;nbsp; &amp;nbsp; PlanA_Num&amp;nbsp; &amp;nbsp; &amp;nbsp;PlanB_Num&amp;nbsp; &amp;nbsp;PlanC_Num&lt;/P&gt;
&lt;P&gt;David&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10101&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20202&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30303&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;any thoughts? using proc sql; or data steps..&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 20:41:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-value-in-new-column-based-on-existing-value/m-p/474584#M121953</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-06-29T20:41:45Z</dc:date>
    </item>
  </channel>
</rss>

