<?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: Read input data  into SAS using INFILE in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Read-input-data-into-SAS-using-INFILE/m-p/625397#M184312</link>
    <description>&lt;P&gt;Use DLM="|" option in the infile statement. Then look in the SAS informat library to find the unput format appropriate for each field in your input statement.&lt;/P&gt;</description>
    <pubDate>Mon, 17 Feb 2020 19:05:25 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2020-02-17T19:05:25Z</dc:date>
    <item>
      <title>Read input data  into SAS using INFILE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-input-data-into-SAS-using-INFILE/m-p/625388#M184310</link>
      <description>&lt;P&gt;Hi, Can you help me to read below format .txt file into SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data Record looks like below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1234567890|202020| |12345.000000000000|12345.000000000000| |2020-01-01T05:29:50.000-05:00|2022-01-31&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me to read into SAS.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2020 18:54:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-input-data-into-SAS-using-INFILE/m-p/625388#M184310</guid>
      <dc:creator>Banu</dc:creator>
      <dc:date>2020-02-17T18:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: Read input data  into SAS using INFILE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-input-data-into-SAS-using-INFILE/m-p/625397#M184312</link>
      <description>&lt;P&gt;Use DLM="|" option in the infile statement. Then look in the SAS informat library to find the unput format appropriate for each field in your input statement.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2020 19:05:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-input-data-into-SAS-using-INFILE/m-p/625397#M184312</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-02-17T19:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Read input data  into SAS using INFILE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-input-data-into-SAS-using-INFILE/m-p/625398#M184313</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data imported;
infile "path to file" dlm="|" truncover;

*specify the informat of the variables - this tells SAS how they look so they are read in properly;

informat var7 anydtdtm. var8 yymmdd10.;
format var7 datetime20. var8 date9.;

input var1 var2 var3 var4 var5 var6 var7 var8;
;;;;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Fill in the variable names with something that means something to you. If the order of the variables is important you'll want to specify the informats for all your variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/134610"&gt;@Banu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi, Can you help me to read below format .txt file into SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data Record looks like below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1234567890|202020| |12345.000000000000|12345.000000000000| |2020-01-01T05:29:50.000-05:00|2022-01-31&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help me to read into SAS.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2020 19:05:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-input-data-into-SAS-using-INFILE/m-p/625398#M184313</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-02-17T19:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Read input data  into SAS using INFILE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-input-data-into-SAS-using-INFILE/m-p/625518#M184377</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input;
length temp $ 2000;
retain temp;
temp=cats(temp,_infile_);
if countw(temp,'|','m')=8 then do;
t1=scan(temp,1,'|','m');
t2=scan(temp,2,'|','m');
t3=scan(temp,3,'|','m');
t4=scan(temp,4,'|','m');
t5=scan(temp,5,'|','m');
t6=scan(temp,6,'|','m');
t7=scan(temp,7,'|','m');
t8=scan(temp,8,'|','m');
output;call missing(temp);end;
cards;
1234567890|202020| |12345.000000000000|12345.000000000000| 
|2020-01-01T05:29:50.000-05:00|2022-01-31
1234567890|202020| |12345.000000000000|12345.000000000000| 
|2020-01-01T05:29:50.000-05:00|2022-01-31
;



proc print;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Feb 2020 05:44:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-input-data-into-SAS-using-INFILE/m-p/625518#M184377</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-02-18T05:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Read input data  into SAS using INFILE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-input-data-into-SAS-using-INFILE/m-p/625535#M184381</link>
      <description>&lt;P&gt;Just use the correct delimiter in the infile statement, and proper informats for the date and datetime values. Since the source of the data was prudent in using ISO 8601 formats, use the proper informats:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
infile datalines dlm='|' dsd truncover;
input
  var1
  var2
  var3 $
  var4
  var5
  var6 $
  var7 :e8601dz29.
  var8 :e8601da10.
;
format
  var7 e8601dz29.3
  var8 e8601da10.
;
datalines;
1234567890|202020| |12345.000000000000|12345.000000000000| |2020-01-01T05:29:50.123-05:00|2022-01-31
;

proc print data=want noobs;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;   var1        var2     var3     var4     var5    var6    var7                             var8

1234567890    202020            12345    12345            2020-01-01T10:29:50.123+00:00    2022-01-31
&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Feb 2020 08:38:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-input-data-into-SAS-using-INFILE/m-p/625535#M184381</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-02-18T08:38:43Z</dc:date>
    </item>
  </channel>
</rss>

