<?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: remove only first leading space in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580490#M164907</link>
    <description>its 15( 100.0) not 15( 100).</description>
    <pubDate>Mon, 12 Aug 2019 09:04:52 GMT</pubDate>
    <dc:creator>Vijay77</dc:creator>
    <dc:date>2019-08-12T09:04:52Z</dc:date>
    <item>
      <title>remove only first leading space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580489#M164906</link>
      <description>&lt;P&gt;Hi i have values like 10( 92.9),12(&amp;nbsp; 1.0), 15( 100),14( 87.7) i have to remove only one leading spaces from each i am using 5.1 format if i use 4.1 i am getting W.D note in log. output like 10(92.9),12( 1.0),15(100),14(87.7).&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 09:03:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580489#M164906</guid>
      <dc:creator>Vijay77</dc:creator>
      <dc:date>2019-08-12T09:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: remove only first leading space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580490#M164907</link>
      <description>its 15( 100.0) not 15( 100).</description>
      <pubDate>Mon, 12 Aug 2019 09:04:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580490#M164907</guid>
      <dc:creator>Vijay77</dc:creator>
      <dc:date>2019-08-12T09:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: remove only first leading space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580492#M164908</link>
      <description>&lt;P&gt;Are these values numeric or character? What numeric value does&amp;nbsp;&lt;SPAN&gt;15( 100.0) represent?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 09:14:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580492#M164908</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-08-12T09:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: remove only first leading space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580494#M164909</link>
      <description>&lt;P&gt;Please try the picture format as below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc format;
picture val (default=8)
low-9.9='009.9)' (prefix='(  ')
10-99.9='009.9)' (prefix='( ')
100-high='009.9)' (prefix='(');
run;

data want;
input cnt pct;
new=cats(put(cnt,best.),put(pct,val.));
cards;
10 92.9
12 1.0 
15 100
14 87.7 
;

proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Aug 2019 09:22:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580494#M164909</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-08-12T09:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: remove only first leading space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580504#M164912</link>
      <description>all values are charcter</description>
      <pubDate>Mon, 12 Aug 2019 09:54:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580504#M164912</guid>
      <dc:creator>Vijay77</dc:creator>
      <dc:date>2019-08-12T09:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: remove only first leading space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580506#M164913</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/277769"&gt;@Vijay77&lt;/a&gt; , the best approach would be to use the picture format on the percentage separately which creates the character percentage and then concatenate the count with character percentage as i showed in my earlier post. &lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 10:00:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580506#M164913</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-08-12T10:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: remove only first leading space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580508#M164915</link>
      <description>&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 have;
input value $9.;
datalines;
10( 92.9)
12(  1.0)
15( 100)
14( 87.7)
;

data want(drop=a i);
    set have;
    do i=1 to length(value);
        a=char(value, i);
        if a=' ' then do;
            newvalue=cat(substr(value, 1, i-1), substr(value, i+1, length(value)));
            leave;
        end;
    end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Aug 2019 10:29:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580508#M164915</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-08-12T10:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: remove only first leading space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580527#M164917</link>
      <description>&lt;P&gt;Can't a COMPRESS( ) function simplify the solution for dropping a SPACE?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data need;
   set have;
   value = compress(value);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Aug 2019 12:47:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580527#M164917</guid>
      <dc:creator>KachiM</dc:creator>
      <dc:date>2019-08-12T12:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: remove only first leading space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580532#M164920</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/17813"&gt;@KachiM&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Can't a COMPRESS( ) function simplify the solution for dropping a SPACE?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data need;
   set have;
   value = compress(value);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, since it removes ALL of the spaces.&lt;/P&gt;
&lt;P&gt;More likely they just want to change some of them. perhaps like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;value = tranwrd(value,'(  ','( ');&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Aug 2019 13:02:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580532#M164920</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-08-12T13:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: remove only first leading space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580535#M164921</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/277769"&gt;@Vijay77&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi i have values like 10( 92.9),12(&amp;nbsp; 1.0), 15( 100),14( 87.7) i have to remove only one leading spaces from each i am using 5.1 format if i use 4.1 i am getting W.D note in log. output like 10(92.9),12( 1.0),15(100),14(87.7).&lt;/P&gt;
&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Show the code you used to create these strings. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 13:14:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580535#M164921</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2019-08-12T13:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: remove only first leading space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580544#M164925</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/277769"&gt;@Vijay77&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi i have values like 10( 92.9),12(&amp;nbsp; 1.0), 15( 100),14( 87.7) i have to remove only one leading spaces from each i am using 5.1 format if i use 4.1 i am getting W.D note in log. output like 10(92.9),12( 1.0),15(100),14(87.7).&lt;/P&gt;
&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please post the data you have before creating those strings. If the strings are the result of concatenating numbers, i am sure that creating multiple blanks can be avoided.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 13:35:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580544#M164925</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-08-12T13:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: remove only first leading space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580564#M164930</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/277769"&gt;@Vijay77&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi i have values like 10( 92.9),12(&amp;nbsp; 1.0), 15( 100),14( 87.7) i have to remove only one leading spaces from each i am using 5.1 format if i use 4.1 i am getting W.D note in log. output like 10(92.9),12( 1.0),15(100),14(87.7).&lt;/P&gt;
&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you are using a PUT function somewhere you might want to consider using the -L alignment operator consider:&lt;/P&gt;
&lt;PRE&gt;data example;
   x = 37.5;
   length string1 string2 $ 10;
   string1= catt('(',put(x,5.1),')');
   string2= catt('(',put(x,5.1 -L),')');
run;&lt;/PRE&gt;
&lt;P&gt;String1 will have the leading space, String2 does not.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 14:44:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580564#M164930</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-08-12T14:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: remove only first leading space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580598#M164941</link>
      <description>V = cat( scan(v, 1, '('), '(', scan(v, 2, ' ' ) ) ;</description>
      <pubDate>Mon, 12 Aug 2019 16:45:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/remove-only-first-leading-space/m-p/580598#M164941</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-08-12T16:45:04Z</dc:date>
    </item>
  </channel>
</rss>

