<?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: Can any one help me to write a program for the following question? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Can-any-one-help-me-to-write-a-program-for-the-following/m-p/152013#M262562</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your question actually has two twists: 1) stream in all of the files 2) find and count WORD 'proc'. For 1), there are many ways to do it, the following code 's approach is just one of them. Do a google search, you will find many. The solution below does not require to know the file names, but it will investigate all of the files inside the same folder. 2). Since you mentioned WORD, so 'proc1' or 'xxproc' seems not be qualified, and I assume case is not important here. Otherwise, COUNT() will be very straightforward. So both FINDW() and some PRX functions will complete the task, here only FINDW()is showing.&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; folder=h:\sas files\;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;filename&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; inf &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;pipe&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'dir /b "h:\sas files\"'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; fileloc&amp;nbsp; _file $ &lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;300&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;infile&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; inf &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;truncover&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; fileloc $ ; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;/* read instream data&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;/* The INFILE statement closes the current file &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and opens a new one if FILELOC changes value &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when INFILE executes&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _file=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;folder."&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;||fileloc;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;infile&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;dummy&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;filevar&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;= _file&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=done &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;truncover&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;/* DONE set to 1 when last input record read&amp;nbsp; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;while&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;(not done);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;/* Read all input records from the currently&amp;nbsp; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; var $ &lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;100.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; start=&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;while&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc=findw(var,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'proc'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;,start,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'i'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; rc=&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;then&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; leave;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ct+&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; start=rc+&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;4&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ct=&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; rc start var;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;The code has been tested on 9.3 M2, modify the folder address etc to accommodate your own settings.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Good luck,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Haikuo &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Aug 2014 18:07:03 GMT</pubDate>
    <dc:creator>haikuobian</dc:creator>
    <dc:date>2014-08-08T18:07:03Z</dc:date>
    <item>
      <title>Can any one help me to write a program for the following question?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-any-one-help-me-to-write-a-program-for-the-following/m-p/152012#M262561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a folder containing 5 .sas files, I would like to search particular word (Ex: proc) in the files and I want to know how many times the word is present in each file, if not present display a message not present.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EX: &lt;STRONG&gt;Folder name&lt;/STRONG&gt;: SAS files&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;.sas files:&lt;/STRONG&gt; 1. data.sas 2. proc.sas 3. data2.sas 4. freq.sas 5. data3.sas&lt;/P&gt;&lt;P&gt;I would like to know the word "proc" is present in each file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Aug 2014 17:39:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-any-one-help-me-to-write-a-program-for-the-following/m-p/152012#M262561</guid>
      <dc:creator>yanamadala85</dc:creator>
      <dc:date>2014-08-06T17:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can any one help me to write a program for the following question?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-any-one-help-me-to-write-a-program-for-the-following/m-p/152013#M262562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your question actually has two twists: 1) stream in all of the files 2) find and count WORD 'proc'. For 1), there are many ways to do it, the following code 's approach is just one of them. Do a google search, you will find many. The solution below does not require to know the file names, but it will investigate all of the files inside the same folder. 2). Since you mentioned WORD, so 'proc1' or 'xxproc' seems not be qualified, and I assume case is not important here. Otherwise, COUNT() will be very straightforward. So both FINDW() and some PRX functions will complete the task, here only FINDW()is showing.&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; folder=h:\sas files\;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;filename&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; inf &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;pipe&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'dir /b "h:\sas files\"'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; fileloc&amp;nbsp; _file $ &lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;300&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;infile&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; inf &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;truncover&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; fileloc $ ; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;/* read instream data&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;/* The INFILE statement closes the current file &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and opens a new one if FILELOC changes value &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when INFILE executes&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _file=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;folder."&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;||fileloc;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;infile&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;dummy&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;filevar&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;= _file&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=done &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;truncover&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;/* DONE set to 1 when last input record read&amp;nbsp; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;while&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;(not done);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;/* Read all input records from the currently&amp;nbsp; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; var $ &lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;100.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; start=&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;while&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc=findw(var,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'proc'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;,start,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'i'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; rc=&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;then&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; leave;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ct+&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; start=rc+&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;4&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ct=&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; rc start var;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;The code has been tested on 9.3 M2, modify the folder address etc to accommodate your own settings.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Good luck,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Haikuo &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Aug 2014 18:07:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-any-one-help-me-to-write-a-program-for-the-following/m-p/152013#M262562</guid>
      <dc:creator>haikuobian</dc:creator>
      <dc:date>2014-08-08T18:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can any one help me to write a program for the following question?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-any-one-help-me-to-write-a-program-for-the-following/m-p/152014#M262563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Haikuo,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Thank you very much for your answer, actually in my question one more twist is there, that is I would like to display how many times the word "proc" is available in each file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Ex; Final result will be displayed like the below in log/output&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Word proc existed in &lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;data.sas: 57 times&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Word proc existed in proc&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;.sas: 11 times&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Word proc existed in data1&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;.sas: 21 times&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Word proc existed in means&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;.sas: 31 times&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;Word proc existed in data3&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;.sas: 41 times&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; If not existed in any of the files it would display like the below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; background: white; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; word proc does not existed in data3.sas&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Aug 2014 04:01:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-any-one-help-me-to-write-a-program-for-the-following/m-p/152014#M262563</guid>
      <dc:creator>yanamadala85</dc:creator>
      <dc:date>2014-08-09T04:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can any one help me to write a program for the following question?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-any-one-help-me-to-write-a-program-for-the-following/m-p/152015#M262564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;/*if you have SAS 9.4*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;infile&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;cards&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;truncover&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; file :$ &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;20.&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; ct;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; symputx(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'file'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;,file);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; ct&amp;gt;&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; symputx(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'ct'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;,ct);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;_n_=dosubl(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'%put Word proc existed in &amp;amp;file.: &amp;amp;ct times;'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; _n_=dosubl(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'%put word proc does not existed in &amp;amp;file.;'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;data3.sas 15&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;date4.sas 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green; background: white;"&gt;/*if no SAS 9.4*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;infile&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;cards&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;truncover&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; file :$ &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;20.&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; ct;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; symputx(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'n'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;,_n_);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; symputx(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'file'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;||strip(_n_),file);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; ct&amp;gt;&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; symputx(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'ct'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;||strip(_n_),ct);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; execute(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'%put Word proc existed in &amp;amp;&amp;amp;file&amp;amp;n.: &amp;amp;&amp;amp;ct&amp;amp;n. times;'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; call execute(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'%put word proc does not existed in &amp;amp;&amp;amp;file&amp;amp;n.;'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;data3.sas 15&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;date4.sas 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Please note, the 'test' is showing the data structure you get from my previous answer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Good luck,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Haikuo&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Aug 2014 12:23:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-any-one-help-me-to-write-a-program-for-the-following/m-p/152015#M262564</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-08-09T12:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Can any one help me to write a program for the following question?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-any-one-help-me-to-write-a-program-for-the-following/m-p/152016#M262565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much &lt;SPAN style="color: #000000; font-family: 'Courier New'; background-color: #ffffff;"&gt;Haikuo&lt;/SPAN&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Venkatesh Y&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Aug 2014 04:10:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-any-one-help-me-to-write-a-program-for-the-following/m-p/152016#M262565</guid>
      <dc:creator>yanamadala85</dc:creator>
      <dc:date>2014-08-11T04:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Can any one help me to write a program for the following question?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-any-one-help-me-to-write-a-program-for-the-following/m-p/152017#M262566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;filename&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt; inf &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;pipe&lt;/SPAN&gt; &lt;SPAN style="background: white; color: purple; font-family: 'Courier New';"&gt;'dir /b "&amp;amp;folder"';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New';"&gt;Hi Haikuo,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New';"&gt;I want use the filename statement in the Macro, for that one I have written like the above but unfortunately I'm getting the error, can you please guide me in this regard.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New';"&gt;Best&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New';"&gt;Venkatesh&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2014 23:26:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-any-one-help-me-to-write-a-program-for-the-following/m-p/152017#M262566</guid>
      <dc:creator>yanamadala85</dc:creator>
      <dc:date>2014-08-21T23:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Can any one help me to write a program for the following question?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-any-one-help-me-to-write-a-program-for-the-following/m-p/152018#M262567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;amp;folder won't resolve inside single quotes so you need to apply the single quotes differently. Here is one way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; background: white; color: black; font-size: 9pt;"&gt;filename inf pipe %str(%')dir /b "&amp;amp;folder"%str(%');&lt;/SPAN&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 00:13:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-any-one-help-me-to-write-a-program-for-the-following/m-p/152018#M262567</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2014-08-22T00:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can any one help me to write a program for the following question?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-any-one-help-me-to-write-a-program-for-the-following/m-p/152019#M262568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A UNIX solution looks like that, done with system tools (no SAS needed):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cd &lt;EM&gt;wherever_your_files_are&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;for FILE in *.sas&lt;/P&gt;&lt;P&gt;do&lt;/P&gt;&lt;P&gt;echo "$FILE:"&lt;/P&gt;&lt;P&gt;grep -i -w proc $FILE|wc -l&lt;/P&gt;&lt;P&gt;done&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It only assumes that you do not have more than one proc statement in one line of program text.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 05:56:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-any-one-help-me-to-write-a-program-for-the-following/m-p/152019#M262568</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-08-22T05:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can any one help me to write a program for the following question?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-any-one-help-me-to-write-a-program-for-the-following/m-p/152020#M262569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Beside what SASkiwi pointed out, the problem here is that, DIR command requires double quotes if folder names contain 'blank'. So a working syntax may look like the following:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;filename&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; inf &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;pipe&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;"dir /b %str(%"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;)&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal;"&gt;folder.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%str&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;(%")&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;"; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck,&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 13:21:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-any-one-help-me-to-write-a-program-for-the-following/m-p/152020#M262569</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-08-22T13:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: Can any one help me to write a program for the following question?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-any-one-help-me-to-write-a-program-for-the-following/m-p/152021#M262570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just read the files word for word and let SAS do the math.&amp;nbsp; If you do not want the total count across all files then add the NWAYoption to PROC SUMMARY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; path=C:\My SAS Files;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; step1 / &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;view&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=step1 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; fname filename word $&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;200&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;infile&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;path\*.sas"&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;filename&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=fname &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;dlm&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;' ;'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; word @@ ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; filename=scan(fname,-&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'\/'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; proc_count=upcase(word)=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'PROC'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;keep&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; filename proc_count;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;summary&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=step1 &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;noprint&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;class&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; filename ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; proc_count ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;output&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=proc_count &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;= ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;print&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 13:49:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-any-one-help-me-to-write-a-program-for-the-following/m-p/152021#M262570</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-08-22T13:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Can any one help me to write a program for the following question?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-any-one-help-me-to-write-a-program-for-the-following/m-p/152022#M262571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I were you, at this point, I would pick &lt;A __default_attr="2431" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;'s solution in a heartbeat. It is much more succinct, elegant and did it all in SAS. Bookmarked!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 14:02:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-any-one-help-me-to-write-a-program-for-the-following/m-p/152022#M262571</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-08-22T14:02:34Z</dc:date>
    </item>
  </channel>
</rss>

