<?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: PROC SQL:  Creating a table from a flat file (text file). in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Creating-a-table-from-a-flat-file-text-file/m-p/66277#M18924</link>
    <description>This is a sample of my current code.&lt;BR /&gt;
&lt;BR /&gt;
filename test_in ftp "'RANV.LSIL.DDMAST.R21.NEWEXTR(0)'"&lt;BR /&gt;
SYMBOLGEN:  Macro variable MVS_ENV resolves to SYS2&lt;BR /&gt;
6240                   host="&amp;amp;mvs_env"&lt;BR /&gt;
SYMBOLGEN:  Macro variable FTPUSER resolves to FTPS099&lt;BR /&gt;
6240 !                                 user="&amp;amp;ftpuser"&lt;BR /&gt;
SYMBOLGEN:  Macro variable FTPPASS resolves to {sas001}Mjl0aW1lMDg=&lt;BR /&gt;
6240 !                                                 pass="&amp;amp;ftppass"  ;&lt;BR /&gt;
6241&lt;BR /&gt;
6242&lt;BR /&gt;
6243   data test_curr ;&lt;BR /&gt;
6244&lt;BR /&gt;
6245    * if _n_ gt 99 then stop ;&lt;BR /&gt;
6246&lt;BR /&gt;
6247     infile acls_in pad missover recfm=f lrecl=10000 ;&lt;BR /&gt;
6248&lt;BR /&gt;
6249     ***  org2 is bank, org3 is area, org4 is city, org5 is branch ;&lt;BR /&gt;
6250&lt;BR /&gt;
6251     input&lt;BR /&gt;
6252&lt;BR /&gt;
6253       @1      bknum               s370fpd03.&lt;BR /&gt;
6254       @4      appl                s370fpd02.&lt;BR /&gt;
6255       @6      acct                s370fpd10.&lt;BR /&gt;
6256       @16     source_ind          $ebcdic01.&lt;BR /&gt;
6257       @17     tybrk               s370fpd03.&lt;BR /&gt;
6258       @20     stat                s370fzd01.&lt;BR /&gt;
6259       @21     prcscde             $ebcdic01.&lt;BR /&gt;
6260       @22     org1_in             s370fpd03.&lt;BR /&gt;
6261       @25     org2_in             s370fpd03.&lt;BR /&gt;
6262       @28     org3_in             s370fpd03.&lt;BR /&gt;
6263       @31     org4_in             s370fpd03.</description>
    <pubDate>Tue, 09 Mar 2010 18:34:35 GMT</pubDate>
    <dc:creator>chandler</dc:creator>
    <dc:date>2010-03-09T18:34:35Z</dc:date>
    <item>
      <title>PROC SQL:  Creating a table from a flat file (text file).</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Creating-a-table-from-a-flat-file-text-file/m-p/66275#M18922</link>
      <description>I'm using SAS 9.1.3 with Service Pack 4, on a Windows XP Professional platform. I've been reading data from a flat (text) file out on our mainframe via FTP to transfer the data and create a table/dataset on our Windows server, the traditional SAS way, in a Data Step with infile statements, input statements and column input.  Can you do this in a Create Table statement in PROC SQL as well?  I don't see it in the SAS SQL Procedure documentation.  I've taken a course on SAS SQL 1: Essentials, but it didn't address the flat (text) file import question.  Is it even efficient to try this in PROC SQL?</description>
      <pubDate>Tue, 09 Mar 2010 17:24:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Creating-a-table-from-a-flat-file-text-file/m-p/66275#M18922</guid>
      <dc:creator>chandler</dc:creator>
      <dc:date>2010-03-09T17:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL:  Creating a table from a flat file (text file).</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Creating-a-table-from-a-flat-file-text-file/m-p/66276#M18923</link>
      <description>You will want to share whatever SAS code you are using today for an accurate reply/feedback.  Suggest includng a small data-sample from your mainframe file and a short PROC PRINT or PUTLOG _ALL_;  SAS ouput data sample as well.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Tue, 09 Mar 2010 18:18:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Creating-a-table-from-a-flat-file-text-file/m-p/66276#M18923</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-03-09T18:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL:  Creating a table from a flat file (text file).</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Creating-a-table-from-a-flat-file-text-file/m-p/66277#M18924</link>
      <description>This is a sample of my current code.&lt;BR /&gt;
&lt;BR /&gt;
filename test_in ftp "'RANV.LSIL.DDMAST.R21.NEWEXTR(0)'"&lt;BR /&gt;
SYMBOLGEN:  Macro variable MVS_ENV resolves to SYS2&lt;BR /&gt;
6240                   host="&amp;amp;mvs_env"&lt;BR /&gt;
SYMBOLGEN:  Macro variable FTPUSER resolves to FTPS099&lt;BR /&gt;
6240 !                                 user="&amp;amp;ftpuser"&lt;BR /&gt;
SYMBOLGEN:  Macro variable FTPPASS resolves to {sas001}Mjl0aW1lMDg=&lt;BR /&gt;
6240 !                                                 pass="&amp;amp;ftppass"  ;&lt;BR /&gt;
6241&lt;BR /&gt;
6242&lt;BR /&gt;
6243   data test_curr ;&lt;BR /&gt;
6244&lt;BR /&gt;
6245    * if _n_ gt 99 then stop ;&lt;BR /&gt;
6246&lt;BR /&gt;
6247     infile acls_in pad missover recfm=f lrecl=10000 ;&lt;BR /&gt;
6248&lt;BR /&gt;
6249     ***  org2 is bank, org3 is area, org4 is city, org5 is branch ;&lt;BR /&gt;
6250&lt;BR /&gt;
6251     input&lt;BR /&gt;
6252&lt;BR /&gt;
6253       @1      bknum               s370fpd03.&lt;BR /&gt;
6254       @4      appl                s370fpd02.&lt;BR /&gt;
6255       @6      acct                s370fpd10.&lt;BR /&gt;
6256       @16     source_ind          $ebcdic01.&lt;BR /&gt;
6257       @17     tybrk               s370fpd03.&lt;BR /&gt;
6258       @20     stat                s370fzd01.&lt;BR /&gt;
6259       @21     prcscde             $ebcdic01.&lt;BR /&gt;
6260       @22     org1_in             s370fpd03.&lt;BR /&gt;
6261       @25     org2_in             s370fpd03.&lt;BR /&gt;
6262       @28     org3_in             s370fpd03.&lt;BR /&gt;
6263       @31     org4_in             s370fpd03.</description>
      <pubDate>Tue, 09 Mar 2010 18:34:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Creating-a-table-from-a-flat-file-text-file/m-p/66277#M18924</guid>
      <dc:creator>chandler</dc:creator>
      <dc:date>2010-03-09T18:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL:  Creating a table from a flat file (text file).</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Creating-a-table-from-a-flat-file-text-file/m-p/66278#M18925</link>
      <description>In short, No.  PROC SQL only works on data that can be associated with a LIBNAME or connected to a database server.</description>
      <pubDate>Tue, 09 Mar 2010 19:07:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Creating-a-table-from-a-flat-file-text-file/m-p/66278#M18925</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2010-03-09T19:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL:  Creating a table from a flat file (text file).</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Creating-a-table-from-a-flat-file-text-file/m-p/66279#M18926</link>
      <description>Thanks, Doc.</description>
      <pubDate>Tue, 09 Mar 2010 19:29:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Creating-a-table-from-a-flat-file-text-file/m-p/66279#M18926</guid>
      <dc:creator>chandler</dc:creator>
      <dc:date>2010-03-09T19:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL:  Creating a table from a flat file (text file).</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Creating-a-table-from-a-flat-file-text-file/m-p/66280#M18927</link>
      <description>How about creating a dataset view over your flat file and then manipulating that with SQL?&lt;BR /&gt;
&lt;BR /&gt;
/**************************************************************************/&lt;BR /&gt;
/* Create a demo file to play with */&lt;BR /&gt;
filename flat 'c:\temp\test.dat';&lt;BR /&gt;
data _NULL_;&lt;BR /&gt;
	file flat;&lt;BR /&gt;
	do i = 1 to 1000000;&lt;BR /&gt;
		j = 'a';&lt;BR /&gt;
		put i j;&lt;BR /&gt;
	end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
/* Method 1 - Traditional data set read, followed by SQL manipulations */&lt;BR /&gt;
data size_data;&lt;BR /&gt;
	infile flat;&lt;BR /&gt;
	input _a _b $;&lt;BR /&gt;
run;&lt;BR /&gt;
proc sql;&lt;BR /&gt;
	create table data2 as&lt;BR /&gt;
		select *&lt;BR /&gt;
		from size_data&lt;BR /&gt;
	;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
/* Method 2 - Proc SQL over a view */&lt;BR /&gt;
data size_view /view=size_view;&lt;BR /&gt;
	infile flat;&lt;BR /&gt;
	input _a _b $;&lt;BR /&gt;
run;&lt;BR /&gt;
proc sql;&lt;BR /&gt;
	create table view2 as&lt;BR /&gt;
		select *&lt;BR /&gt;
		from size_view&lt;BR /&gt;
	;&lt;BR /&gt;
quit;&lt;BR /&gt;
/**************************************************************************/&lt;BR /&gt;
&lt;BR /&gt;
I haven't tested the performance extensivly, but the above test is pretty promising.</description>
      <pubDate>Mon, 15 Mar 2010 15:14:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Creating-a-table-from-a-flat-file-text-file/m-p/66280#M18927</guid>
      <dc:creator>WillDobson</dc:creator>
      <dc:date>2010-03-15T15:14:43Z</dc:date>
    </item>
  </channel>
</rss>

