<?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 How to Escape Line Break in Long Code Line? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-Escape-Line-Break-in-Long-Code-Line/m-p/958249#M374007</link>
    <description>&lt;P&gt;It seems SAS Macro adds a space when there is a line break as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;%let Sentence=The line break in this sentence
will leave a space.;

%put &amp;amp;Sentence;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;SAS prints the following output:&lt;/P&gt;&lt;PRE&gt;1    %let Sentence=The line break in this sentence
2    will leave a space.;
3
4    %put &amp;amp;Sentence;
The line break in this sentence will leave a space.&lt;/PRE&gt;&lt;P&gt;Is there any way to avoid this spacing and let SAS print &lt;CODE&gt;The line break in this sentencewill leave a space.&lt;/CODE&gt;&amp;nbsp;instead? This is not a SAS example, but like &lt;CODE&gt;%&lt;/CODE&gt; in LaTeX as follows:&lt;/P&gt;&lt;PRE&gt;\documentclass{article}

\begin{document}

The line break in this sentence
will leave a space.

However, the line break in this sentence%
won't leave a space.

\end{document}&lt;/PRE&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;</description>
    <pubDate>Tue, 04 Feb 2025 18:16:21 GMT</pubDate>
    <dc:creator>Junyong</dc:creator>
    <dc:date>2025-02-04T18:16:21Z</dc:date>
    <item>
      <title>How to Escape Line Break in Long Code Line?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Escape-Line-Break-in-Long-Code-Line/m-p/958249#M374007</link>
      <description>&lt;P&gt;It seems SAS Macro adds a space when there is a line break as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;%let Sentence=The line break in this sentence
will leave a space.;

%put &amp;amp;Sentence;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;SAS prints the following output:&lt;/P&gt;&lt;PRE&gt;1    %let Sentence=The line break in this sentence
2    will leave a space.;
3
4    %put &amp;amp;Sentence;
The line break in this sentence will leave a space.&lt;/PRE&gt;&lt;P&gt;Is there any way to avoid this spacing and let SAS print &lt;CODE&gt;The line break in this sentencewill leave a space.&lt;/CODE&gt;&amp;nbsp;instead? This is not a SAS example, but like &lt;CODE&gt;%&lt;/CODE&gt; in LaTeX as follows:&lt;/P&gt;&lt;PRE&gt;\documentclass{article}

\begin{document}

The line break in this sentence
will leave a space.

However, the line break in this sentence%
won't leave a space.

\end{document}&lt;/PRE&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2025 18:16:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Escape-Line-Break-in-Long-Code-Line/m-p/958249#M374007</guid>
      <dc:creator>Junyong</dc:creator>
      <dc:date>2025-02-04T18:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to Escape Line Break in Long Code Line?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Escape-Line-Break-in-Long-Code-Line/m-p/958268#M374013</link>
      <description>&lt;P&gt;If you want to make a long macro variable but keep the source lines short here are a couple of ways.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Macro code only:&amp;nbsp; Use multiple %LET statements.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let Sentence=The line break in this sentence;
%let Sentence=&amp;amp;sentence.will NOT leave a space before will.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;SAS code: Use multiple string literals and CALL SYMPUTX()&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
call symputx('Sentence'
 ,'The line break in this sentence'
||'will NOT leave a space before will.'
);
run;;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note: if you need the macro variable to contain leading and/or trailing spaces you can use the ANCIENT CALL SYMPUT() instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2025 19:37:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Escape-Line-Break-in-Long-Code-Line/m-p/958268#M374013</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-02-04T19:37:56Z</dc:date>
    </item>
  </channel>
</rss>

