<?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: Adding Multiple Filenames to DI Studio Job. in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Adding-Multiple-Filenames-to-DI-Studio-Job/m-p/397086#M12053</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/140069"&gt;@illusoryduck&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Sounds like you found the DIS way how to get this done. I believe you can close this track by accepting your own contribution as solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've never thought of doing it this way and I believe I would have gone for user writtem code (or a user transformation with a macro and prompt if used in more than one job) prior to actually reading the data via File Reader.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;...but it sounds like you found a clean way for&amp;nbsp;doing things so just "carry on".&lt;/P&gt;</description>
    <pubDate>Tue, 19 Sep 2017 11:55:31 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2017-09-19T11:55:31Z</dc:date>
    <item>
      <title>Adding Multiple Filenames to DI Studio Job.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Adding-Multiple-Filenames-to-DI-Studio-Job/m-p/396821#M12049</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having trouble adding the filenames to a DI Studio External File. I have followed this post&amp;nbsp;&lt;A title="How to put filename into the data using SAS-DI?" href="https://communities.sas.com/t5/SAS-Data-Management/How-to-put-filename-into-the-data-using-SAS-DI/td-p/376416" target="_self"&gt;How to put filename into the data using SAS-DI?&lt;/A&gt; and In the Advanced File Parameters i have added&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename=_infilename;&lt;BR /&gt;length _infilename Filename_Used $255;&lt;BR /&gt;Filename_Used=_infilename;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when i run the Transformation it only brings back 8&amp;nbsp;characters and the following WARNING: Length of character variable _infilename has already been set. Use the LENGTH statement as the very first statement in the DATA STEP to declare the length of a character variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 14:36:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Adding-Multiple-Filenames-to-DI-Studio-Job/m-p/396821#M12049</guid>
      <dc:creator>illusoryduck</dc:creator>
      <dc:date>2017-09-18T14:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Multiple Filenames to DI Studio Job.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Adding-Multiple-Filenames-to-DI-Studio-Job/m-p/397074#M12051</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/140069"&gt;@illusoryduck&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I've been the author of the referenced post which had been marked as solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looking into this again I conclude that you are right. The length statement comes too late in the sequence of events.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The LENGTH statement would need to come before the INFILE statement in order for things to work. I believe there is no "hack" in DIS which would generate such code. Not sure if a User Written External File would allow for such a LENGTH statement to be ingested in the right place (before the INFILE statement).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've updated the post you've referenced to be clear that this is not the solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your subject line says &lt;EM&gt;Adding Multiple Filenames to DI Studio Job&lt;/EM&gt;&amp;nbsp;which is different from the problem my earlier post tried to cover.&lt;/P&gt;
&lt;P&gt;Can you explain what you actually want to do. May be there is an easy solution to your actual problem.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 11:38:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Adding-Multiple-Filenames-to-DI-Studio-Job/m-p/397074#M12051</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-09-19T11:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Multiple Filenames to DI Studio Job.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Adding-Multiple-Filenames-to-DI-Studio-Job/m-p/397083#M12052</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;One work around i have found is by ticking Override generated INFILE statement with the following statement in the Advanced file parameters tab you can move the length&amp;nbsp;statement to the correct&amp;nbsp;position and you wont get a warning.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="di_infilename.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15284i7434FEEE9AD8037D/image-size/large?v=v2&amp;amp;px=999" role="button" title="di_infilename.png" alt="di_infilename.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm basically reading in the headings of multiple .csv files to make sure a certain column&amp;nbsp;exists before the file is allowed to enter a flow. So if any headers are missing it will put the problem files in a check folder and carry on checking other files instead of failing.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 11:42:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Adding-Multiple-Filenames-to-DI-Studio-Job/m-p/397083#M12052</guid>
      <dc:creator>illusoryduck</dc:creator>
      <dc:date>2017-09-19T11:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Multiple Filenames to DI Studio Job.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Adding-Multiple-Filenames-to-DI-Studio-Job/m-p/397086#M12053</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/140069"&gt;@illusoryduck&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Sounds like you found the DIS way how to get this done. I believe you can close this track by accepting your own contribution as solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've never thought of doing it this way and I believe I would have gone for user writtem code (or a user transformation with a macro and prompt if used in more than one job) prior to actually reading the data via File Reader.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;...but it sounds like you found a clean way for&amp;nbsp;doing things so just "carry on".&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 11:55:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Adding-Multiple-Filenames-to-DI-Studio-Job/m-p/397086#M12053</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-09-19T11:55:31Z</dc:date>
    </item>
  </channel>
</rss>

