<?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 DI Studio: Get  External File last modified date in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-Get-External-File-last-modified-date/m-p/430246#M13338</link>
    <description>&lt;P&gt;Hello Community,&lt;/P&gt;
&lt;P&gt;Environment: DI Studio 4.8, on a Unix platform&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd like to&amp;nbsp;create a user defined transform, or piece of user code, that checks the last modified date of an&amp;nbsp;external file (so I can decide whether it should be reloaded). This is going to be used for multiple external files, so it needs&amp;nbsp;to be generalised and neatly packaged, not a one-off bit of hardcoding.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I have a physical file name, I can use FINFO to get what I need.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But an external file can't be connected to the input of a user defined transform, and while it can be connected to the input of a user defined code transform, its name and physical location aren't then made available in macro variables to the code within.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestions as to how I might get hold of the file name, or another approach to getting the last mod date?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Dave&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jan 2018 01:49:19 GMT</pubDate>
    <dc:creator>dkb</dc:creator>
    <dc:date>2018-01-24T01:49:19Z</dc:date>
    <item>
      <title>DI Studio: Get  External File last modified date</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-Get-External-File-last-modified-date/m-p/430246#M13338</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;
&lt;P&gt;Environment: DI Studio 4.8, on a Unix platform&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd like to&amp;nbsp;create a user defined transform, or piece of user code, that checks the last modified date of an&amp;nbsp;external file (so I can decide whether it should be reloaded). This is going to be used for multiple external files, so it needs&amp;nbsp;to be generalised and neatly packaged, not a one-off bit of hardcoding.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I have a physical file name, I can use FINFO to get what I need.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But an external file can't be connected to the input of a user defined transform, and while it can be connected to the input of a user defined code transform, its name and physical location aren't then made available in macro variables to the code within.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestions as to how I might get hold of the file name, or another approach to getting the last mod date?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Dave&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 01:49:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-Get-External-File-last-modified-date/m-p/430246#M13338</guid>
      <dc:creator>dkb</dc:creator>
      <dc:date>2018-01-24T01:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: DI Studio: Get  External File last modified date</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-Get-External-File-last-modified-date/m-p/430578#M13339</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;usually, for this kind of logic, I think it better belongs to your scheduling tool. Most of them have file events that can trigger jobs depening on things like arrival.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That said, I also recognize the (weird?) fact that the User Written Transformation doesn't accept External Files.&lt;/P&gt;
&lt;P&gt;Using Pre-code to the File RFeade is to little avail since almos no useful macros are defined here, especially not the file name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Allthough, the User Written Code might work. For some reason, you get a lot of automatic macros here. So one way to wrap it up is to write a mcaro that you stored in a SASAUTOS location (typically configdir/SASApp/SASEnvironment/SASMAcro.&lt;/P&gt;
&lt;P&gt;Then you need to instruct your users to simply add a call to that macro in the User Written Code Transformatino that is linked to the External File Object.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 18:33:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/DI-Studio-Get-External-File-last-modified-date/m-p/430578#M13339</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-01-24T18:33:56Z</dc:date>
    </item>
  </channel>
</rss>

