<?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: Reading Data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-Data/m-p/498738#M132615</link>
    <description>&lt;P&gt;Tmp is just short for temporary, could be called anything you like.&amp;nbsp; I was only answering your question:&lt;/P&gt;
&lt;P&gt;"&lt;SPAN&gt;I'm asked to research on&amp;nbsp;"how to read a text file in SAS when a folder name is known but the file name is unknown".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;That is how you get a list of filenames, from there its up to you how you import them.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;What I will say, again, is that you cannot base an process on something which is unknown, it&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;will not work&lt;/STRONG&gt;&lt;/U&gt;.&amp;nbsp; Refer to my previous post on the reasons why.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Sep 2018 14:05:47 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-09-25T14:05:47Z</dc:date>
    <item>
      <title>Reading Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Data/m-p/498711#M132602</link>
      <description>&lt;P&gt;Dear SAS Users&lt;/P&gt;&lt;P&gt;I'm asked to research on&amp;nbsp;"how to read a text file in SAS when a folder name is known but the file name is unknown". I checked all my notes but nothing is coming from there.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 12:52:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Data/m-p/498711#M132602</guid>
      <dc:creator>ZosTa</dc:creator>
      <dc:date>2018-09-25T12:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Data/m-p/498714#M132605</link>
      <description>&lt;P&gt;you could use members to create a SAS dataset list of files that are in the folder.&amp;nbsp; Then use infile within a data step and read in all those text files into SAS datasets.&amp;nbsp; You should request a record layout for the text files so that the information is consistence for interpretation.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 12:59:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Data/m-p/498714#M132605</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-09-25T12:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Data/m-p/498715#M132606</link>
      <description>&lt;P&gt;Is this some sort of learning exercise?&amp;nbsp; You can get a directory listing (assuming you have OS access):&lt;/P&gt;
&lt;PRE&gt;filename tmp pipe 'dir "c:\path\*.txt" /b';

data want;
  length tmp $200;
  infile tmp;
  input tmp $;
run;
&lt;/PRE&gt;
&lt;P&gt;Will get you a list of files in that folder with .txt extension.&amp;nbsp; Its really a very daft question however.&amp;nbsp; If you don't know what to expect, how can you program for it?&amp;nbsp; Is it a delimited file, a fixed format file, or something else.&amp;nbsp; What structure will it be in?&amp;nbsp; What if its xml or Json?&amp;nbsp; What if its not .txt extension but csv?&amp;nbsp; Its a bit of a daft question, you need to fix in certain paramters and such like &lt;U&gt;&lt;STRONG&gt;before&lt;/STRONG&gt;&lt;/U&gt; you even look at coding.&amp;nbsp; I.e. file transfer specs, what file, when, what structure, via what medium etc.&amp;nbsp; Process documentation, how is file to be read, to what structure, where to store etc.&amp;nbsp; Once documentation is in place, then code.&lt;/P&gt;
&lt;P&gt;If of course its a learning question...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 12:59:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Data/m-p/498715#M132606</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-09-25T12:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Data/m-p/498726#M132611</link>
      <description>&lt;P&gt;Thank you for the assistance&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 13:31:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Data/m-p/498726#M132611</guid>
      <dc:creator>ZosTa</dc:creator>
      <dc:date>2018-09-25T13:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Data/m-p/498730#M132614</link>
      <description>&lt;P&gt;This works in a way, it only displays the names of the files. I believe the next move is to write a code that imports the files and create datasets, am I correct?&amp;nbsp; Please explain the "tmp" in the code.&lt;/P&gt;&lt;P&gt;Thank you for&amp;nbsp;the response.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 13:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Data/m-p/498730#M132614</guid>
      <dc:creator>ZosTa</dc:creator>
      <dc:date>2018-09-25T13:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Data/m-p/498738#M132615</link>
      <description>&lt;P&gt;Tmp is just short for temporary, could be called anything you like.&amp;nbsp; I was only answering your question:&lt;/P&gt;
&lt;P&gt;"&lt;SPAN&gt;I'm asked to research on&amp;nbsp;"how to read a text file in SAS when a folder name is known but the file name is unknown".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;That is how you get a list of filenames, from there its up to you how you import them.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;What I will say, again, is that you cannot base an process on something which is unknown, it&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;will not work&lt;/STRONG&gt;&lt;/U&gt;.&amp;nbsp; Refer to my previous post on the reasons why.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 14:05:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Data/m-p/498738#M132615</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-09-25T14:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Data/m-p/498742#M132618</link>
      <description>&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 14:16:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Data/m-p/498742#M132618</guid>
      <dc:creator>ZosTa</dc:creator>
      <dc:date>2018-09-25T14:16:42Z</dc:date>
    </item>
  </channel>
</rss>

