<?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: How can i import a DBF file using infile statement? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-can-i-import-a-DBF-file-using-infile-statement/m-p/553775#M9413</link>
    <description>&lt;P&gt;You might want to explain exactly what you mean by :"i dont want to use the proc import because sometimes the proc runs wrong"&lt;/P&gt;
&lt;P&gt;One of the issues with DBF if that the same extension is used for multiple actual file types. Plus additional headaches if there is a MEMO field such as&lt;/P&gt;
&lt;PRE&gt;PROC IMPORT OUT=WORK.TEST
    DATAFILE='orders.dbf'
    DBMS=DBFMEMO REPLACE;
RUN;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN class="xis-noteGenText"&gt;Note: &lt;/SPAN&gt;Any DBF file that you plan to import to a SAS data set should be in a tabular format. All items in a given column should represent the same type of data. If the DBF file contains inconsistent data, such as a row of underscores, hyphens, or blanks, delete these rows before converting the file. It is recommended that you make a backup copy of your DBF table before you make these modifications.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might be able to use PROC DBF&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;proc dbf db2='/sasdata/BSEG/HOLDING/riscos_ctba/solucoes/dataset/dev/BENEFPAGOS.DBF'
     out=work.benefpagos;
run; &lt;/PRE&gt;
&lt;P&gt;if your file is DB3 or DB4 then use either of those in place of DB2= in the code above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Apr 2019 19:41:12 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-04-24T19:41:12Z</dc:date>
    <item>
      <title>How can i import a DBF file using infile statement?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-can-i-import-a-DBF-file-using-infile-statement/m-p/553659#M9401</link>
      <description>&lt;P&gt;I have to import a DBF file with a specified layout, so i dont want to use the proc import because sometimes the proc runs wrong...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When i try to import the DBF file using the infile statement, only the first line is loaded to the dataset..... Warning and errors dont appear in the log...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can i do this import?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.benefpagos;
    infile '/sasdata/BSEG/HOLDING/riscos_ctba/solucoes/dataset/dev/BENEFPAGOS.DBF'
        LRECL=183
        encoding="LATIN1"
        termstr=crlf
	missover
	dsd;
    input   COD_CIA          : $CHAR5.
	        DT_SOLIC         : $CHAR8.
	        NOM_PARTIC       : $CHAR30.
	        NUM_PROP         : $CHAR10.
	        NUM_PROC         : $CHAR20.
	        TIPO_PROD        : BEST32.
	        TIPO_PLANO       : BEST32.
	        CPF_PARTIC       : $CHAR11.
	        NOM_BENEF        : $CHAR30.
	        CPF_BENEF        : $CHAR11.
	        CNPJ_CIA         : $CHAR14.
	        DT_EVENTO        : $CHAR8.
	        VR_PROV          : BEST32.
	        DT_PAGTO         : $CHAR8.
	        VR_PAGO          : BEST32. ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Apr 2019 14:45:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-can-i-import-a-DBF-file-using-infile-statement/m-p/553659#M9401</guid>
      <dc:creator>Tosin</dc:creator>
      <dc:date>2019-04-24T14:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: How can i import a DBF file using infile statement?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-can-i-import-a-DBF-file-using-infile-statement/m-p/553695#M9405</link>
      <description>&lt;P&gt;You cannot read .dbf files with a data step, a they are not pure text files.&lt;/P&gt;
&lt;P&gt;If you have SAS/ACCESS to PC Files licensed, you can use proc import with dbms=dbf.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 16:05:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-can-i-import-a-DBF-file-using-infile-statement/m-p/553695#M9405</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-04-24T16:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: How can i import a DBF file using infile statement?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-can-i-import-a-DBF-file-using-infile-statement/m-p/553775#M9413</link>
      <description>&lt;P&gt;You might want to explain exactly what you mean by :"i dont want to use the proc import because sometimes the proc runs wrong"&lt;/P&gt;
&lt;P&gt;One of the issues with DBF if that the same extension is used for multiple actual file types. Plus additional headaches if there is a MEMO field such as&lt;/P&gt;
&lt;PRE&gt;PROC IMPORT OUT=WORK.TEST
    DATAFILE='orders.dbf'
    DBMS=DBFMEMO REPLACE;
RUN;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN class="xis-noteGenText"&gt;Note: &lt;/SPAN&gt;Any DBF file that you plan to import to a SAS data set should be in a tabular format. All items in a given column should represent the same type of data. If the DBF file contains inconsistent data, such as a row of underscores, hyphens, or blanks, delete these rows before converting the file. It is recommended that you make a backup copy of your DBF table before you make these modifications.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might be able to use PROC DBF&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;proc dbf db2='/sasdata/BSEG/HOLDING/riscos_ctba/solucoes/dataset/dev/BENEFPAGOS.DBF'
     out=work.benefpagos;
run; &lt;/PRE&gt;
&lt;P&gt;if your file is DB3 or DB4 then use either of those in place of DB2= in the code above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 19:41:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-can-i-import-a-DBF-file-using-infile-statement/m-p/553775#M9413</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-04-24T19:41:12Z</dc:date>
    </item>
  </channel>
</rss>

