<?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 What is Infile and file statements in SAS and what is the difference between them? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/What-is-Infile-and-file-statements-in-SAS-and-what-is-the/m-p/210494#M39023</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is Infile and file statements in SAS and what is the difference between them?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 31 Aug 2015 11:52:10 GMT</pubDate>
    <dc:creator>srdr1217</dc:creator>
    <dc:date>2015-08-31T11:52:10Z</dc:date>
    <item>
      <title>What is Infile and file statements in SAS and what is the difference between them?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-Infile-and-file-statements-in-SAS-and-what-is-the/m-p/210494#M39023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is Infile and file statements in SAS and what is the difference between them?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2015 11:52:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-Infile-and-file-statements-in-SAS-and-what-is-the/m-p/210494#M39023</guid>
      <dc:creator>srdr1217</dc:creator>
      <dc:date>2015-08-31T11:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: What is Infile and file statements in SAS and what is the difference between them?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-Infile-and-file-statements-in-SAS-and-what-is-the/m-p/224398#M40326</link>
      <description>&lt;P&gt;INFILE is used to denote an external file from whcih data is read into the SAS system.&lt;/P&gt;&lt;P&gt;FILE denotes an external file that data is written to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basic DATA step architecture:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA test;&lt;/P&gt;&lt;P&gt;INFILE "external_file.txt";&lt;/P&gt;&lt;P&gt;INPUT&lt;/P&gt;&lt;P&gt;&amp;nbsp; x1&lt;/P&gt;&lt;P&gt;&amp;nbsp; x2&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA _NULL_;&lt;/P&gt;&lt;P&gt;SET test;&lt;/P&gt;&lt;P&gt;FILE "another_external_file.txt";&lt;/P&gt;&lt;P&gt;PUT&lt;/P&gt;&lt;P&gt;&amp;nbsp; x1&lt;/P&gt;&lt;P&gt;&amp;nbsp; x2&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2015 14:06:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-Infile-and-file-statements-in-SAS-and-what-is-the/m-p/224398#M40326</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-09-08T14:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: What is Infile and file statements in SAS and what is the difference between them?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-Infile-and-file-statements-in-SAS-and-what-is-the/m-p/224410#M40332</link>
      <description>&lt;P&gt;Hi ... you can try this ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;* create a data file (no data set created);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data _null_;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;* specify the name of the data file;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;file 'c:\new.txt';&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;* create some numeric variables and give them all a value of 99;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;retain x1 x2 x3 99;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;* write the values of the variables to the file specified in the FILE statement;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;put x1-x3;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;* read the data file you just created and create a data set;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data new;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;* specify the location of the data file;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;infile 'c:\new.txt';&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;* read the data;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;input x1-x3;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;* look at your data set;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;proc print data=new;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Another way to remember the difference between FILE and INFILE is to think of the statements PUT and INPUT. &amp;nbsp;PUT statements are associated with FILE (write to a file) and INPUT statements are associated with INFILE (read data from an already existing file).&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2015 15:03:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-Infile-and-file-statements-in-SAS-and-what-is-the/m-p/224410#M40332</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2015-09-08T15:03:42Z</dc:date>
    </item>
  </channel>
</rss>

