<?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 Line break in ods in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Line-break-in-ods/m-p/947663#M370930</link>
    <description>&lt;P&gt;&amp;nbsp;Hi guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Before I ask the question let me paste the code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let string = "This is line 1 &amp;lt;line_break&amp;gt; This is line 2 &amp;lt;line_break&amp;gt; This is line 3";

data test;
	var=&amp;amp;string.;
run;

proc sql;
	select * from test;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I want to have a dataset with only one observation, but in the final ODS I want to show one line above another. I need this because later on I am using stored process to fill data in the excel file, so I want to fill the data in the following way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="filippo_kow_0-1729077566903.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/101312i465313092D8081E7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="filippo_kow_0-1729077566903.png" alt="filippo_kow_0-1729077566903.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Btw. I was also trying to prepare the formula for excel in SAS:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="filippo_kow_2-1729077924523.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/101315iC6979A5E25F24180/image-size/medium?v=v2&amp;amp;px=400" role="button" title="filippo_kow_2-1729077924523.png" alt="filippo_kow_2-1729077924523.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but for some reason excel doedn't want to parse it properly (I have "#name?" error after applying somethink like this: sheet_1.Cells(16, 5).Value = my_data.Cells(2, 30) (what's interesting it is working when I press F2 and Enter on the cell) ).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance for any help!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Filip&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Oct 2024 11:28:20 GMT</pubDate>
    <dc:creator>filippo_kow</dc:creator>
    <dc:date>2024-10-16T11:28:20Z</dc:date>
    <item>
      <title>Line break in ods</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Line-break-in-ods/m-p/947663#M370930</link>
      <description>&lt;P&gt;&amp;nbsp;Hi guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Before I ask the question let me paste the code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let string = "This is line 1 &amp;lt;line_break&amp;gt; This is line 2 &amp;lt;line_break&amp;gt; This is line 3";

data test;
	var=&amp;amp;string.;
run;

proc sql;
	select * from test;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I want to have a dataset with only one observation, but in the final ODS I want to show one line above another. I need this because later on I am using stored process to fill data in the excel file, so I want to fill the data in the following way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="filippo_kow_0-1729077566903.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/101312i465313092D8081E7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="filippo_kow_0-1729077566903.png" alt="filippo_kow_0-1729077566903.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Btw. I was also trying to prepare the formula for excel in SAS:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="filippo_kow_2-1729077924523.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/101315iC6979A5E25F24180/image-size/medium?v=v2&amp;amp;px=400" role="button" title="filippo_kow_2-1729077924523.png" alt="filippo_kow_2-1729077924523.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but for some reason excel doedn't want to parse it properly (I have "#name?" error after applying somethink like this: sheet_1.Cells(16, 5).Value = my_data.Cells(2, 30) (what's interesting it is working when I press F2 and Enter on the cell) ).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance for any help!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Filip&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 11:28:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Line-break-in-ods/m-p/947663#M370930</guid>
      <dc:creator>filippo_kow</dc:creator>
      <dc:date>2024-10-16T11:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Line break in ods</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Line-break-in-ods/m-p/947664#M370931</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; It's not clear to me what you're doing or what you want. You don't show any ODS statements. You say that you want to "fill data in" the Excel file but it's not clear to me whether the data is coming from SAS or not. I'm not sure why you need a formula. Also, &amp;lt;line break&amp;gt; is not any ODS method for inserting a line feed or line break. And, you have a DATA step that makes your variable VAR from &amp;amp;string. Why do you need the PROC SQL step?&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 12:46:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Line-break-in-ods/m-p/947664#M370931</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2024-10-16T12:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Line break in ods</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Line-break-in-ods/m-p/947670#M370933</link>
      <description>&lt;P&gt;&amp;nbsp;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In general I need to fill excel file based on data from SAS. What I am doing is:&lt;/P&gt;
&lt;P&gt;1. I have created a stored process that selects data from SAS. In that stored process I am gathering all the data and finally I am running the following proc sql:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
 select * from my_data;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;2. Then, in the excel file I am running the process from SAS add-in. In the 'results' pane of add-in I see data from my last query (select * from my_data).&lt;/P&gt;
&lt;P&gt;3. I am inserting resulting data into new excel sheet&lt;/P&gt;
&lt;P&gt;4. Based on those results I need to fill form that is in another sheet.&lt;/P&gt;
&lt;P&gt;5. Here comes my question: sometimes it might happen that for one observation I can have multiple values (in one row), eg.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="filippo_kow_0-1729083871700.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/101318i652D7AEF061E636E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="filippo_kow_0-1729083871700.png" alt="filippo_kow_0-1729083871700.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;6. In my final form I want to show those orders one above another:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="filippo_kow_1-1729083956988.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/101319iE1A0B4F1F6BCCC00/image-size/medium?v=v2&amp;amp;px=400" role="button" title="filippo_kow_1-1729083956988.png" alt="filippo_kow_1-1729083956988.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;7. Originally I thought I can create formula for excel in SAS ( ="Order_123"&amp;amp;char(10)&amp;amp;"Order_456"&amp;amp;char(10)&amp;amp;"Order_789") and when inserting it into excel it will be properly handled. Unfortunately, excel claims that there is an error in the formula. So what I am trying to do now is to add line breaks after each "order" so that in the final form all orders will be one above another (in the same cell).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope it is more clear now &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Filip&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 13:11:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Line-break-in-ods/m-p/947670#M370933</guid>
      <dc:creator>filippo_kow</dc:creator>
      <dc:date>2024-10-16T13:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: Line break in ods</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Line-break-in-ods/m-p/947680#M370935</link>
      <description>&lt;P&gt;Use in-line style command {newline}.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods escapechar='^';
data test;
  length string $200;
  string=catx('^{newline}','Order_123','Order_456','Order_789');
run;
ods excel file='c:\downloads\newline.xlsx';
proc print data=test;
run;
ods excel close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here is what the result looks like in Excel file:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1729087282084.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/101322i1CF111EFA25159F0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_0-1729087282084.png" alt="Tom_0-1729087282084.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And in the HTML output&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_1-1729087308438.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/101323i43005F713EA7CB9D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_1-1729087308438.png" alt="Tom_1-1729087308438.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Part of the confusion of your original question was your choice to show an SQL select statement instead one of the normal SAS procedures like PRINT, REPORT or TABULATE that is normally used to create a printed report of the data.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 14:02:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Line-break-in-ods/m-p/947680#M370935</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-10-16T14:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Line break in ods</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Line-break-in-ods/m-p/947787#M370968</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;: Thank you! That's exactly what I would have suggested (escapechar+newline). The other reason that the PROC SQL was confusing was that there were not any ODS Statements shown in the original code. So having the ODS EXCEL statements visible was/is essential.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 00:48:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Line-break-in-ods/m-p/947787#M370968</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2024-10-17T00:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Line break in ods</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Line-break-in-ods/m-p/948386#M371097</link>
      <description>&lt;P&gt;&amp;nbsp;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot for your support! It works perfectly &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just one remark, maybe it will be somehow useful for other people. When run the stored process from SAS Add-In (not using ods excel) we need to use proc report (instead from proc print).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Thanks again!&lt;BR /&gt;&amp;nbsp;Filip&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 13:53:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Line-break-in-ods/m-p/948386#M371097</guid>
      <dc:creator>filippo_kow</dc:creator>
      <dc:date>2024-10-21T13:53:49Z</dc:date>
    </item>
  </channel>
</rss>

