6 Replies Latest reply on Jan 30, 2017 9:58 AM by SH_INT

    DLE passing file

    pr921

      I have a batch file that runs and loads data via a DLR via loaddata.bat.

       

      I have 300 locations that have the same file format and I want to use the same DLR, passing in the file name for each location before executing the batch.

       

      The documentation isn't clear on how to do this.

       

      I can update the DLE file name in the FDMEE table before executing but there might be a easier way.

       

      Is there a was to set the DLR file via fdmAPI?

       

      Thanks,

      PR

        • 1. Re: DLE passing file
          SH_INT

          DLRs are not shared across locations so there is a major flaw with your approach. You can't use the dame DLR if you have 300 locations in FDMEE you would have to have 300 DLRs (one for each location). You could have a single import format that was shared across locations / DLRs but not a single DLR

          • 2. Re: DLE passing file
            pr921

            To clarify, the DLR will use the same import format across all 300 locations and each will have it's own DLR.

             

            File names will be fed with LOCATION+PERIOD, which is the problem.

             

            I would like to pass the filename to the DLR as a parameter so I don't have to be concerned when the period changes.

             

            I could set up the DLR with a filename as "LOCATION", then take out the "PERIOD" in the incoming filename before passing Location and Period to the loaddata.bat but this will affect FDMEE logging, which is why I would like to pass/change the filename in the DLR before executing the import.

             

            I think the easiest solution is to figure out the underlying FDMEE table(s) that relate the DLR with its filename and update the table before calling loaddata.bat.

             

            I was hoping there was an fdmAPI call or something I was overlooking that someone could point out.

             

            Thanks,

            PR

            • 3. Re: DLE passing file
              PetePuskar

              Create a batch in FDMEE > set type to Open Batch > enable the "Auto Create Data Rule" checkbox. Read the admin guide on Open Batch to see how your files should be named. The filename determines which location, category, period, etc. to load. Then just drop your files into the Open Batch folder and run your batch via FDMEE web or runbatch.bat just like you are currently doing with loaddata.bat.

              • 4. Re: DLE passing file
                pr921

                We have file format that will not change...it's an existing process in FDM being migrated to FDMEE so I have to use filename - "Location_Period.txt".

                 

                Open Batch requires the filename be - FileID_Location_Category_Period_LoadMethod

                 

                Maybe I can set Category and LoadMethod in an INI file, read the INI, then rename the file in the BefImport method?

                 

                Thanks,

                PR

                • 5. Re: DLE passing file
                  ThinkFDM

                  That could work.  You can also create a custom script that renames the file and have the script fire as part of the batch.  Create a batch definition and in the Before Batch Script text box, enter the name of the custom script to run before the batch.

                  • 6. Re: DLE passing file
                    SH_INT

                    As you have seperate DLRs for each location ad you are using the file naming format LOCATION+PERIOD why don't you just set the File Name Suffix option on each DLR to be the name of the location + the Period Description file name suffix