<?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 to add before the value in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-before-the-value/m-p/855479#M37693</link>
    <description>&lt;P&gt;Data set have :&lt;/P&gt;&lt;P&gt;id&amp;nbsp;&lt;/P&gt;&lt;P&gt;PBVS1&lt;/P&gt;&lt;P&gt;PBVS2&amp;nbsp;&lt;/P&gt;&lt;P&gt;PBVS3&lt;/P&gt;&lt;P&gt;PBVS4&lt;/P&gt;&lt;P&gt;PBVS5&lt;/P&gt;&lt;P&gt;PBVS6&lt;/P&gt;&lt;P&gt;PBVS7&lt;/P&gt;&lt;P&gt;PBVS7A&lt;/P&gt;&lt;P&gt;PBVSTOT1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want data :&lt;/P&gt;&lt;P&gt;id&lt;/P&gt;&lt;P&gt;PBVS101&lt;/P&gt;&lt;P&gt;PBVS102&lt;/P&gt;&lt;P&gt;PBVS103&lt;/P&gt;&lt;P&gt;PBVS104&lt;/P&gt;&lt;P&gt;PBVS105&lt;/P&gt;&lt;P&gt;PBVS106&lt;/P&gt;&lt;P&gt;PBVS107&lt;/P&gt;&lt;P&gt;PBVS107A&lt;/P&gt;&lt;P&gt;PBVS111&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Jan 2023 21:51:01 GMT</pubDate>
    <dc:creator>sasuser143</dc:creator>
    <dc:date>2023-01-24T21:51:01Z</dc:date>
    <item>
      <title>How to add before the value</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-before-the-value/m-p/855479#M37693</link>
      <description>&lt;P&gt;Data set have :&lt;/P&gt;&lt;P&gt;id&amp;nbsp;&lt;/P&gt;&lt;P&gt;PBVS1&lt;/P&gt;&lt;P&gt;PBVS2&amp;nbsp;&lt;/P&gt;&lt;P&gt;PBVS3&lt;/P&gt;&lt;P&gt;PBVS4&lt;/P&gt;&lt;P&gt;PBVS5&lt;/P&gt;&lt;P&gt;PBVS6&lt;/P&gt;&lt;P&gt;PBVS7&lt;/P&gt;&lt;P&gt;PBVS7A&lt;/P&gt;&lt;P&gt;PBVSTOT1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want data :&lt;/P&gt;&lt;P&gt;id&lt;/P&gt;&lt;P&gt;PBVS101&lt;/P&gt;&lt;P&gt;PBVS102&lt;/P&gt;&lt;P&gt;PBVS103&lt;/P&gt;&lt;P&gt;PBVS104&lt;/P&gt;&lt;P&gt;PBVS105&lt;/P&gt;&lt;P&gt;PBVS106&lt;/P&gt;&lt;P&gt;PBVS107&lt;/P&gt;&lt;P&gt;PBVS107A&lt;/P&gt;&lt;P&gt;PBVS111&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 21:51:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-before-the-value/m-p/855479#M37693</guid>
      <dc:creator>sasuser143</dc:creator>
      <dc:date>2023-01-24T21:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to add before the value</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-before-the-value/m-p/855486#M37696</link>
      <description>&lt;P&gt;Is there a generic rule that can be applied to know that PBVSTOT1 should become PBVS111?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This works for the shown data but you may need to provide some RULES if any other values are involved.&lt;/P&gt;
&lt;P&gt;Note the use of a data step to provide example data. That is what you should do to set the properties of YOUR variables to be correct for your problem.&lt;/P&gt;
&lt;PRE&gt;Data have ;
   input id $ ;/* note this defaults to 8 character length*/
datalines;
PBVS1
PBVS2 
PBVS3
PBVS4
PBVS5
PBVS6
PBVS7
PBVS7A
PBVSTOT1
;


data want;
   set have;
   if index(id,'TOT')&amp;gt;0 then Id='PBVS111';
   else id = tranwrd(id,'PBVS','PBVS10');
run;&lt;/PRE&gt;
&lt;P&gt;The Tranwrd function will replace in the value of the first parameter&amp;nbsp; the first group of characters , i.e. a word, with another .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 22:20:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-before-the-value/m-p/855486#M37696</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-01-24T22:20:36Z</dc:date>
    </item>
  </channel>
</rss>

