<?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: how to split the below word in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234603#M42902</link>
    <description>&lt;P&gt;Thanks. This is coming for me but i want to replace the new values with the old one.&lt;/P&gt;&lt;P&gt;for ex: CGM_HIGH_IG_DUR24_10_0 and ex value for this is 180.2 then it needs to be&amp;nbsp;CGM_HIGH_IG_DUR24_180_2&lt;/P&gt;</description>
    <pubDate>Fri, 13 Nov 2015 13:36:23 GMT</pubDate>
    <dc:creator>vraj1</dc:creator>
    <dc:date>2015-11-13T13:36:23Z</dc:date>
    <item>
      <title>how to split the below word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234573#M42892</link>
      <description>&lt;P&gt;i have a variable called tm. It has character values like "DGM_HIGH_IG_DUR24_10_0" and "CGM_HIGH_IG_DUR24_12_0" and "CGM_LOW_IG_DUR24_3_5".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to extract _10_0 from first and _12_0 and _3_5 from second and third and calculate 10.0*34 and 12.0*34 and 3.5*34 and replace the value with the ealier ones.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me in this please&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 12:12:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234573#M42892</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2015-11-13T12:12:11Z</dc:date>
    </item>
    <item>
      <title>Betreff: how to split the below word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234578#M42893</link>
      <description>&lt;P&gt;Using the functions scan and input:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data work.have;
   length tm $ 30;
   input tm;
   datalines;
DGM_HIGH_IG_DUR24_10_0
CGM_HIGH_IG_DUR24_12_0
CGM_LOW_IG_DUR24_3_5
run;


data work.want;
   set work.have;

   length result 8;

   result = 34 * (input(scan(tm, 2, '_', 'b'), best32.) + input(scan(tm, 1, '_', 'b'), best32.) / 10);
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Nov 2015 12:47:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234578#M42893</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2015-11-13T12:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to split the below word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234579#M42894</link>
      <description>&lt;P&gt;Please try&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
len=length(tm);
ex=input(tranwrd(substr(tm,len-3),'_','.'),best.)*34;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Nov 2015 12:46:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234579#M42894</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2015-11-13T12:46:31Z</dc:date>
    </item>
    <item>
      <title>Betreff: how to split the below word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234581#M42895</link>
      <description>&lt;P&gt;Thanks a lot &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can i replace the new values i.e result values with the old ones for example if i get 180.2 i need to replace it&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DGM_HIGH_IG_DUR24_180_2&lt;BR /&gt;&lt;BR /&gt;How can i do that please?&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 12:50:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234581#M42895</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2015-11-13T12:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to split the below word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234584#M42896</link>
      <description>&lt;P&gt;Why are you keeping all your data in one variable to start with? &amp;nbsp;A dataset which looks like this:&lt;/P&gt;
&lt;P&gt;TM &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;TEST FLAG GROUP DURATION TIME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;DGM_HIGH_IG_DUR24_10_0 DMG &amp;nbsp;H &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IG &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;24 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10:00&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I.e. keep your variable, but split it up into relevant variables, this would be far easier for you to work with. &amp;nbsp;You can split it up simply by a do loop and a scan based of the index variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 13:03:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234584#M42896</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-11-13T13:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to split the below word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234591#M42897</link>
      <description>&lt;P&gt;Please try the below which&lt;CODE&gt; will work&amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;data want; set have; len=length(tm); ex=input(tranwrd(prxchange('s/^\_//',1,substr(x,len-3)),'_','.'),best.)*34; run;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 13:13:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234591#M42897</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2015-11-13T13:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to split the below word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234593#M42899</link>
      <description>&lt;P&gt;it is not working.&lt;/P&gt;&lt;P&gt;Variable x is uninitialized.&lt;BR /&gt;NOTE: Invalid second argument to function SUBSTR at line 1&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 13:16:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234593#M42899</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2015-11-13T13:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to split the below word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234599#M42900</link>
      <description>&lt;P&gt;Sorry&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want; 
set have; 
len=length(tm); 
ex=input(tranwrd(prxchange('s/^\_//',1,substr(tm,len-3)),'_','.'),best.)*34; 
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Nov 2015 13:29:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234599#M42900</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2015-11-13T13:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to split the below word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234601#M42901</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   length tm $ 30;
   input tm;
   val=34*(input(prxchange('s/.*_(\d+)_(\d)$/$1.$2/',-1,strip(tm)),best12.));
   datalines;
DGM_HIGH_IG_DUR24_10_0
CGM_HIGH_IG_DUR24_12_0
CGM_LOW_IG_DUR24_3_5
DGM_HIGH_IG_DUR24_180_2
run;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Nov 2015 13:32:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234601#M42901</guid>
      <dc:creator>slchen</dc:creator>
      <dc:date>2015-11-13T13:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to split the below word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234603#M42902</link>
      <description>&lt;P&gt;Thanks. This is coming for me but i want to replace the new values with the old one.&lt;/P&gt;&lt;P&gt;for ex: CGM_HIGH_IG_DUR24_10_0 and ex value for this is 180.2 then it needs to be&amp;nbsp;CGM_HIGH_IG_DUR24_180_2&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 13:36:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234603#M42902</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2015-11-13T13:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to split the below word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234604#M42903</link>
      <description>Could you please explain what you mean by the earliest value like if you see the earliest values from 10*34, 12*34 and 3.5*34 is 119 which is from 3.5*34. There is a confusion here to understand the earliest value</description>
      <pubDate>Fri, 13 Nov 2015 13:41:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234604#M42903</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2015-11-13T13:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to split the below word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234605#M42904</link>
      <description>&lt;P&gt;Thanks, But i want to replace the values coming from val to the tm.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 13:42:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234605#M42904</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2015-11-13T13:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to split the below word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234606#M42905</link>
      <description>&lt;P&gt;yes for example i have a value in tmp called&amp;nbsp;&lt;SPAN&gt;CGM_HIGH_IG_DUR24_10_0 and after calculation i.e 10.0*18=180.0 then i need to replace&amp;nbsp;CGM_HIGH_IG_DUR24_10_0 to&amp;nbsp;CGM_HIGH_IG_DUR24_180_0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope you got it&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 13:45:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234606#M42905</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2015-11-13T13:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to split the below word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234607#M42906</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
length ex2 $50;
tm="CGM_HIGH_IG_DUR24_182_0";
len=length(tm);
ex='_'||strip(put(input(tranwrd(substr(tm,prxmatch('m/\_\d/',tm)+1),'_','.'),best.)*34,best.))||'_0';
ex2=cats(prxchange('s/\_\d*\_\d//',1,tm),ex);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Nov 2015 13:50:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234607#M42906</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2015-11-13T13:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to split the below word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234609#M42908</link>
      <description>yes thank you i tried the same, hope it will help you</description>
      <pubDate>Fri, 13 Nov 2015 13:51:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234609#M42908</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2015-11-13T13:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to split the below word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234611#M42909</link>
      <description>&lt;P&gt;Here there is a small catch. if the value is &amp;nbsp;132.6 then it should come as 132_6 but we are getting&amp;nbsp;CGM_LOW_IG_DUR24_132.6_0&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 13:55:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234611#M42909</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2015-11-13T13:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to split the below word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234613#M42910</link>
      <description>&lt;P&gt;ok i understood, please try&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
length ex2 $50;
tm="CGM_HIGH_IG_DUR24_182_8";
len=length(tm);
dec=scan(put(input(tranwrd(substr(tm,prxmatch('m/\_\d/',tm)+1),'_','.'),best.)*34,best.),2,'.');
if dec=. then ex='_'||strip(put(input(tranwrd(substr(tm,prxmatch('m/\_\d/',tm)+1),'_','.'),best.)*34,best.))||'_0';
else if dec^=. then ex='_'||tranwrd(strip(put(input(tranwrd(substr(tm,prxmatch('m/\_\d/',tm)+1),'_','.'),best.)*34,best.)),'.','_');
ex2=cats(prxchange('s/\_\d*\_\d//',1,tm),ex);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Nov 2015 14:04:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234613#M42910</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2015-11-13T14:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to split the below word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234616#M42911</link>
      <description>&lt;P&gt;Here is a solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input variable $25.;&lt;BR /&gt;cards;&lt;BR /&gt;DGM_HIGH_IG_DUR24_10_0&lt;BR /&gt;CGM_HIGH_IG_DUR24_12_0&lt;BR /&gt;CGM_LOW_IG_DUR24_3_5&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;variable = catx('.',scan(variable,5,'_'),scan(variable,6,'_')) * 34;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 14:14:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234616#M42911</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-11-13T14:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to split the below word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234620#M42912</link>
      <description>&lt;P&gt;Thanks a lot&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 14:35:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234620#M42912</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2015-11-13T14:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to split the below word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234624#M42913</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   length tm $ 30;
   input tm;
   val=prxchange('s/.*_(\d+?.?\d?)_(\d)$/$1.$2/',-1,strip(tm));
   if count(val,'.')&amp;gt;1 then val=prxchange('s/(.*).(\d)$/$1$2/',-1,strip(val));
   val=34*(input(val,best12.));
   datalines;
DGM_HIGH_IG_DUR24_10_0
CGM_HIGH_IG_DUR24_12_0
CGM_LOW_IG_DUR24_3_5
DGM_HIGH_IG_DUR24_180_2
CGM_LOW_IG_DUR24_132.6_0
;
run;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;with CGM_LOW_IG_DUR24_132.6_0 in data set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 14:52:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-split-the-below-word/m-p/234624#M42913</guid>
      <dc:creator>slchen</dc:creator>
      <dc:date>2015-11-13T14:52:23Z</dc:date>
    </item>
  </channel>
</rss>

