SUPPORT / SAMPLES & SAS NOTES
 

Support

Sample 26065: Remove carriage return and linefeed characters within quoted strings

DetailsCodeResultsAboutRate It

If a flat file contains embedded carriage return (CR) and linefeed characters (LF) inside double quotes, SAS will interpret them as end of line markers. This may cause your file to be read incorrectly.

This example replaces CR/LF characters within double quotes with other printable characters. CR/LF characters outside of double quotes are untouched.

In this sample, the external file is updated in place. You cannot separate the input and output because the code uses shared buffers.

You should make a copy of your file before running this sample on it.




These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.