<?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 get rid of CRLF in data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/get-rid-of-CRLF-in-data/m-p/539290#M148569</link>
    <description>&lt;P&gt;i've been reading through the other posts/questions about CRLF and i can't seem to get it to go without error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Situation: i have one data element, one Entry that has a CRLF at the end of the data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Creating a pipe delimited txt file and that CRLF is making things not work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When i do this:&lt;/P&gt;
&lt;P&gt;SELECT DISTINCT &lt;BR /&gt;TRANWARD(B.MED_SCHL_COND_NM,'0D0A'x,'') AS MED_SCHOOL_NM,&lt;/P&gt;
&lt;P&gt;B.MED_SCHL_LOC AS MED_SCHOOL_LOC&lt;/P&gt;
&lt;P&gt;FROM&amp;nbsp;GGDD.MED_SCHL B &lt;BR /&gt;&lt;BR /&gt;i get this error:&lt;BR /&gt;ERROR: CLI describe error: [IBM][CLI Driver][DB2] SQL0104N An unexpected token "X" was found following "". Expected tokens may &lt;BR /&gt;include: "AT MICROSECONDS MICROSECOND SECONDS SECOND MINUTES MINUTE HOURS". SQLSTATE=42601&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;if i try this:&lt;BR /&gt;&lt;BR /&gt;SELECT DISTINCT &lt;BR /&gt;prxchange('s/(\n|\r)//', -1, B.MED_SCHL_COND_NM) AS MED_SCHOOL_NM,&lt;/P&gt;
&lt;P&gt;B.MED_SCHL_LOC AS MED_SCHOOL_LOC &lt;BR /&gt;FROM GGDD.MED_SCHL B &lt;BR /&gt;&lt;BR /&gt;I get this error:&lt;BR /&gt;ERROR: CLI describe error: [IBM][CLI Driver][DB2] SQL0440N No authorized routine named "PRXCHANGE" of type "" having compatible &lt;BR /&gt;arguments was found. SQLSTATE=42884&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&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="Capture.JPG" style="width: 348px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27575i624B826934D2326E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Feb 2019 14:04:48 GMT</pubDate>
    <dc:creator>SVoldrich</dc:creator>
    <dc:date>2019-02-28T14:04:48Z</dc:date>
    <item>
      <title>get rid of CRLF in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-rid-of-CRLF-in-data/m-p/539290#M148569</link>
      <description>&lt;P&gt;i've been reading through the other posts/questions about CRLF and i can't seem to get it to go without error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Situation: i have one data element, one Entry that has a CRLF at the end of the data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Creating a pipe delimited txt file and that CRLF is making things not work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When i do this:&lt;/P&gt;
&lt;P&gt;SELECT DISTINCT &lt;BR /&gt;TRANWARD(B.MED_SCHL_COND_NM,'0D0A'x,'') AS MED_SCHOOL_NM,&lt;/P&gt;
&lt;P&gt;B.MED_SCHL_LOC AS MED_SCHOOL_LOC&lt;/P&gt;
&lt;P&gt;FROM&amp;nbsp;GGDD.MED_SCHL B &lt;BR /&gt;&lt;BR /&gt;i get this error:&lt;BR /&gt;ERROR: CLI describe error: [IBM][CLI Driver][DB2] SQL0104N An unexpected token "X" was found following "". Expected tokens may &lt;BR /&gt;include: "AT MICROSECONDS MICROSECOND SECONDS SECOND MINUTES MINUTE HOURS". SQLSTATE=42601&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;if i try this:&lt;BR /&gt;&lt;BR /&gt;SELECT DISTINCT &lt;BR /&gt;prxchange('s/(\n|\r)//', -1, B.MED_SCHL_COND_NM) AS MED_SCHOOL_NM,&lt;/P&gt;
&lt;P&gt;B.MED_SCHL_LOC AS MED_SCHOOL_LOC &lt;BR /&gt;FROM GGDD.MED_SCHL B &lt;BR /&gt;&lt;BR /&gt;I get this error:&lt;BR /&gt;ERROR: CLI describe error: [IBM][CLI Driver][DB2] SQL0440N No authorized routine named "PRXCHANGE" of type "" having compatible &lt;BR /&gt;arguments was found. SQLSTATE=42884&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&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="Capture.JPG" style="width: 348px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27575i624B826934D2326E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 14:04:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-rid-of-CRLF-in-data/m-p/539290#M148569</guid>
      <dc:creator>SVoldrich</dc:creator>
      <dc:date>2019-02-28T14:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: get rid of CRLF in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-rid-of-CRLF-in-data/m-p/539298#M148571</link>
      <description>&lt;P&gt;First option, remove the option to enter special characters on your database, it is never a good idea to allow this or capture those things.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next up, there is no such thing as&amp;nbsp;&lt;SPAN&gt;TRANWARD in SAS.&amp;nbsp; Is that a database function, if so you need to apply database syntax - nothing to do with SAS.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;What I would do is this:&lt;BR /&gt;1) Extract the data from the database, no processing, just create a dataset as it comes out, select *.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2) With the data you now have in a dataset, use a dataset and apply compress function to keep only numbers and characters - and any others you might want to keep:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  med_schl_cond_nm=compress(med_schl_cond_nm," ","kda");
run;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;3) Export that modified dataset.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 14:11:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-rid-of-CRLF-in-data/m-p/539298#M148571</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-28T14:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: get rid of CRLF in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-rid-of-CRLF-in-data/m-p/539303#M148574</link>
      <description>&lt;P&gt;where is the second double quote in you code for this statement&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #333333; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 21.33px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;TRANWARD(B.MED_SCHL_COND_NM,'0D0A'x,&lt;STRONG&gt;''&lt;/STRONG&gt;) AS MED_SCHOOL_NM,&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 14:18:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-rid-of-CRLF-in-data/m-p/539303#M148574</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-02-28T14:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: get rid of CRLF in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-rid-of-CRLF-in-data/m-p/539334#M148589</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/122002"&gt;@VDD&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;where is the second double quote in you code for this statement&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #333333; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 21.33px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;TRANWARD(B.MED_SCHL_COND_NM,'0D0A'x,&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;''&lt;/STRONG&gt;&lt;/FONT&gt;) AS MED_SCHOOL_NM,&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There is no single double quote, but two single quotes.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 15:16:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-rid-of-CRLF-in-data/m-p/539334#M148589</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-02-28T15:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: get rid of CRLF in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-rid-of-CRLF-in-data/m-p/539335#M148590</link>
      <description>i am doing this in a passthrough query is that my problem?

do functions like this need to be done explicitly?</description>
      <pubDate>Thu, 28 Feb 2019 15:22:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-rid-of-CRLF-in-data/m-p/539335#M148590</guid>
      <dc:creator>SVoldrich</dc:creator>
      <dc:date>2019-02-28T15:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: get rid of CRLF in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-rid-of-CRLF-in-data/m-p/539338#M148591</link>
      <description>i was able to get it to work by leaving my passthrough alone...

then creating another table that grabs those data elements

proc sql;
create table work.SCHOOL AS
SELECT 
Compress(MED_SCHOOL_NM,'0D0A'x) AS MED_SCHOOL_NM, MED_SCHOOL_LOC 
FROM WORK.SCHOOL1
;QUIT;</description>
      <pubDate>Thu, 28 Feb 2019 15:31:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-rid-of-CRLF-in-data/m-p/539338#M148591</guid>
      <dc:creator>SVoldrich</dc:creator>
      <dc:date>2019-02-28T15:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: get rid of CRLF in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/get-rid-of-CRLF-in-data/m-p/539561#M148688</link>
      <description>&lt;P&gt;So, effectively what I posted above then...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyways, if the code is passed through, that means all the code gets picked up and passed to the database, therefore it has to conform to syntax understood by the database, using functions that the database understands.&amp;nbsp; the '..'x is a SAS specific syntax, so the database probably wont understand it.&amp;nbsp; If you want to see in action, write the code directly in the database, you will see the problems.&lt;/P&gt;
&lt;P&gt;Oh, and please avoid coding all in uppercase, and use the code window, its the {i} above post area, so we can clearly read your code.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 08:59:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/get-rid-of-CRLF-in-data/m-p/539561#M148688</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-03-01T08:59:54Z</dc:date>
    </item>
  </channel>
</rss>

