<?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: macro variable contains line break in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-contains-line-break/m-p/830190#M328039</link>
    <description>Is call symput likely the cause of the line break? not sure what my options are, I'd prefer to declare these directories with %let statments instead of additional variables in a _null_ dataset. Thanks!</description>
    <pubDate>Wed, 24 Aug 2022 22:12:23 GMT</pubDate>
    <dc:creator>weather4d</dc:creator>
    <dc:date>2022-08-24T22:12:23Z</dc:date>
    <item>
      <title>macro variable contains line break</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-contains-line-break/m-p/830189#M328038</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm attempting to reorganize some code and start utilizing GitLab for my organization. My plan is to commit our code base with following structure&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;directory/[Main]&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;etl.egp&lt;/LI&gt;&lt;LI&gt;build.egp&lt;/LI&gt;&lt;LI&gt;validation.egp&lt;/LI&gt;&lt;LI&gt;parameters.sas&lt;/LI&gt;&lt;LI&gt;[build-programs]&lt;/LI&gt;&lt;LI&gt;[build-inputs]&lt;/LI&gt;&lt;LI&gt;[etl-programs]&lt;/LI&gt;&lt;LI&gt;[validation-programs]&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;within build.egp I run parameters.sas with an %include statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;	data _null_;
	name = dequote(&amp;amp;_clientprojectpath);
	cutofflen = length(&amp;amp;_ClientProjectNAME)+3;
	namelen = length(name);
	path = cats('\\company.com\Shares\Projects',substr(name,3,namelen-cutofflen));  *starts string after X: with sas filepath type and drops project name;
	path2 = substr(path,1,length(path)-5); *drops \Main path;
	param_CodeRef = cat(trim(path),"\parameters-0622.sas");
	call symput('param_code', param_CodeRef);
	call symput('egp_location',path);
	call symput('base_directory',path2);
	run;

%include "&amp;amp;param_code.";&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=""&gt;*snippet of related code from parameters.sas file
	%let dir_build = &amp;amp;base_directory.\Production\&amp;amp;yyyy.\&amp;amp;mm.\Build;
	%let dir_prep = &amp;amp;dir_build.\Source;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is that the variable has a line split (enter key) causing the %let statement to create multiple records in macro variable value viewer, neither of them usable.&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;%put &amp;amp;dir_prep.;&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;"&amp;amp;base_directory. [actual directory does output]&lt;/P&gt;&lt;P&gt;\Production\2022\06\Build"&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think my near term problem is solved if I can create %let statements with &amp;amp;base_directory. and no enter keys.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;possible causes of problem:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Line insert in macro variable declared in _null_ data step&lt;/LI&gt;&lt;LI&gt;relative file references under project properties, (speculation that it's truncating path relative to file location).&lt;/LI&gt;&lt;LI&gt;file paths are pretty long (directory =127 char)&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 24 Aug 2022 22:03:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-contains-line-break/m-p/830189#M328038</guid>
      <dc:creator>weather4d</dc:creator>
      <dc:date>2022-08-24T22:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable contains line break</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-contains-line-break/m-p/830190#M328039</link>
      <description>Is call symput likely the cause of the line break? not sure what my options are, I'd prefer to declare these directories with %let statments instead of additional variables in a _null_ dataset. Thanks!</description>
      <pubDate>Wed, 24 Aug 2022 22:12:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-contains-line-break/m-p/830190#M328039</guid>
      <dc:creator>weather4d</dc:creator>
      <dc:date>2022-08-24T22:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable contains line break</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-contains-line-break/m-p/830193#M328040</link>
      <description>&lt;P&gt;Turn on macro debugging options&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;option mprint symbolgen;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then run this segment of code again and the show us the &lt;FONT color="#FF0000"&gt;entire&lt;/FONT&gt; log for this section of code. Copy the log as text and paste it into the window that appears when you click on the &amp;lt;/&amp;gt; icon. &lt;STRONG&gt;DO NOT SKIP THIS STEP.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Insert Log Icon in SAS Communities.png" style="width: 859px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66171iFEC370B1DBF07B28/image-size/large?v=v2&amp;amp;px=999" role="button" title="Insert Log Icon in SAS Communities.png" alt="Insert Log Icon in SAS Communities.png" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SYMPUT does not add in characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 22:46:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-contains-line-break/m-p/830193#M328040</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-08-24T22:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable contains line break</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-contains-line-break/m-p/830195#M328041</link>
      <description>I just figured it out. Needed to use %trim instead of trim on the macro variable.&lt;BR /&gt;Sorry for confusion - was being overly conservative with what I shared.</description>
      <pubDate>Wed, 24 Aug 2022 23:05:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-contains-line-break/m-p/830195#M328041</guid>
      <dc:creator>weather4d</dc:creator>
      <dc:date>2022-08-24T23:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable contains line break</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-contains-line-break/m-p/830198#M328042</link>
      <description>&lt;P&gt;Since your &amp;amp;base_directory macro variable is built using the PATH2 variable in that data _null_ you might consider 1) making an actual output data set so you can examine the values created for PATH2 without any macro involvement and 2) test for the presence of odd characters at the end and remove them if needed before creating the macro variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OR consider supplying the values of the macro variables&amp;nbsp;&amp;amp;_clientprojectpath and &amp;amp;_ClientProjectNAME&amp;nbsp; used in that data step so we can test them.&lt;/P&gt;
&lt;P&gt;You may want to look for copy-and-paste issues where one or both of those macro variables are assigned.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 23:34:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-contains-line-break/m-p/830198#M328042</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-08-24T23:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable contains line break</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-contains-line-break/m-p/830220#M328043</link>
      <description>&lt;P&gt;This&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;name = dequote(&amp;amp;_clientprojectpath);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;cannot work, as &amp;amp;_clientprojectpath will not contain a valid SAS variable name. Enclose the macro variable reference in quotes.&lt;/P&gt;
&lt;P&gt;Maxim 2: Read the Log.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 04:22:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-contains-line-break/m-p/830220#M328043</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-08-25T04:22:55Z</dc:date>
    </item>
  </channel>
</rss>

