<?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 raw data and if it satisfies the condition move it to different folder in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/reading-raw-data-and-if-it-satisfies-the-condition-move-it-to/m-p/470965#M120570</link>
    <description>The whole task looks like something to be solved by os-scripts, but could you please explain again what you want to find in the files? Are you looking for a special header-line and the data is of no importance to decide whether the file has to be copied?</description>
    <pubDate>Mon, 18 Jun 2018 04:20:09 GMT</pubDate>
    <dc:creator>error_prone</dc:creator>
    <dc:date>2018-06-18T04:20:09Z</dc:date>
    <item>
      <title>reading raw data and if it satisfies the condition move it to different folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-raw-data-and-if-it-satisfies-the-condition-move-it-to/m-p/470767#M120485</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have 2k text files present in 2k different folders.i want to check for the data in text file where the variable name&lt;/P&gt;&lt;P&gt;should be in (name,nm,firname,first_nm,first_name). and all these variable i.e&amp;nbsp;&lt;SPAN&gt;name,nm,firname,first_nm,first_name&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;has a data in it which may be 009871,0987522,x065432,000984631 like this..and if i find this variables present i want to copy the folder containg that text file to different folder..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;please help me out how these can be done&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jun 2018 07:55:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-raw-data-and-if-it-satisfies-the-condition-move-it-to/m-p/470767#M120485</guid>
      <dc:creator>nid197</dc:creator>
      <dc:date>2018-06-16T07:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: reading raw data and if it satisfies the condition move it to different folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-raw-data-and-if-it-satisfies-the-condition-move-it-to/m-p/470772#M120487</link>
      <description>&lt;P&gt;Firstly, use OS command to list all these file path&lt;/P&gt;
&lt;P&gt;dir c:\temp\*.txt&amp;nbsp; /s /b&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After that use the following code to check data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;input x $80.;&lt;/P&gt;
&lt;P&gt;infile dummy filevar=x filename=fname end=last;&lt;/P&gt;
&lt;P&gt;do while(not last);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; input .................&lt;/P&gt;
&lt;P&gt;&amp;nbsp;..........&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;cards;&lt;/P&gt;
&lt;P&gt;c:\temp\a.txt&lt;/P&gt;
&lt;P&gt;c:\temp\b.txt&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jun 2018 10:21:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-raw-data-and-if-it-satisfies-the-condition-move-it-to/m-p/470772#M120487</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-06-16T10:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: reading raw data and if it satisfies the condition move it to different folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-raw-data-and-if-it-satisfies-the-condition-move-it-to/m-p/470812#M120501</link>
      <description>&lt;P&gt;1. Write some code to process and check one file/move it if required.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not exactly sure here, the details are a bit vague. You could be searching for a specific pattern in the first row (column names) or you could be looking for a value. Either way, using some Operating System search commands are probably the fastest approach.&lt;/P&gt;
&lt;P&gt;Here's an example of searching a single text file for a word, but not a pattern:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://gist.github.com/statgeek/26cf789d6da0ce941e447022fdccf0f4" target="_blank"&gt;https://gist.github.com/statgeek/26cf789d6da0ce941e447022fdccf0f4&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Get a list of all files&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/45/805.html" target="_blank"&gt;http://support.sas.com/kb/45/805.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Convert Step 1 to a macro&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stats.idre.ucla.edu/sas/seminars/sas-macros-introduction/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/seminars/sas-macros-introduction/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4. Use CALL EXECUTE or DOSUBL to call macro.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://gist.github.com/statgeek/beb97b1c6d4517dde3b2" target="_blank"&gt;https://gist.github.com/statgeek/beb97b1c6d4517dde3b2&lt;/A&gt;&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;This should let&amp;nbsp;get you started. Feel free to&amp;nbsp;post back you need further help, include your code, log and an explanation of what's not working.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/132373"&gt;@nid197&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have 2k text files present in 2k different folders.i want to check for the data in text file where the variable name&lt;/P&gt;
&lt;P&gt;should be in (name,nm,firname,first_nm,first_name). and all these variable i.e&amp;nbsp;&lt;SPAN&gt;name,nm,firname,first_nm,first_name&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;has a data in it which may be 009871,0987522,x065432,000984631 like this..and if i find this variables present i want to copy the folder containg that text file to different folder..&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;please help me out how these can be done&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jun 2018 22:52:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-raw-data-and-if-it-satisfies-the-condition-move-it-to/m-p/470812#M120501</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-06-16T22:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: reading raw data and if it satisfies the condition move it to different folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-raw-data-and-if-it-satisfies-the-condition-move-it-to/m-p/470965#M120570</link>
      <description>The whole task looks like something to be solved by os-scripts, but could you please explain again what you want to find in the files? Are you looking for a special header-line and the data is of no importance to decide whether the file has to be copied?</description>
      <pubDate>Mon, 18 Jun 2018 04:20:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-raw-data-and-if-it-satisfies-the-condition-move-it-to/m-p/470965#M120570</guid>
      <dc:creator>error_prone</dc:creator>
      <dc:date>2018-06-18T04:20:09Z</dc:date>
    </item>
  </channel>
</rss>

