In Part 1 of this blog, we discussed using the “runbatch” command to process files for three Locations. In Part 2, we will discuss using the “rundatarule” command to accomplish the same thing.
Using the “rundatarule” command to execute multiple Data Load Rules (DLRs) requires coding the batch script to execute for each DLR. This can be accomplished by creating many individual “rundatarule” command lines or setting up the script to loop through a list of DLRs. I have done the latter for the solution we will be discussing here.
The command line to execute “rundatarule” is:
epmautomate rundatarule RULE_NAME START_PERIOD END_PERIOD IMPORT_MODE EXPORT_MODE [FILE_NAME]
Note: The “START_PERIOD” and “END_PERIOD” values will be the same in the example. This is to simulate loading a month-end Trial Balance file.
- The “RULE_NAME” is the DLR name associated with the Location in Data Management
- The “START_PERIOD” is the first period that the data is loaded to
- The “END_PERIOD” is the last period that the data is loaded to
- The “IMPORT_MODE” determines how the data is Imported into Data Management
- The “EXPORT_MODE” determines how the data is Exported into the Target Application
- The “FILE_NAME” determines the Location’s Inbox directory and the file name to be Imported
Once again, there are only three Locations that will process files to a Financial Consolidation and Close Cloud application named “FCCS”. The Locations are: FCCS1, FCCS2, FCCS3. The following items need to be configured before executing the “runbatch command:
- Data Load Rules have to be defined.
Note: Both the File Name and Directory fields must be blank in each associated DLR. This is necessary to properly pass the “FILE_NAME” variable defined each time the “rundatarule” command is executed.
The batch script uses a “FOR” command to loop through the list of Location names in a text file, named “Locations_List.txt”. The Location names in the text file, along with concatenating the Category to the Location, defines the “FILE_NAME” variable in the “rundatarule” command line.
Note: I have also included a line that uses the “deletefile” command to delete the Location’s load file after it has processed. This will prevent the loading of the same file by subsequently scheduled batch jobs.
The “RUNDATARULE Script.bat” file was executed by a third-party scheduler, Windows Task Scheduler.
After the batch is executed, the Process Details logs indicate that all three (3) DLRs ran successfully.
That’s an illustration on how to utilize the “rundatarule” command from within a batch script in order to execute multiple Data Load Rules in Data Management.
Hopefully the comparison between the “runbatch” and “rundatarule” commands will help you to determine which command is proper for the situations you may encounter.