<?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 Removing Leading/Trailing blanks using data Step/Proc SQL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Removing-Leading-Trailing-blanks-using-data-Step-Proc-SQL/m-p/883479#M349073</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I read in the data from CSV file using infile &amp;amp; length statement.&lt;/P&gt;
&lt;P&gt;Here,&amp;nbsp;&lt;STRONG&gt;I AM NOT supposed&lt;/STRONG&gt; to Alter the below Infile DataStep &amp;amp; Raw Source file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data bs_raw1(keep=fnd dec_val ); &lt;BR /&gt;&lt;STRONG&gt;length&lt;/STRONG&gt;&lt;BR /&gt;/* 01 */ fnd $ 50 &lt;BR /&gt;/* 02 */ dec_val 8 &lt;BR /&gt;;&lt;BR /&gt;informat fnd $Upcase50. dec_val Comma15.2;&lt;BR /&gt;infile Rin1 firstobs=2 dsd truncover termstr=&amp;amp;ftermstr.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rin1 File-&lt;/P&gt;
&lt;TABLE width="182"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="86"&gt;2 Digit Fnd&lt;/TD&gt;
&lt;TD width="96"&gt;Trade Amount&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;1L&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;0.71&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1S&lt;/TD&gt;
&lt;TD&gt;2.32&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;1J&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;0.79&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1T&lt;/TD&gt;
&lt;TD&gt;3.43&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1R&lt;/TD&gt;
&lt;TD&gt;1.90&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;21&lt;/TD&gt;
&lt;TD&gt;4.21&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;26&lt;/TD&gt;
&lt;TD&gt;2.40&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here in the raw source file, there are Leading/Trailing blanks for some of values. For example, value 1L is -" 1L".&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RaviSPR_0-1688499128657.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85554i2DBA7F7A1D3D58C0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RaviSPR_0-1688499128657.png" alt="RaviSPR_0-1688499128657.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Code&lt;/STRONG&gt; I tried-&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;PROC SQL;&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; &amp;nbsp;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;/* SELECT Strip(Left(fnd)) INTO :fnd1 -:fnd&amp;amp;fnd_count. Trimmed FROM BS_RAW1 ;&amp;nbsp; */&lt;/DIV&gt;
&lt;DIV&gt;select trimn(fnd) into :fnd1 -:fnd&amp;amp;fnd_count.&amp;nbsp; FROM BS_RAW1 ;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;/* SELECT prk_fund INTO :fnd1 -:fnd&amp;amp;fnd_count. Trimmed FROM BS_RAW1 ;&amp;nbsp; */&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;SELECT dec_val FORMAT 18.2 INTO :dec_val1 -:dec_val&amp;amp;fnd_count. FROM BS_RAW1&amp;nbsp; ;&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Quit;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; %Put fnd = **&amp;amp;fnd1.**&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; dec_val = **&amp;amp;dec_val1.** ;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; %Put fnd = **&amp;amp;fnd2.**&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; dec_val = **&amp;amp;dec_val2.** ;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Results-&lt;/P&gt;
&lt;P&gt;35 %Put fnd = **&amp;amp;fnd1.**&lt;BR /&gt;SYMBOLGEN: Macro variable FND1 resolves to &amp;nbsp;1L&amp;nbsp;&lt;BR /&gt;36 dec_val = **&amp;amp;dec_val1.** ;&lt;BR /&gt;SYMBOLGEN: Macro variable DEC_VAL1 resolves to 0.71&lt;BR /&gt;fnd =&lt;STRONG&gt; **&amp;nbsp;1L&amp;nbsp;**&lt;/STRONG&gt; dec_val = **0.71**&lt;BR /&gt;37 %Put fnd = **&amp;amp;fnd2.**&lt;BR /&gt;SYMBOLGEN: Macro variable FND2 resolves to 1S&lt;BR /&gt;38 dec_val = **&amp;amp;dec_val2.** ;&lt;BR /&gt;SYMBOLGEN: Macro variable DEC_VAL2 resolves to 2.32&lt;BR /&gt;fnd = **1S** dec_val = **2.32**&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried all the possibilities. SO, Can anyone please help me to remove the Leading/Trailing blank using either directly in the SAS data set after reading the raw source file&amp;nbsp; or in the Proc SQL step which is creating Fnd macro variables?&lt;/P&gt;
&lt;P&gt;I used Trimn, Compress, Left in the NEW Data step after reading the raw source file. But no Luck.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Data BS_RAW1ff;&lt;BR /&gt;Set BS_RAW1;&lt;BR /&gt;c=Length(fnd);&lt;BR /&gt;fnd2 = Trimn(fnd);&lt;BR /&gt;c2=Length(fnd2);&lt;BR /&gt;fnd3 = CATS('*',fnd);&lt;BR /&gt;fnd4 = Compbl(fnd);&lt;BR /&gt;fnd5 = Trim(Left(fnd));&lt;/P&gt;
&lt;P&gt;Run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;RaviSPR&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jul 2023 19:48:26 GMT</pubDate>
    <dc:creator>RaviSPR</dc:creator>
    <dc:date>2023-07-04T19:48:26Z</dc:date>
    <item>
      <title>Removing Leading/Trailing blanks using data Step/Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-Leading-Trailing-blanks-using-data-Step-Proc-SQL/m-p/883479#M349073</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I read in the data from CSV file using infile &amp;amp; length statement.&lt;/P&gt;
&lt;P&gt;Here,&amp;nbsp;&lt;STRONG&gt;I AM NOT supposed&lt;/STRONG&gt; to Alter the below Infile DataStep &amp;amp; Raw Source file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data bs_raw1(keep=fnd dec_val ); &lt;BR /&gt;&lt;STRONG&gt;length&lt;/STRONG&gt;&lt;BR /&gt;/* 01 */ fnd $ 50 &lt;BR /&gt;/* 02 */ dec_val 8 &lt;BR /&gt;;&lt;BR /&gt;informat fnd $Upcase50. dec_val Comma15.2;&lt;BR /&gt;infile Rin1 firstobs=2 dsd truncover termstr=&amp;amp;ftermstr.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rin1 File-&lt;/P&gt;
&lt;TABLE width="182"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="86"&gt;2 Digit Fnd&lt;/TD&gt;
&lt;TD width="96"&gt;Trade Amount&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;1L&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;0.71&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1S&lt;/TD&gt;
&lt;TD&gt;2.32&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;1J&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;0.79&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1T&lt;/TD&gt;
&lt;TD&gt;3.43&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1R&lt;/TD&gt;
&lt;TD&gt;1.90&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;21&lt;/TD&gt;
&lt;TD&gt;4.21&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;26&lt;/TD&gt;
&lt;TD&gt;2.40&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here in the raw source file, there are Leading/Trailing blanks for some of values. For example, value 1L is -" 1L".&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RaviSPR_0-1688499128657.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85554i2DBA7F7A1D3D58C0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RaviSPR_0-1688499128657.png" alt="RaviSPR_0-1688499128657.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Code&lt;/STRONG&gt; I tried-&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;PROC SQL;&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; &amp;nbsp;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;/* SELECT Strip(Left(fnd)) INTO :fnd1 -:fnd&amp;amp;fnd_count. Trimmed FROM BS_RAW1 ;&amp;nbsp; */&lt;/DIV&gt;
&lt;DIV&gt;select trimn(fnd) into :fnd1 -:fnd&amp;amp;fnd_count.&amp;nbsp; FROM BS_RAW1 ;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;/* SELECT prk_fund INTO :fnd1 -:fnd&amp;amp;fnd_count. Trimmed FROM BS_RAW1 ;&amp;nbsp; */&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;SELECT dec_val FORMAT 18.2 INTO :dec_val1 -:dec_val&amp;amp;fnd_count. FROM BS_RAW1&amp;nbsp; ;&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Quit;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; %Put fnd = **&amp;amp;fnd1.**&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; dec_val = **&amp;amp;dec_val1.** ;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; %Put fnd = **&amp;amp;fnd2.**&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; dec_val = **&amp;amp;dec_val2.** ;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Results-&lt;/P&gt;
&lt;P&gt;35 %Put fnd = **&amp;amp;fnd1.**&lt;BR /&gt;SYMBOLGEN: Macro variable FND1 resolves to &amp;nbsp;1L&amp;nbsp;&lt;BR /&gt;36 dec_val = **&amp;amp;dec_val1.** ;&lt;BR /&gt;SYMBOLGEN: Macro variable DEC_VAL1 resolves to 0.71&lt;BR /&gt;fnd =&lt;STRONG&gt; **&amp;nbsp;1L&amp;nbsp;**&lt;/STRONG&gt; dec_val = **0.71**&lt;BR /&gt;37 %Put fnd = **&amp;amp;fnd2.**&lt;BR /&gt;SYMBOLGEN: Macro variable FND2 resolves to 1S&lt;BR /&gt;38 dec_val = **&amp;amp;dec_val2.** ;&lt;BR /&gt;SYMBOLGEN: Macro variable DEC_VAL2 resolves to 2.32&lt;BR /&gt;fnd = **1S** dec_val = **2.32**&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried all the possibilities. SO, Can anyone please help me to remove the Leading/Trailing blank using either directly in the SAS data set after reading the raw source file&amp;nbsp; or in the Proc SQL step which is creating Fnd macro variables?&lt;/P&gt;
&lt;P&gt;I used Trimn, Compress, Left in the NEW Data step after reading the raw source file. But no Luck.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Data BS_RAW1ff;&lt;BR /&gt;Set BS_RAW1;&lt;BR /&gt;c=Length(fnd);&lt;BR /&gt;fnd2 = Trimn(fnd);&lt;BR /&gt;c2=Length(fnd2);&lt;BR /&gt;fnd3 = CATS('*',fnd);&lt;BR /&gt;fnd4 = Compbl(fnd);&lt;BR /&gt;fnd5 = Trim(Left(fnd));&lt;/P&gt;
&lt;P&gt;Run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;RaviSPR&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 19:48:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-Leading-Trailing-blanks-using-data-Step-Proc-SQL/m-p/883479#M349073</guid>
      <dc:creator>RaviSPR</dc:creator>
      <dc:date>2023-07-04T19:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Leading/Trailing blanks using data Step/Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-Leading-Trailing-blanks-using-data-Step-Proc-SQL/m-p/883480#M349074</link>
      <description>Print the characters using a hex format to see what those spaces are and explicitly remove them using TRANSLATE() or COMPRESS(). If you only have two digit codes and no spaces you can use COMPRESS() with the s modifier (see the docs).</description>
      <pubDate>Tue, 04 Jul 2023 20:02:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-Leading-Trailing-blanks-using-data-Step-Proc-SQL/m-p/883480#M349074</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-07-04T20:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Leading/Trailing blanks using data Step/Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-Leading-Trailing-blanks-using-data-Step-Proc-SQL/m-p/883484#M349075</link>
      <description>&lt;P&gt;If LEFT() or STRIP() did not remove the leading white space then it is NOT a space character.&amp;nbsp; It is some other character(s).&amp;nbsp; Such as TAB ('09'x) or non-breaking spaces ('A0'x).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you really mean to imply a decimal place when the strings in the CSV file for the variable DEC_VAL did not include one?&amp;nbsp; That is what using the 2 on the end of the INFORMAT is for.&amp;nbsp; It has NOTHING to do with how many decimal places are in the actual numeric value.&amp;nbsp; Just where to place the decimal place when the string being read does not have one.&amp;nbsp; So a value like '71' in the CSV file will be converted to the number 0.71 your printout is showing.&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;</description>
      <pubDate>Tue, 04 Jul 2023 20:19:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-Leading-Trailing-blanks-using-data-Step-Proc-SQL/m-p/883484#M349075</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-07-04T20:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Leading/Trailing blanks using data Step/Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-Leading-Trailing-blanks-using-data-Step-Proc-SQL/m-p/883500#M349083</link>
      <description>&lt;P&gt;Thank you for Response..&lt;/P&gt;
&lt;P&gt;I am trying to find what are the special characters in front of those Fnds-1L &amp;amp; 1J.&lt;/P&gt;
&lt;P&gt;Thank you for clarification on decimal places. I just used that informat as it is from Prod.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2023 03:25:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-Leading-Trailing-blanks-using-data-Step-Proc-SQL/m-p/883500#M349083</guid>
      <dc:creator>RaviSPR</dc:creator>
      <dc:date>2023-07-05T03:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Leading/Trailing blanks using data Step/Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-Leading-Trailing-blanks-using-data-Step-Proc-SQL/m-p/883501#M349084</link>
      <description>&lt;P&gt;Thank you for the reply.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to print the Fnd values in the Log with -&amp;nbsp; Put fnd= $Hex.;&lt;/P&gt;
&lt;P&gt;I got below results.&lt;/P&gt;
&lt;P&gt;fnd=A0314CA020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020&lt;BR /&gt;fnd=3153202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020&lt;BR /&gt;fnd=A0314AA0A0A0A0A0A0A0A0202020202020202020202020202020202020202020202020202020202020202020202020202020&lt;BR /&gt;fnd=3154202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020&lt;/P&gt;
&lt;P&gt;And so on...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here do you mean, should I remove Leading Chars-"A0" using Compress function? But in case if fnd has Values as "A0" in the &lt;STRONG&gt;raw source&lt;/STRONG&gt; file then the actual values will be deleted right if I use Compress?&lt;/P&gt;
&lt;P&gt;Can you please suggest any solution to remove Leading Special chars?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2023 03:33:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-Leading-Trailing-blanks-using-data-Step-Proc-SQL/m-p/883501#M349084</guid>
      <dc:creator>RaviSPR</dc:creator>
      <dc:date>2023-07-05T03:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Leading/Trailing blanks using data Step/Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-Leading-Trailing-blanks-using-data-Step-Proc-SQL/m-p/883504#M349087</link>
      <description>&lt;P&gt;Use TRANSLATE() to convert the non-breaking spaces into actual spaces.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;fnd=translate(fnd,' ','A0'x);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then use can use LEFT() to remove the leading spaces.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;fnd=left(translate(fnd,' ','A0'x));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Jul 2023 04:50:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-Leading-Trailing-blanks-using-data-Step-Proc-SQL/m-p/883504#M349087</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-07-05T04:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Leading/Trailing blanks using data Step/Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-Leading-Trailing-blanks-using-data-Step-Proc-SQL/m-p/883505#M349088</link>
      <description>&lt;P&gt;Not sure what "from PROD" means.&amp;nbsp; &amp;nbsp;But unless you need to read from a source where the decimal places were deliberately removed to save one byte per value you do NOT want to include decimal places on an INFORMAT.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you reading a delimited file you should be reading the value in LIST mode so the width of the informat specification also does not matter. When you read in LIST mode the width of the informat is ignored and the whole next field on the line is read, whatever length it has.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The use of the COMMA informat will allow you read values that contain commas and dollar signs (also percent signs).&amp;nbsp; If you want the values to PRINT in the style like 999,999,999.99 then you could attach the COMMA14.2 FORMAT to the variable with a FORMAT statement instead of an INFORMAT statement.&amp;nbsp; If you could have negative values that large then COMMA15.2 might be useful.&amp;nbsp; But if you need to display larger positive numbers you will need to jump to a width of 16 instead of 15 because of the extra comma needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2023 05:07:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-Leading-Trailing-blanks-using-data-Step-Proc-SQL/m-p/883505#M349088</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-07-05T05:07:16Z</dc:date>
    </item>
  </channel>
</rss>

