1 Reply Latest reply: May 15, 2014 10:05 AM by Olly Bond RSS

    Input Distribution

    efortenberry _

      When I go to Input Distribution and add a action to move the input file I know how to change the name and also add the dates.  In the model I'm selecting a process date that is in the orginal file and making that a field.  Is possible to extract that field and make it part of the field name of the file being moved.


      Example the process runs on datapump on 09/11/2009 but the orignal report ran from the source system on 09/10/2009 and this is the data I want in the file name after it is moved?

        • Input Distribution
          Olly Bond

          Hello efortenberry,


          I've not needed to do this on DataPump but using batch files with Monarch I'd try this approach.


          Assume that you have a field "ReportDate" which contains the 09/10/2009 value.  Also assume that the path to the file created by your input distribution is defined as a calculated field (again, this can be hidden) called "InputPath". The original filename can be created as a third hidden calculated field called "OriginalName" defined as rsplit(File();2;"\";1). "NewName" can be created as you would like it to appear - perhaps using an expression like:




          Nake a calculated field in your Monarch model (it can be hidden so it won't appear in the table) called "BatchCommand", as a long character field. If you're using very long network paths and filenames this approach may hit snags...


          BatchCommand should be defined as:


          "rename "chr(34)"\"chr(34)" "chr(34)"\"+chr(34)


          Then create a summary in your Monarch project which has this field as the only key, and Count() as the only measure. Hide the measure. Export the summary as a fixed width text file called "RenameCommand.bat" to an appropriate location. Run a post-process script in DataPump to call "RenameCommand.bat".