<?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: Concantenating with a Carriage Return instead of Space in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Concantenating-with-a-Carriage-Return-instead-of-Space/m-p/856999#M338591</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/439113"&gt;@kovamk&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes. At least I never got it to work. I remember a Stackowerflow post that addressed the problem, and it said something about the code actually being there, but not working until F2 is pressed in every cell, so to me that equals "not working".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found a paper with a receipe to use ODS / proc print with a tagset to cheate the excel table. I haven´t tried it, but it is worth exploring:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.pharmasug.org/proceedings/2014/CC/PharmaSUG-2014-CC07.pdf" target="_blank"&gt;https://www.pharmasug.org/proceedings/2014/CC/PharmaSUG-2014-CC07.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Feb 2023 08:54:53 GMT</pubDate>
    <dc:creator>ErikLund_Jensen</dc:creator>
    <dc:date>2023-02-03T08:54:53Z</dc:date>
    <item>
      <title>Concantenating with a Carriage Return instead of Space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concantenating-with-a-Carriage-Return-instead-of-Space/m-p/615416#M180011</link>
      <description>&lt;P&gt;The code is below.&amp;nbsp; When the data gets concatenated the way it works right now is that it puts a space in between each line its concentrating.&amp;nbsp; what i would like it to do is put a carriage return instead.&amp;nbsp; Can anyone help me with this modification.&amp;nbsp; I have not found anything (prob because i couldn't determine the right search words) that will do this for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data  work.order_notes;
length order_notes $ 10000 /* need to be the max */;
     set sorted;
     by odr_odr_number dt_crtd;
     retain order_notes;
     if first.odr_odr_number then order_notes = scratch_pad;
     else order_notes=trim(order_notes) || ' ' || trim(scratch_pad);
     DROP SCRATCH_PAD;
     if last.odr_odr_number then output;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;thanks to anyone that can help me with this one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dean&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 18:20:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concantenating-with-a-Carriage-Return-instead-of-Space/m-p/615416#M180011</guid>
      <dc:creator>D_Z_</dc:creator>
      <dc:date>2020-01-06T18:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: Concantenating with a Carriage Return instead of Space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concantenating-with-a-Carriage-Return-instead-of-Space/m-p/615439#M180021</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/9120"&gt;@D_Z_&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;The code is below.&amp;nbsp; When the data gets concatenated the way it works right now is that it puts a space in between each line its concentrating.&amp;nbsp; what i would like it to do is put a carriage return instead.&amp;nbsp; Can anyone help me with this modification.&amp;nbsp; I have not found anything (prob because i couldn't determine the right search words) that will do this for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data  work.order_notes;
length order_notes $ 10000 /* need to be the max */;
     set sorted;
     by odr_odr_number dt_crtd;
     retain order_notes;
     if first.odr_odr_number then order_notes = scratch_pad;
     else order_notes=trim(order_notes) || ' ' || trim(scratch_pad);
     DROP SCRATCH_PAD;
     if last.odr_odr_number then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;thanks to anyone that can help me with this one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dean&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Well, on windows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;0x0D&lt;/CODE&gt; is hexadecimal for carriage return&lt;/P&gt;&lt;P&gt;0x0A is hex for line feed&lt;/P&gt;&lt;P&gt;0x0D0A is hex for carriage return followed by line feed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can used one of these hex values as the separator instead of a space but you are creating a character variable in a SAS data set so I'm not sure how this helps you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;order_notes=trim(order_notes) || '0x0D0A' || trim(scratch_pad);&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hrm, you might need to tell SAS that 0x0D0A is hex, maybe like this:&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;order_notes=trim(order_notes) || '0x0D0A'x || trim(scratch_pad);&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 19:45:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concantenating-with-a-Carriage-Return-instead-of-Space/m-p/615439#M180021</guid>
      <dc:creator>DWilson</dc:creator>
      <dc:date>2020-01-06T19:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Concantenating with a Carriage Return instead of Space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concantenating-with-a-Carriage-Return-instead-of-Space/m-p/615440#M180022</link>
      <description>&lt;P&gt;Hi D_Z,&lt;/P&gt;&lt;P&gt;replace ' ' in the concatenation with the hex code for CR&amp;nbsp; '0D'x&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 19:46:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concantenating-with-a-Carriage-Return-instead-of-Space/m-p/615440#M180022</guid>
      <dc:creator>jhammouda</dc:creator>
      <dc:date>2020-01-06T19:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Concantenating with a Carriage Return instead of Space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concantenating-with-a-Carriage-Return-instead-of-Space/m-p/615460#M180026</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/9120"&gt;@D_Z_&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/83374"&gt;@DWilson&lt;/a&gt;&amp;nbsp;suggests, use a hex constant in the concatenation. But use only '0D0A'x for a Windows line break, or '0A'x for a Linux line break. Don't use '0x0D0A or '0x0A' because '0x' is not a hex character code and causes an error in SAS. Valid hex codes are 00-FF.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I wonder why you would want those line breaks. Normally one would do a lot to get rid of them, because they have no meaning inside SAS and isnt' shown in a SAS table view. They may cause a lot of trouble when they come out of SAS. They will generate line breaks If data is written to (say) a CSV file, so the file is corrupt afterwards with broken records. They don't do any harm in export to Excel, but they don't work either, they just disappear.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 20:27:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concantenating-with-a-Carriage-Return-instead-of-Space/m-p/615460#M180026</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2020-01-06T20:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Concantenating with a Carriage Return instead of Space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concantenating-with-a-Carriage-Return-instead-of-Space/m-p/856967#M338581</link>
      <description>&lt;P&gt;Hi Erik, so are you saying when using sas to export data into excel, you can't use a carriage return to have the data come out in 2 rows in excel?&amp;nbsp; i.e. I'm trying to get this wording split into 2 lines in excel:&lt;/P&gt;&lt;P&gt;LABEL HEDIS_COLON_GAP = 'Colorectal Cancer Screening (Display for MA)' ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like the final result to have 'Colorectal Cancer Screening' on the first line in the cell and (Display for MA) on the second line in the cell.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Colorectal Cancer Screening&lt;/P&gt;&lt;P&gt;(Display for MA)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I can't get it to work using any of the code that has been suggested online. I either get an error or the code doesn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Mike&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 22:43:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concantenating-with-a-Carriage-Return-instead-of-Space/m-p/856967#M338581</guid>
      <dc:creator>kovamk</dc:creator>
      <dc:date>2023-02-02T22:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Concantenating with a Carriage Return instead of Space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concantenating-with-a-Carriage-Return-instead-of-Space/m-p/856999#M338591</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/439113"&gt;@kovamk&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes. At least I never got it to work. I remember a Stackowerflow post that addressed the problem, and it said something about the code actually being there, but not working until F2 is pressed in every cell, so to me that equals "not working".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found a paper with a receipe to use ODS / proc print with a tagset to cheate the excel table. I haven´t tried it, but it is worth exploring:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.pharmasug.org/proceedings/2014/CC/PharmaSUG-2014-CC07.pdf" target="_blank"&gt;https://www.pharmasug.org/proceedings/2014/CC/PharmaSUG-2014-CC07.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 08:54:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concantenating-with-a-Carriage-Return-instead-of-Space/m-p/856999#M338591</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2023-02-03T08:54:53Z</dc:date>
    </item>
  </channel>
</rss>

