<?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: Update External File in Place in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Update-External-File-in-Place/m-p/72192#M20906</link>
    <description>You have a hardcoded LRECL, yet you say that the incoming file "is not a fixed length".  Also, your PUT statement does not show a format/length for the variable ITEM.&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000171874.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000171874.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic/post:&lt;BR /&gt;
update external file inplace site:sas.com</description>
    <pubDate>Mon, 29 Mar 2010 20:30:56 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2010-03-29T20:30:56Z</dc:date>
    <item>
      <title>Update External File in Place</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Update-External-File-in-Place/m-p/72191#M20905</link>
      <description>I would like to update values in an external file. The file is not a fixed length. The code drops the first character of the next line after it updates.. What will be a good way to do this?&lt;BR /&gt;
&lt;BR /&gt;
Here is the code I use to update:&lt;BR /&gt;
data _null_;&lt;BR /&gt;
  infile file lrecl=400 truncover sharebuffers pad;&lt;BR /&gt;
  file file;&lt;BR /&gt;
  input @72 id $ 9.; &lt;BR /&gt;
  set upd key=id/unique end=done;&lt;BR /&gt;
  if _IORC_=0 then put _infile_ @81 item;&lt;BR /&gt;
  else do; &lt;BR /&gt;
    _error_=0; &lt;BR /&gt;
    end;&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 29 Mar 2010 19:40:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Update-External-File-in-Place/m-p/72191#M20905</guid>
      <dc:creator>Tasha</dc:creator>
      <dc:date>2010-03-29T19:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Update External File in Place</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Update-External-File-in-Place/m-p/72192#M20906</link>
      <description>You have a hardcoded LRECL, yet you say that the incoming file "is not a fixed length".  Also, your PUT statement does not show a format/length for the variable ITEM.&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000171874.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000171874.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic/post:&lt;BR /&gt;
update external file inplace site:sas.com</description>
      <pubDate>Mon, 29 Mar 2010 20:30:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Update-External-File-in-Place/m-p/72192#M20906</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-03-29T20:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Update External File in Place</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Update-External-File-in-Place/m-p/72193#M20907</link>
      <description>Thanks!! &lt;BR /&gt;
&lt;BR /&gt;
LRECL for the max length even though the lines are different lengths.&lt;BR /&gt;
Even with the variable length, the problem still exists..</description>
      <pubDate>Tue, 30 Mar 2010 12:57:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Update-External-File-in-Place/m-p/72193#M20907</guid>
      <dc:creator>Tasha</dc:creator>
      <dc:date>2010-03-30T12:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: Update External File in Place</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Update-External-File-in-Place/m-p/72194#M20908</link>
      <description>I believe that you will need to read the file, writing to a new file, then replace (not in-place though) the original file.  Suggest you review the DOC references, as well.  And again share any updated/modified code with the forum as a post-reply, ideally in your SAS execution log, not just the code piece.&lt;BR /&gt;
&lt;BR /&gt;
Explain the SAS environment and where the external file resides for additional guidance.&lt;BR /&gt;
&lt;BR /&gt;
Also, I question the use of PAD, if you have variable-length data to copy - each PUT will pad the output record to the LRECL= amount specified, I believe.  You should start with the bare minimum parameters and go from there.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: sbb

Message was edited by: sbb</description>
      <pubDate>Tue, 30 Mar 2010 13:31:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Update-External-File-in-Place/m-p/72194#M20908</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-03-30T13:31:07Z</dc:date>
    </item>
  </channel>
</rss>

