<?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: looping the file name input in SAS macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/looping-the-file-name-input-in-SAS-macro/m-p/523367#M142187</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;If you want to read multiple files into one single step, you can simply use wildcards in infile statement&lt;/P&gt;
&lt;P&gt;Lets your file names are&amp;nbsp;&lt;/P&gt;
&lt;P&gt;monthly1&lt;/P&gt;
&lt;P&gt;monthly2&lt;/P&gt;
&lt;P&gt;monthly3&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;......&lt;/P&gt;
&lt;P&gt;monthly500&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;THen you can simple write a code -&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data mydateste;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;infile "&lt;SPAN&gt;/saswas/Lev1/Applications/SASAntiMoneyLaundering/5.1/BUJO/watchlist/monthly*.csv" DSD;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Limitation-&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;All files should have same structure&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Dec 2018 10:49:55 GMT</pubDate>
    <dc:creator>LittlesasMaster</dc:creator>
    <dc:date>2018-12-24T10:49:55Z</dc:date>
    <item>
      <title>looping the file name input in SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/looping-the-file-name-input-in-SAS-macro/m-p/523331#M142182</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help on below code and below code is working fine but now we are having 500 monthly files in the watch-list folder.&lt;/P&gt;&lt;P&gt;(&lt;SPAN&gt;/saswas/Lev1/Applications/SASAntiMoneyLaundering/5.1/BUJO/watchlist/) and i want to load the all file using the below code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;What is the solution for this issue ?&lt;/P&gt;&lt;P&gt;how can i loop these files and pass it to the %&lt;SPAN&gt;wl_dwjn_process macro ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;how to&amp;nbsp; create array with file name and store it ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro aml_dwjn_monthly;&lt;BR /&gt;%local dwjn_file_monthly;&lt;BR /&gt;%let dwjn_file_monthly=/saswas/Lev1/Applications/SASAntiMoneyLaundering/5.1/BUJO/watchlist/monthly.csv;&lt;BR /&gt;%put &amp;amp;dwjn_file_monthly;&lt;BR /&gt;/* Get the current runasofdate */&lt;BR /&gt;%aml_getrundate;&lt;BR /&gt;%put NOTE: AML: RUNASOFDATE: &amp;amp;runasofdate;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* USER SETTINGS */&lt;/P&gt;&lt;P&gt;%wl_dwjn_process&lt;BR /&gt;(&lt;BR /&gt;dwjn_file=&amp;amp;dwjn_file_monthly,&lt;BR /&gt;load_type=N,&lt;BR /&gt;allow_invalid=FULL,&lt;BR /&gt;bulkload=%str(bulkload=yes)&lt;BR /&gt;);&lt;BR /&gt;%mend aml_dwjn_monthly;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;many thanks in advance.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Dec 2018 17:33:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/looping-the-file-name-input-in-SAS-macro/m-p/523331#M142182</guid>
      <dc:creator>MG18</dc:creator>
      <dc:date>2018-12-23T17:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: looping the file name input in SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/looping-the-file-name-input-in-SAS-macro/m-p/523351#M142184</link>
      <description>&lt;P&gt;You didn't post any data, the source code of the macros used or rhw log generated, making it really difficult to help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If all files have the same structure, you don't nee macro code, you can import all with a single data-step using wildcards in the infile-statement you will find many posts explaining the this further.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Dec 2018 06:16:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/looping-the-file-name-input-in-SAS-macro/m-p/523351#M142184</guid>
      <dc:creator>error_prone</dc:creator>
      <dc:date>2018-12-24T06:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: looping the file name input in SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/looping-the-file-name-input-in-SAS-macro/m-p/523366#M142186</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/43025"&gt;@error_prone&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have added the piece of code which is running successfully with single file (i.e. monthly.csv ) but now we are having 500 file with same&amp;nbsp;format as old file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%let dwjn_file_monthly=/saswas/Lev1/Applications/SASAntiMoneyLaundering/5.1/BUJO/watchlist/&lt;STRONG&gt;monthly.csv;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Can you please provide the link for the&amp;nbsp;single data-step using wildcards ? This will be a great help.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Dec 2018 10:02:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/looping-the-file-name-input-in-SAS-macro/m-p/523366#M142186</guid>
      <dc:creator>MG18</dc:creator>
      <dc:date>2018-12-24T10:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: looping the file name input in SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/looping-the-file-name-input-in-SAS-macro/m-p/523367#M142187</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;If you want to read multiple files into one single step, you can simply use wildcards in infile statement&lt;/P&gt;
&lt;P&gt;Lets your file names are&amp;nbsp;&lt;/P&gt;
&lt;P&gt;monthly1&lt;/P&gt;
&lt;P&gt;monthly2&lt;/P&gt;
&lt;P&gt;monthly3&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;......&lt;/P&gt;
&lt;P&gt;monthly500&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;THen you can simple write a code -&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data mydateste;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;infile "&lt;SPAN&gt;/saswas/Lev1/Applications/SASAntiMoneyLaundering/5.1/BUJO/watchlist/monthly*.csv" DSD;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Limitation-&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;All files should have same structure&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Dec 2018 10:49:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/looping-the-file-name-input-in-SAS-macro/m-p/523367#M142187</guid>
      <dc:creator>LittlesasMaster</dc:creator>
      <dc:date>2018-12-24T10:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: looping the file name input in SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/looping-the-file-name-input-in-SAS-macro/m-p/523405#M142192</link>
      <description>&lt;P&gt;Can we use same method to pass the file name for &lt;STRONG&gt;sas macro ? I have mentioned whole running SAS macro code .&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Dec 2018 15:58:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/looping-the-file-name-input-in-SAS-macro/m-p/523405#M142192</guid>
      <dc:creator>MG18</dc:creator>
      <dc:date>2018-12-24T15:58:28Z</dc:date>
    </item>
  </channel>
</rss>

