<?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: Leading white spaces are being added in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262964#M51450</link>
    <description>&lt;P&gt;So to clarify.&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Your code works fine when run in editor.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;If you use %include it doesn't?&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please show how&amp;nbsp;you're using the %include&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9﻿&lt;/a&gt;&amp;nbsp;code - look up call execute. It generates the datastep code to create a data set for each group, which is what you want. &amp;nbsp;You can also use it to call your macro instead of looping. &amp;nbsp;Or you can use it as he did. It is more efficient as a solution, but if your %include doesn't work it won't work either.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Apr 2016 16:57:26 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-04-11T16:57:26Z</dc:date>
    <item>
      <title>Leading white spaces are being added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262948#M51438</link>
      <description>&lt;P&gt;I have a SAS program (let's call it program1) that calls another SAS program to execute using %include (let's call it program2). If I run program2, on its own, the program executes perfectly fine. However, if I run program1, program2 fails when called by %include:&lt;/P&gt;&lt;PRE&gt;SYMBOLGEN:  Macro variable PROD_GRP resolves to mttt
"mttt"
SYMBOLGEN:  Macro variable PROD_GRP resolves to mttt
MPRINT(SOS_MACH):   data serno_ mttt;
SYMBOLGEN:  Macro variable PROD_GRP resolves to mttt
MPRINT(SOS_MACH):   set serials2_ mttt;
ERROR: File WORK.SERIALS2_.DATA does not exist.
MPRINT(SOS_MACH):   eqp_id = trim(ser_no) || "CAT";
MPRINT(SOS_MACH):   run;&lt;/PRE&gt;&lt;P&gt;We can see from symbolgen, there is no leading white space, but from mprint, SAS has inserted a leading white space.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code snippet that it is erroring on.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data prod;
 format names $5.;
 input names;
 datalines;
 mttt
 pipe
 ttl
 ;
run;
data _null_;
 set prod nobs = n;
 call symputx ('cnt', n);
run;
&lt;BR /&gt;%macro sos_mach;
%local i prod_grp;
%do i = 1 %to &amp;amp;cnt;
	data _null_;
		set prod (obs = &amp;amp;i firstobs = &amp;amp;i);
		call symputx ('prod_grp', names);
	run;
	%put "&amp;amp;prod_grp";
	data serno_&amp;amp;prod_grp;
		set serials2_&amp;amp;prod_grp;
		eqp_id = trim(ser_no) || "CAT";
	run;
%end;
%mend sos_mach;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am using&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002295697.htm" target="_self"&gt;symputx&lt;/A&gt;&amp;nbsp;which would remove any leading or trailing white spaces as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I correct this problem that only occurs when program2 is called in program1 with a %include?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 16:27:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262948#M51438</guid>
      <dc:creator>dwsmith</dc:creator>
      <dc:date>2016-04-11T16:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Leading white spaces are being added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262950#M51439</link>
      <description>&lt;P&gt;You can apply the trim/strip function to remove spaces.&amp;nbsp;Your data step shows a leading space in the variable that might&amp;nbsp;be read in.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I didn't think you could use cards inside a macro, I'm surprised that's not causing issues, unless its just for demo purposes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You're calling your macro within itself? You appear to have an extra %macro sos_mach in the middle of your code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This doesn't seem to make a lot of sense...I feel we're missing something important here.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 16:25:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262950#M51439</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-11T16:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Leading white spaces are being added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262952#M51440</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza﻿&lt;/a&gt;&amp;nbsp;that was a copy and paste error. I tried using trim but the results are the same.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 16:37:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262952#M51440</guid>
      <dc:creator>dwsmith</dc:creator>
      <dc:date>2016-04-11T16:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: Leading white spaces are being added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262954#M51441</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can I ask what you are attempting to do with that code? &amp;nbsp;It seems to be a convoluted method to create lots of datasets from a list? &amp;nbsp;Why would you want to split the data up, have a variable which contains the group, and then use by group processing, it is far easier to program, and less resouce hungry. &amp;nbsp;Keep it as simple as possible. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you really have to go down that road, then why not just do:&lt;/P&gt;
&lt;PRE&gt;data prod;
  length names $10;
  input names;
  call execute(cats('data serno_',names,'; set serials2_',names,';eqp_id=cats(ser_no,"CAT"); run;');
datalines;
mttt
pipe
ttl
;
run;&lt;/PRE&gt;
&lt;P&gt;No need to go through all that macro stuff. &amp;nbsp;If you can clarify what your doing then I can provide further advice.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 16:35:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262954#M51441</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-04-11T16:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: Leading white spaces are being added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262955#M51442</link>
      <description>&lt;P&gt;Ok...I don't see that issue, so I think you have an extra space in your variable somehow. Try using strip/compress to remove space in call symputx even though it seems redundant.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following generates expected values, no modifications - does it for you?&lt;/P&gt;
&lt;P&gt;Post your log from the following if it doesnt:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data prod;
 format names $5.;
 input names;
 datalines;
 mttt
 pipe
 ttl
 ;
run;
data _null_;
 set prod nobs = n;
 call symputx ('cnt', n);
run;
%macro sos_mach;
%local i prod_grp;
%do i = 1 %to &amp;amp;cnt;
	data _null_;
		set prod (obs = &amp;amp;i firstobs = &amp;amp;i);
		call symputx ('prod_grp', names);
	run;
	%put "serno_&amp;amp;prod_grp";
%end;
%mend sos_mach;

%sos_mach;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Otherwise change your call symputx to the following and let me know if that works. Your data step does show an extra blank before the mttt so I wonder if it's not being read in properly or if there's an invisible character somewhere.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;call symputx ('prod_grp', strip(names));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 16:35:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262955#M51442</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-11T16:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: Leading white spaces are being added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262956#M51443</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; strip and trim produce the same log as I posted</description>
      <pubDate>Mon, 11 Apr 2016 16:40:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262956#M51443</guid>
      <dc:creator>dwsmith</dc:creator>
      <dc:date>2016-04-11T16:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Leading white spaces are being added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262957#M51444</link>
      <description>&lt;P&gt;Can you attach your test data set?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, please post the new log from my code - not yours. I want to see what the test code exactly returns.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it works, then it's an issue with your data.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 16:42:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262957#M51444</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-11T16:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Leading white spaces are being added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262958#M51445</link>
      <description>&lt;P&gt;I agree with&amp;nbsp;@RW9 though, this isn't a good way to achieve the desired results, but also curious as to why it won't work &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 16:44:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262958#M51445</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-11T16:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Leading white spaces are being added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262959#M51446</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; there isn't anything wrong with the data or code. It works perfectly fine when not being called by %include. It only fails when being called from another program via %include.</description>
      <pubDate>Mon, 11 Apr 2016 16:44:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262959#M51446</guid>
      <dc:creator>dwsmith</dc:creator>
      <dc:date>2016-04-11T16:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Leading white spaces are being added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262961#M51447</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt; I don't understand your code.</description>
      <pubDate>Mon, 11 Apr 2016 16:45:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262961#M51447</guid>
      <dc:creator>dwsmith</dc:creator>
      <dc:date>2016-04-11T16:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: Leading white spaces are being added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262962#M51448</link>
      <description>&lt;P&gt;Well, that usually happens when a lines too long.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%include 'path to program.sas' /lrecl=500;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Apr 2016 16:49:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262962#M51448</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-11T16:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Leading white spaces are being added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262963#M51449</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; same issue occurred.</description>
      <pubDate>Mon, 11 Apr 2016 16:53:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262963#M51449</guid>
      <dc:creator>dwsmith</dc:creator>
      <dc:date>2016-04-11T16:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: Leading white spaces are being added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262964#M51450</link>
      <description>&lt;P&gt;So to clarify.&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Your code works fine when run in editor.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;If you use %include it doesn't?&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please show how&amp;nbsp;you're using the %include&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9﻿&lt;/a&gt;&amp;nbsp;code - look up call execute. It generates the datastep code to create a data set for each group, which is what you want. &amp;nbsp;You can also use it to call your macro instead of looping. &amp;nbsp;Or you can use it as he did. It is more efficient as a solution, but if your %include doesn't work it won't work either.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 16:57:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262964#M51450</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-11T16:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: Leading white spaces are being added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262966#M51451</link>
      <description>&lt;P&gt;A datastep is a loop, over each observation the code in the datastep section (bearing in mind conditional branching) is executed for that observation.&amp;nbsp; Thus the code:&lt;/P&gt;
&lt;PRE&gt;data prod;
  length names $10;
  input names;
  call execute(cats('data serno_',names,'; set serials2_',names,';eqp_id=cats(ser_no,"CAT"); run;');
datalines;
mttt
pipe
ttl
;
run;&lt;/PRE&gt;
&lt;P&gt;Will create the SAS code: &lt;/P&gt;
&lt;P&gt;data serno_***; set serials2_***; eqp_id=cats(ser_no,"CAT"); run;&lt;/P&gt;
&lt;P&gt;For each observation in the dataset, and replace the *** with the names value in each case.&amp;nbsp; Hence no need for any looping, or macro code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However my main point was regarding the splitting of the dataset in the first place.&amp;nbsp; Why do you want 3 datasets:&lt;/P&gt;
&lt;P&gt;serno_mtt, serno_pipe, serno_ttl&lt;/P&gt;
&lt;P&gt;All three will be the same, it doesn't make sense.&amp;nbsp; If yuo have to have 3 "copies" of it then:&lt;/P&gt;
&lt;PRE&gt;data want;
  length name $200;
  set serials2 (in=a) serials2 (in=b) serials2 (in=c);
  if a then name="mtt";
  if b then name="pipe";
  if c then name="ttl";
run;&lt;/PRE&gt;
&lt;P&gt;Then run further processing based on by groups:&lt;/P&gt;
&lt;PRE&gt;proc means data=want;
  by name;
  ...
run;&lt;/PRE&gt;
&lt;P&gt;Far more efficient in both programming and processing.&amp;nbsp; Am no longer at work so can't test code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 17:06:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262966#M51451</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-04-11T17:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Leading white spaces are being added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262967#M51452</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; yes, the code works fine on its own.&lt;BR /&gt;&lt;BR /&gt;%include "&amp;amp;DIR.\all moves - SOS data grab.sas";&lt;BR /&gt;&lt;BR /&gt;The directory is correct. I checked it 100s of times. I also copied and paste the SAS file name. Other %include calls with this directory work fine as well.</description>
      <pubDate>Mon, 11 Apr 2016 17:10:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262967#M51452</guid>
      <dc:creator>dwsmith</dc:creator>
      <dc:date>2016-04-11T17:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: Leading white spaces are being added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262968#M51453</link>
      <description>&lt;P&gt;Given the results you describe (and given that you have tried to simplify the problem in order to share it) ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it possible that the variable NAMES might contain a leading tab character, rather than a leading blank?&amp;nbsp; I could imagine it's possible that a tab character within the program editor might be treated differently than a tab character brought in with %include.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 17:13:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262968#M51453</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-04-11T17:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Leading white spaces are being added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262969#M51454</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt; is there a way to strip tabs if this is the case?</description>
      <pubDate>Mon, 11 Apr 2016 17:15:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262969#M51454</guid>
      <dc:creator>dwsmith</dc:creator>
      <dc:date>2016-04-11T17:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: Leading white spaces are being added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262971#M51455</link>
      <description>&lt;P&gt;COMPRESS function with the s modifier&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000212246.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000212246.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;compress(name, , 'st')&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Apr 2016 17:21:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/262971#M51455</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-11T17:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: Leading white spaces are being added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/263059#M51476</link>
      <description>&lt;P&gt;That is really weird .&lt;/P&gt;
&lt;P&gt;1) Try %left()&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
	data serno_%left(&amp;amp;prod_grp);
		set serials2_%left(&amp;amp;prod_grp);
		eqp_id = trim(ser_no) || "CAT";
	run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;2) Put prefix in when that macro variable is creating.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%do i = 1 %to &amp;amp;cnt;
	data _null_;
		set prod (obs = &amp;amp;i firstobs = &amp;amp;i);
		call symputx ('prod_grp1', cats('serials2_',names));
                call symputx ('prod_grp2', cats('serno_',names));
	run;
	%put "&amp;amp;prod_grp";
	data &amp;amp;prod_grp2 ;
		set &amp;amp;prod_grp1 ;
		eqp_id = trim(ser_no) || "CAT";
	run;
%end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 01:12:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/263059#M51476</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-04-12T01:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: Leading white spaces are being added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/263241#M51505</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp﻿&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried your suggestions:&lt;/P&gt;&lt;PRE&gt;SYMBOLGEN:  Macro variable NAME resolves to 	mttt
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN
              where the error has occurred.
ERROR 22-7: Invalid option name DBCREATE_TABLE_OPTS.
SYMBOLGEN:  Macro variable NAME resolves to 	mttt
ERROR: File WORK.SERNO_.DATA does not exist.&lt;/PRE&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Number 2:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;SYMBOLGEN:  Macro variable PROD_GRP1 resolves to serials2_mttt
"serials2_mttt"
SYMBOLGEN:  Macro variable PROD_GRP2 resolves to serno_mttt
"serno_mttt"
SYMBOLGEN:  Macro variable PROD_GRP2 resolves to serno_mttt
SYMBOLGEN:  Macro variable PROD_GRP1 resolves to serials2_mttt
ERROR: File WORK.SERIALS2_.DATA does not exist.
ERROR: File WORK.MTTT.DATA does not exist.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 15:43:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leading-white-spaces-are-being-added/m-p/263241#M51505</guid>
      <dc:creator>dwsmith</dc:creator>
      <dc:date>2016-04-12T15:43:16Z</dc:date>
    </item>
  </channel>
</rss>

