<?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: Updating Multiple External Files in Place in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Updating-Multiple-External-Files-in-Place/m-p/797943#M313732</link>
    <description>&lt;P&gt;Don't you want to use option&amp;nbsp;&lt;SPAN&gt;TERMSTR= to read your files instead of rewriting them?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Feb 2022 06:15:59 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2022-02-23T06:15:59Z</dc:date>
    <item>
      <title>Updating Multiple External Files in Place</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Updating-Multiple-External-Files-in-Place/m-p/797914#M313723</link>
      <description>&lt;P&gt;I found some code that updates some external text files I have that issues with line feeds, and the code fixes the issue, but I have lots of files, is there a way to adapt this to fix multiple files so they can import properly? I tried using the dummy/filevar option with a dataset that has my files listed code that work for one file&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	%let repA='@';
	%let repD='$';&lt;BR /&gt;data _null_;
		infile &amp;amp;dsnnme recfm=n sharebuffers;
		file &amp;amp;dsnnme recfm=n;
		retain open 0;
		input a $char1.;
		if a = '"' then open = ^(open);
		if open then do;
			if a = '0D'x then put &amp;amp;repD;
			else if a = '0A'x then put &amp;amp;repA;
		end;
	run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Tried this but can't get it to work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	%let repA='@';
	%let repD='$';
	
data _null_;
set WORK.NEW_FILES;
	   location=cats("mnt/ERM/Shared Services/SAS_Datasets/tempfiles/", FILE_NAME);
		infile dummy filevar=location end=done recfm=n sharebuffers;
		file location recfm=n;
do while(not done);  
		retain open 0;
		input a $char1.;
		if a = '"' then open = ^(open);
		if open then do;
			if a = '0D'x then put &amp;amp;repD;
			else if a = '0A'x then put &amp;amp;repA;
		end;
end;
	run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 01:24:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Updating-Multiple-External-Files-in-Place/m-p/797914#M313723</guid>
      <dc:creator>jimbobob</dc:creator>
      <dc:date>2022-02-23T01:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: Updating Multiple External Files in Place</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Updating-Multiple-External-Files-in-Place/m-p/797943#M313732</link>
      <description>&lt;P&gt;Don't you want to use option&amp;nbsp;&lt;SPAN&gt;TERMSTR= to read your files instead of rewriting them?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 06:15:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Updating-Multiple-External-Files-in-Place/m-p/797943#M313732</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2022-02-23T06:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Updating Multiple External Files in Place</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Updating-Multiple-External-Files-in-Place/m-p/798090#M313789</link>
      <description>&lt;P&gt;Thanks Chris, I've tried the termstr=LF as well as cr, crlf and every combo of scanover, truncover etc and it still doesn't read the data in properly, the issue I have is an unexpected LF in the middle of quoted data, so the full line is not read in for the record and instead the rest of the data is read in as another record. Is there another way to deal with issues like this, I would love to not have to rewrite the files. thanks&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbobob_0-1645635649914.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68777iACE06AAB2C582BC9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimbobob_0-1645635649914.png" alt="jimbobob_0-1645635649914.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 17:05:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Updating-Multiple-External-Files-in-Place/m-p/798090#M313789</guid>
      <dc:creator>jimbobob</dc:creator>
      <dc:date>2022-02-23T17:05:52Z</dc:date>
    </item>
  </channel>
</rss>

