<?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 how to extract 3 file at a time in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-extract-3-file-at-a-time/m-p/54782#M11618</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to extract 3 file at time,one is in .txt format and other is in .csv format ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ashwini&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 27 Nov 2011 06:28:27 GMT</pubDate>
    <dc:creator>Ashwini</dc:creator>
    <dc:date>2011-11-27T06:28:27Z</dc:date>
    <item>
      <title>how to extract 3 file at a time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-extract-3-file-at-a-time/m-p/54782#M11618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to extract 3 file at time,one is in .txt format and other is in .csv format ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ashwini&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Nov 2011 06:28:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-extract-3-file-at-a-time/m-p/54782#M11618</guid>
      <dc:creator>Ashwini</dc:creator>
      <dc:date>2011-11-27T06:28:27Z</dc:date>
    </item>
    <item>
      <title>how to extract 3 file at a time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-extract-3-file-at-a-time/m-p/54783#M11619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to provide more info like: extract from what? to what 3rd format (you only listed 2)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Nov 2011 15:11:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-extract-3-file-at-a-time/m-p/54783#M11619</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-11-27T15:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 3 file at a time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-extract-3-file-at-a-time/m-p/54784#M11620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Daer Art,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 3 file 1st one is in text file in .txt format and other two file are in CSV file in .csv format.&lt;/P&gt;&lt;P&gt;I want to merge the data in three file and make a one dataset.&lt;/P&gt;&lt;P&gt;1.How i take this file in sas environment using a single code?&lt;/P&gt;&lt;P&gt;2.How i merge these file?&lt;/P&gt;&lt;P&gt; 3.How I send this output in raw data?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ashwini&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2011 10:48:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-extract-3-file-at-a-time/m-p/54784#M11620</guid>
      <dc:creator>Ashwini</dc:creator>
      <dc:date>2011-11-28T10:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 3 file at a time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-extract-3-file-at-a-time/m-p/54785#M11621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Depends upon how similar the files are and exactly how you have to import them.&amp;nbsp; Yes, it MAY be doable in one datastep.&amp;nbsp; Below, I create two csv files, one space delimited file and one tab delimited file, and then import all 4 in one datastep.&amp;nbsp; However, without knowing what SAS skills you have, or what your files actually look like, this may be an extreme oversimplification:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*create test data*/&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input x y z;&lt;/P&gt;&lt;P&gt;&amp;nbsp; file "c:\art\test\csv1.csv";&lt;/P&gt;&lt;P&gt;&amp;nbsp; put x "," y "," z;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;1 2 3&lt;/P&gt;&lt;P&gt;4 5 6&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input x y z;&lt;/P&gt;&lt;P&gt;&amp;nbsp; file "c:\art\test\csv2.csv";&lt;/P&gt;&lt;P&gt;&amp;nbsp; put x "," y "," z;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;7 8 9&lt;/P&gt;&lt;P&gt;10 11 12&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input x y z;&lt;/P&gt;&lt;P&gt;&amp;nbsp; file "c:\art\test\txt1.txt";&lt;/P&gt;&lt;P&gt;&amp;nbsp; put x y z;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;13 14 15&lt;/P&gt;&lt;P&gt;16 17 18&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input x y z;&lt;/P&gt;&lt;P&gt;&amp;nbsp; file "c:\art\test\txt2.txt";&lt;/P&gt;&lt;P&gt;&amp;nbsp; put x "09"x y "09"x z;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;19 20 21&lt;/P&gt;&lt;P&gt;22 23 24&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*get file names*/&lt;/P&gt;&lt;P&gt;filename indata pipe "dir c:\art\test\*.* /b";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*import all 4 files in 1 datastep*/&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length fil2read $100;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat fn $50.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile indata truncover;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input fn &amp;amp;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; fil2read="c:\art\test\"||fn;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if scan(fil2read,-1) eq "csv" then delim=",";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else delim=" ";&lt;/P&gt;&lt;P&gt;&amp;nbsp; done=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile dummy filevar=fil2read dlm=delim end=done;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do while(not done);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input Var1-var3;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2011 13:40:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-extract-3-file-at-a-time/m-p/54785#M11621</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-11-28T13:40:17Z</dc:date>
    </item>
  </channel>
</rss>

