<?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: Input/Infile Statements in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Input-Infile-Statements/m-p/186973#M303949</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or, you could build a small import program, the below for instance assumes text for quoted values and numeric for not:&lt;/P&gt;&lt;P&gt;/* test data CSV looks like this */&lt;/P&gt;&lt;P&gt;/*&lt;/P&gt;&lt;P&gt;TOWN,POP,IN&lt;/P&gt;&lt;P&gt;"London",123456,"UK"&lt;/P&gt;&lt;P&gt;"Glasgow",34243,"UK"&lt;/P&gt;&lt;P&gt;"Brussels",7876,"Belgium"&lt;/P&gt;&lt;P&gt;*/&lt;/P&gt;&lt;P&gt;data read_data;&lt;BR /&gt;&amp;nbsp; length buffer $2000.;&lt;BR /&gt;&amp;nbsp; infile "s:\temp\rob\test.csv" dsd missover lrecl=32767 dlm="¬";&lt;BR /&gt;&amp;nbsp; input buffer $;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data a/*_null_*/;&lt;BR /&gt;&amp;nbsp; merge read_data (obs=1 in=head) read_data (obs=2 in=first_row firstobs=2 rename=(buffer=myrow));&lt;BR /&gt;&amp;nbsp; i=1;&lt;BR /&gt;&amp;nbsp; call execute('data want (drop=buffer); &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set read_data (firstobs=2);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length ');&lt;BR /&gt;&amp;nbsp; /* Assign lengths based on first row */&lt;BR /&gt;&amp;nbsp; do while (scan(buffer,i,",") ne "");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute(" "||scan(buffer,i,","));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if index(scan(myrow,i,","),'"')&amp;gt;0 then call execute(' $20');&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else call execute(' 8');&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i=i+1;&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;&amp;nbsp; i=1;&lt;BR /&gt;&amp;nbsp; call execute(';');&lt;BR /&gt;&amp;nbsp; /* Split up the data */&lt;BR /&gt;&amp;nbsp; do while (scan(buffer,i,",") ne "");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute(" "||scan(buffer,i,",")||'=scan(buffer,'||strip(put(i,best.))||',",");');&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i=i+1;&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;&amp;nbsp; call execute('; run;');&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Sep 2014 10:07:52 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2014-09-05T10:07:52Z</dc:date>
    <item>
      <title>Input/Infile Statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-Infile-Statements/m-p/186971#M303947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the code below which I am using to import the attached .csv file into SAS; I would like to retain whatever variable headings as SAS variable names (not all columns in the .csv file have a title). My biggest issue with the code below is that, as you can see, once imported into SAS, the variable values in the input statement below have their values overlapping with each other. Seeing that my variable values are of varying lengths, my data gets really ugly. Is there a neat way to import my variable values and preserving their values intact?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data WORK.NCDebt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile '/Source/InputFileNCDebt.csv' dsd;&lt;/P&gt;&lt;P&gt;input Var1 $10. Var2 $11-20 Var3 $21-30 Var4 $31-40 Var5 $41-50;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 21:55:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-Infile-Statements/m-p/186971#M303947</guid>
      <dc:creator>maroulator</dc:creator>
      <dc:date>2014-09-04T21:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Input/Infile Statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-Infile-Statements/m-p/186972#M303948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you have a CSV file you do not want to use a column mode input statement.&lt;/P&gt;&lt;P&gt;Now to the question of how to use the fact that VAR1 and VAR3 have a column heading in row one of your input file.&lt;/P&gt;&lt;P&gt;One way would be to read the names in and generate a macro variable with the names.&amp;nbsp; It is easier if you just hard code how many columns to read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;_null_&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;infile&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'c:\downloads\InputFileNCDebt.csv'&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;dsd&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; obs=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; name $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;32&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; namelist $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;200&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; i=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;to&lt;/SPAN&gt; &lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;5&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; name @ ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; name = coalescec(name,cats(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'VAR'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,i));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; namelist=catx(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,namelist,name);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; symputx(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'namelist'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,namelist);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; WORK.NCDebt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;infile&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'c:\downloads\InputFileNCDebt.csv'&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;dsd&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;firstobs&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;2&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &amp;amp;namelist $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;10&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &amp;amp;namelist ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;print&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;width&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;min&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New';"&gt; Obs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CUSIP&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VAR2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Instrument&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VAR4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VAR5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New';"&gt; 1&amp;nbsp;&amp;nbsp;&amp;nbsp; 912810QQ4&amp;nbsp;&amp;nbsp;&amp;nbsp; 912810QQ4 BOND&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; US TREASUR&amp;nbsp;&amp;nbsp;&amp;nbsp; Govt&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New';"&gt; 2&amp;nbsp;&amp;nbsp;&amp;nbsp; 912810QB7&amp;nbsp;&amp;nbsp;&amp;nbsp; 912810QB7 BOND&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; US TREASUR&amp;nbsp;&amp;nbsp;&amp;nbsp; Govt&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New';"&gt; 3&amp;nbsp;&amp;nbsp;&amp;nbsp; 912810PX0&amp;nbsp;&amp;nbsp;&amp;nbsp; 912810PX0 BOND&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; US TREASUR&amp;nbsp;&amp;nbsp;&amp;nbsp; Govt&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New';"&gt; 4&amp;nbsp;&amp;nbsp;&amp;nbsp; 912810EJ3&amp;nbsp;&amp;nbsp;&amp;nbsp; 912810EJ3 BOND&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; US TREASUR&amp;nbsp;&amp;nbsp;&amp;nbsp; Govt&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New';"&gt; 5&amp;nbsp;&amp;nbsp;&amp;nbsp; 912810EF1&amp;nbsp;&amp;nbsp;&amp;nbsp; 912810EF1 BOND&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; US TREASUR&amp;nbsp;&amp;nbsp;&amp;nbsp; Govt&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New';"&gt; 6&amp;nbsp;&amp;nbsp;&amp;nbsp; 3135G0LN1&amp;nbsp;&amp;nbsp;&amp;nbsp; 3135G0LN1 BOND&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FANNIE MAE&amp;nbsp;&amp;nbsp;&amp;nbsp; Corp&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New';"&gt; 7&amp;nbsp;&amp;nbsp;&amp;nbsp; 3135G0HB2&amp;nbsp;&amp;nbsp;&amp;nbsp; 3135G0HB2 BOND&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FANNIE MAE&amp;nbsp;&amp;nbsp;&amp;nbsp; Corp&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New';"&gt; 8&amp;nbsp;&amp;nbsp;&amp;nbsp; 31398AZV7&amp;nbsp;&amp;nbsp;&amp;nbsp; 31398AZV7 BOND&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FANNIE MAE&amp;nbsp;&amp;nbsp;&amp;nbsp; Corp&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New';"&gt; 9&amp;nbsp;&amp;nbsp;&amp;nbsp; 31398AYY2&amp;nbsp;&amp;nbsp;&amp;nbsp; 31398AYY2 BOND&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FANNIE MAE&amp;nbsp;&amp;nbsp;&amp;nbsp; Corp&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&amp;nbsp;&amp;nbsp;&amp;nbsp; 31359MW41 31359MW41&amp;nbsp;&amp;nbsp;&amp;nbsp; Agency Deb&amp;nbsp;&amp;nbsp;&amp;nbsp; FANNIE MAE&amp;nbsp;&amp;nbsp;&amp;nbsp; Corp&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 22:15:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-Infile-Statements/m-p/186972#M303948</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-09-04T22:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: Input/Infile Statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-Infile-Statements/m-p/186973#M303949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or, you could build a small import program, the below for instance assumes text for quoted values and numeric for not:&lt;/P&gt;&lt;P&gt;/* test data CSV looks like this */&lt;/P&gt;&lt;P&gt;/*&lt;/P&gt;&lt;P&gt;TOWN,POP,IN&lt;/P&gt;&lt;P&gt;"London",123456,"UK"&lt;/P&gt;&lt;P&gt;"Glasgow",34243,"UK"&lt;/P&gt;&lt;P&gt;"Brussels",7876,"Belgium"&lt;/P&gt;&lt;P&gt;*/&lt;/P&gt;&lt;P&gt;data read_data;&lt;BR /&gt;&amp;nbsp; length buffer $2000.;&lt;BR /&gt;&amp;nbsp; infile "s:\temp\rob\test.csv" dsd missover lrecl=32767 dlm="¬";&lt;BR /&gt;&amp;nbsp; input buffer $;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data a/*_null_*/;&lt;BR /&gt;&amp;nbsp; merge read_data (obs=1 in=head) read_data (obs=2 in=first_row firstobs=2 rename=(buffer=myrow));&lt;BR /&gt;&amp;nbsp; i=1;&lt;BR /&gt;&amp;nbsp; call execute('data want (drop=buffer); &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set read_data (firstobs=2);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length ');&lt;BR /&gt;&amp;nbsp; /* Assign lengths based on first row */&lt;BR /&gt;&amp;nbsp; do while (scan(buffer,i,",") ne "");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute(" "||scan(buffer,i,","));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if index(scan(myrow,i,","),'"')&amp;gt;0 then call execute(' $20');&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else call execute(' 8');&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i=i+1;&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;&amp;nbsp; i=1;&lt;BR /&gt;&amp;nbsp; call execute(';');&lt;BR /&gt;&amp;nbsp; /* Split up the data */&lt;BR /&gt;&amp;nbsp; do while (scan(buffer,i,",") ne "");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute(" "||scan(buffer,i,",")||'=scan(buffer,'||strip(put(i,best.))||',",");');&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i=i+1;&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;&amp;nbsp; call execute('; run;');&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2014 10:07:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-Infile-Statements/m-p/186973#M303949</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-09-05T10:07:52Z</dc:date>
    </item>
  </channel>
</rss>

