<?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 Append Filename field to Fixed width input node in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Append-Filename-field-to-Fixed-width-input-node/m-p/489698#M15265</link>
    <description>&lt;P&gt;(Data Flux | Data Management Studio 2.7)&lt;/P&gt;&lt;P&gt;I have a Macro Variable set to the input folder that contains 5 files .&lt;/P&gt;&lt;P&gt;I created a Fixed width input node and set the filename to the variable&lt;/P&gt;&lt;P&gt;I then export all the files contents to a pipe delimited file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 2 dilemmas&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1. Since this concatenates all the files into one export is there a way to concatenate the filename of each source to its record ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;2. I need the date that is also part of the name to be parsed out and added as another column&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;end result is a single file with FILENAME, FILEDATE columns added to each record from the original files&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Aug 2018 17:01:47 GMT</pubDate>
    <dc:creator>Rcflyboyjr</dc:creator>
    <dc:date>2018-08-24T17:01:47Z</dc:date>
    <item>
      <title>Append Filename field to Fixed width input node</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Append-Filename-field-to-Fixed-width-input-node/m-p/489698#M15265</link>
      <description>&lt;P&gt;(Data Flux | Data Management Studio 2.7)&lt;/P&gt;&lt;P&gt;I have a Macro Variable set to the input folder that contains 5 files .&lt;/P&gt;&lt;P&gt;I created a Fixed width input node and set the filename to the variable&lt;/P&gt;&lt;P&gt;I then export all the files contents to a pipe delimited file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 2 dilemmas&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1. Since this concatenates all the files into one export is there a way to concatenate the filename of each source to its record ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;2. I need the date that is also part of the name to be parsed out and added as another column&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;end result is a single file with FILENAME, FILEDATE columns added to each record from the original files&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 17:01:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Append-Filename-field-to-Fixed-width-input-node/m-p/489698#M15265</guid>
      <dc:creator>Rcflyboyjr</dc:creator>
      <dc:date>2018-08-24T17:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Append Filename field to Fixed width input node</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Append-Filename-field-to-Fixed-width-input-node/m-p/490097#M15268</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the advanced properties of the Fixed Width Input node, you can enable&amp;nbsp;the option "FILENAME_FIELD" by entering a variable name, which will output the name of the file read.&lt;/P&gt;
&lt;P&gt;For extracting the date, would recommend to use an expression node with something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Considering file name is similar to "MyFile_180827.txt", 'NAME' is the variable name for File Name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;string dateFile&lt;/P&gt;
&lt;P&gt;parse(NAME,'_',null,dateFile)&lt;BR /&gt;dateFile = replace(dateFile,'.txt','')&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;vincent&lt;/P&gt;</description>
      <pubDate>Mon, 27 Aug 2018 14:28:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Append-Filename-field-to-Fixed-width-input-node/m-p/490097#M15268</guid>
      <dc:creator>VincentRejany</dc:creator>
      <dc:date>2018-08-27T14:28:43Z</dc:date>
    </item>
  </channel>
</rss>

