<?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: SAS DI in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/212313#M4998</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;In the External File definition you can use a '*' as wildcard to pick up all files following a naming pattern:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;IMG __jive_id="11245" alt="Capture.PNG" class="jive-image" src="https://communities.sas.com/legacyfs/online/11245_Capture.PNG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If there are not too many countries then I would keep things simple. Store your source files in a separate folder per country, define an external file definition per country and run it as a separate job per country.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="11246" alt="Capture.PNG" class="jive-image" src="https://communities.sas.com/legacyfs/online/11246_Capture.PNG" /&gt;&lt;/P&gt;&lt;P&gt;Store the extracted data in a staging table per country (or if you have a data base which allows for concurrent insert then it could be a single table). Then run all the extract jobs in parallel (or whatever is right for your case). If extracting into a staging table per country then run in the end a single job which appends all the data (or which creates a view over all the country staging tables).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What would be nice to have is also a variable which tells you from which source file the data has been sourced. On a coding level this could look like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data india;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; length source_file _source_file $50;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; infile 'C:\temp\india\*.txt' truncover dlm=',' dsd FILENAME=_source_file;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; input var $;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; source_file=_source_file;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I haven't found a way to define an external file in a way that such code gets generated except if overwriting the generated INFILE statement under "File Parameters/Advanced/Override generated..." and then add something like:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;length source_file _source_file $50;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;infile 'C:\Temp\india\*.txt'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lrecl = 256&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delimiter = ','&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dsd&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; missover&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; firstobs = 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filename=_source_file; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;source_file=_source_file;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jul 2015 08:43:32 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2015-07-28T08:43:32Z</dc:date>
    <item>
      <title>SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/212312#M4997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a businees users in different countries, each country have their file format(ex: .csv, txt,mdb...).&lt;/P&gt;&lt;P&gt;But within a same country their might be multiple customers and they can send the multiple files.suppose in india we have 5 customers in 5 different states they can send 5 files from 5 states, all file formats of india are same&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to create a process to load files of each country in target table using SAS DI,the number of files per country may vary at any time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help on this would be helpful and appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Srini&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 07:57:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/212312#M4997</guid>
      <dc:creator>gsreddy</dc:creator>
      <dc:date>2015-07-28T07:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/212313#M4998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;In the External File definition you can use a '*' as wildcard to pick up all files following a naming pattern:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;IMG __jive_id="11245" alt="Capture.PNG" class="jive-image" src="https://communities.sas.com/legacyfs/online/11245_Capture.PNG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If there are not too many countries then I would keep things simple. Store your source files in a separate folder per country, define an external file definition per country and run it as a separate job per country.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="11246" alt="Capture.PNG" class="jive-image" src="https://communities.sas.com/legacyfs/online/11246_Capture.PNG" /&gt;&lt;/P&gt;&lt;P&gt;Store the extracted data in a staging table per country (or if you have a data base which allows for concurrent insert then it could be a single table). Then run all the extract jobs in parallel (or whatever is right for your case). If extracting into a staging table per country then run in the end a single job which appends all the data (or which creates a view over all the country staging tables).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What would be nice to have is also a variable which tells you from which source file the data has been sourced. On a coding level this could look like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data india;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; length source_file _source_file $50;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; infile 'C:\temp\india\*.txt' truncover dlm=',' dsd FILENAME=_source_file;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; input var $;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; source_file=_source_file;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I haven't found a way to define an external file in a way that such code gets generated except if overwriting the generated INFILE statement under "File Parameters/Advanced/Override generated..." and then add something like:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;length source_file _source_file $50;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;infile 'C:\Temp\india\*.txt'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lrecl = 256&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delimiter = ','&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dsd&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; missover&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; firstobs = 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filename=_source_file; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;source_file=_source_file;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 08:43:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/212313#M4998</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-07-28T08:43:32Z</dc:date>
    </item>
  </channel>
</rss>

