<?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: Cannot put empty space on string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Cannot-put-empty-space-on-string/m-p/507411#M136204</link>
    <description>&lt;P&gt;That worked like a charm. Thank you!&lt;/P&gt;</description>
    <pubDate>Thu, 25 Oct 2018 07:12:33 GMT</pubDate>
    <dc:creator>Luis_Martins</dc:creator>
    <dc:date>2018-10-25T07:12:33Z</dc:date>
    <item>
      <title>Cannot put empty space on string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cannot-put-empty-space-on-string/m-p/507079#M136029</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I Have a script to generate a SAS program file (txt) using a data step like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data outem.bound;
	set outem.model;
	attrib txt length = $2000.;
		txt = "***********************Macros for imputation of variable "!!trim(dep)!!"****************;";
		output;
		txt = "%"!!"macro bound"!!trim(dep)!!";";
		output;
		if not missing(lb) then do;
			txt =     '     '!!"      LB="!!trim(lb)!!";";
			output;
		end;
		if not missing(ub) then do;
			txt =     '     '!!"      UB="!!trim(ub)!!";";
			output;
		end;
		if not missing(dlb) and not missing(lb) then do;
			txt =     '      '!!"          LB=MAX(LB,"!!trim(dlb)!!");";
			output;
		end;
		if not missing(dlb) and missing(lb) then do;
			txt =      '     '!!"      LB="!!trim(dlb)!!";";
			output;
		end;
		if not missing(dub) and not missing(ub) then do;
			txt =        '     '!!"    UB=MIN(UB,"!!trim(dub)!!");";
			output;
		end;
		if not missing(dub) and missing(ub) then do;
			txt = '     '!!"UB="!!trim(dub)!!";";
			output;
		end;
		txt = "%"!!"mend;";
		output;
run;
data outem.imp;
    set outem.bound;
    file "&amp;amp;mydir\3_generate_models\3_model.sas" lrecl = 2000;
    put txt;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The program works just fine. However I cannot put empty space before or after any string.&lt;/P&gt;&lt;P&gt;For instance, the scrip generates this string:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro boundHC0340;
LB=           1;
UB=           9;
%mend;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But i would like to have this instead:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro boundHC0340;
    LB=           1;
    UB=           9;
%mend;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I can put other characters such as "*" or "#". It's just that I can't put empty space before LB or UB&lt;/P&gt;&lt;P&gt;Thank you very much for your support.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2018 08:44:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cannot-put-empty-space-on-string/m-p/507079#M136029</guid>
      <dc:creator>Luis_Martins</dc:creator>
      <dc:date>2018-10-24T08:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot put empty space on string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cannot-put-empty-space-on-string/m-p/507233#M136108</link>
      <description>&lt;P&gt;have you tried prepending '09'x as the tab character?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2018 16:44:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cannot-put-empty-space-on-string/m-p/507233#M136108</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2018-10-24T16:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot put empty space on string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cannot-put-empty-space-on-string/m-p/507235#M136110</link>
      <description>&lt;P&gt;To get PUT to not remove the leading spaces you need use a format.&amp;nbsp; You could use $CHAR format, but it would be better to use $VARYING and avoid padding your program file lines with trailing spaces.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data outem.imp;
    set outem.bound;
    file "&amp;amp;mydir\3_generate_models\3_model.sas" lrecl = 2000;
    length=lengthn(txt);
    put txt $varying2000. length;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Oct 2018 16:53:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cannot-put-empty-space-on-string/m-p/507235#M136110</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-10-24T16:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot put empty space on string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cannot-put-empty-space-on-string/m-p/507410#M136203</link>
      <description>&lt;P&gt;Greetings, I'm sorry but i'm new to programming and i'm not sure how can i do that.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 07:11:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cannot-put-empty-space-on-string/m-p/507410#M136203</guid>
      <dc:creator>Luis_Martins</dc:creator>
      <dc:date>2018-10-25T07:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot put empty space on string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cannot-put-empty-space-on-string/m-p/507411#M136204</link>
      <description>&lt;P&gt;That worked like a charm. Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 07:12:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cannot-put-empty-space-on-string/m-p/507411#M136204</guid>
      <dc:creator>Luis_Martins</dc:creator>
      <dc:date>2018-10-25T07:12:33Z</dc:date>
    </item>
  </channel>
</rss>

