3 Replies Latest reply: May 15, 2014 10:06 AM by mdyoung _ RSS

    Renaming Input File

    mdyoung _

      I'm using DP v9 Standard and have a situation where I need to rename the input file to a unique number that is stored in a field within the document. The dialog box where you specify your input distribution for a move action doesn't give you the option to extract the first value in a field. Any ideas as to how to accomplish this?

       

      Thanks,

       

      Micheal

        • Renaming Input File
          joey

          I checked Data Pump V10, and it does not provide this functionality.  I think you'll need to resort to programming.  Maybe a VBA module that is called in a batch script for post export.

            • Renaming Input File
              Olly Bond

              Hello mdyoung,

               

              Joey's quite right that renaming the export via a script is one way. There is a non-programming method that I think should work as well but requires Monarch (and so DataPump v10).

               

              Project 1: do what you need to do with the report and create your exports. Then move the input file to a subfolder without renaming it.

               

              Project 2:

              a. open the input file (I'm presuming it's a well-behaved text file) and create a null model that simply traps every line as a one line detail. Paint fields 254 characters wide, called A, B, C etc, as many as you need to cover the line.

               

              b. define a footer template that traps the special value you are looking for. Duplicate this as an append template. Create a calculated field "key" that in the table if(isnull(fieldfromfooter)=1, fieldfromappend, fieldfromfooter) which ensures that every row of data has this value.

               

              c. Create a summary, key fields "key", A, B, C, etc, no measure. Hide "key", export as a fixed width text file breaking on key value changes naming the file according to the key value.

               

              d. Make the input distribution for Project 2 to be "delete".

               

              It would be much more elegant to do this in a script, but it should still be possible without!

               

              HTH,

               

              Olly

                • Renaming Input File
                  mdyoung _

                  Thank you for the replies. I'll try both approaches and determine which is best. Maybe this is a feature they could add to a future release of DataPump. I don't see why they couldn't.

                   

                  Thanks,

                   

                  Micheal