This chapter describes the AIP interval batch scripts.
Replenishment Optimization (RO) suggests the most appropriate replenishment method and thresholds to use based on the business goals set in RO, and the supply-chain. The supply-chain information is provided to RO by AIP. The optimized settings should then be used in AIP when replenishment planning.
AIP provides a number of control parameters to allow flexible control over the integration.
The frequency of import and export from AIP is controlled by the frequency of scheduled tasks. Depending on the Retailer's business strategy, new SKU introduction, and so forth, integration updates could occur weekly, monthly, quarterly, or less as needed.
The Replenishment Optimization Location Types value can be used to limit the locations processed to only stores or only warehouses.
The Replenishment Optimization Update for Stores/Warehouses measures can be used to limit the data set that is sent to RO. The measures are editable within AIP as well as loadable from RO.
The Replenishment Optimization Start Date measure is available for specifying a date to begin pulling data for extract. This helps to eliminate the time-phased disparity between AIP and an optimization system. The Retailer can run the optimization for the supply-chain ahead of when the supply-chain changes. In the workbooks the standard hierarchy rollups are available for mass selecting SKUs and locations to set the date. The Replicate spread method maybe be used to set the same date (that is, start of quarter) at an aggregate level. This value is optional. The batch run date is used when no value is specified.
Figure 8-1 illustrates the flow of data between AIP and RO.
AIP imports the new, optimized replenishment settings used for planning. Because of the critical nature of the data being loaded from RO, AIP ensures the integrity of the data by validating that every SKU/location replenishment method has corresponding thresholds and vice versa. AIP does not load a SKU/location replenishment method which is missing one or more of the needed thresholds. Similarly, AIP does not load SKU/location parameters for which no replenishment method has been provided. If one or more values are missing for a SKU/location the load logs an error message and continues loading subsequent SKU/location values.
This batch step is not required to operate AIP replenishment. This step is only for those Retailers integrating with RO or who wish to import the replenishment method data from an external system. Alternatively, users can specify replenishment method data in the SRP and WRP workbooks.
Script Call
aip_import_from_ro.sh
Functional Overview
This script imports optimized replenishment data provided by RO into AIP. The approved, or working, settings are extracted from RO for loading into AIP. The replenishment method and corresponding thresholds from RO are loaded at a SKU/destination/effective date level.
Technical Details
The following files are generated by RO and are optional. The file contents are designed in a way that each row contains all required and necessary data elements. Each file is first validated and then loaded into AIP measures.
File Name | Description |
---|---|
STR_MINMAX | Contains Store minmax replenishment parameters. |
STR_DYNAMIC | Contains Store dynamic replenishment parameters. |
STR_TIMESUPPLY | Contains Store Timesupply replenishment parameters. |
STR_HYBRID | Contains Store Hybrid replenishment parameters. |
STR_POISSON | Contains Store Poisson replenishment parameters. |
STR_MINSS | Contains Store Minimum safety stock data. |
STR_ROUPDATE | Contains information of intersections for which export/ import need to occur for stores. |
WH_MINMAX | Contains Warehouse minmax replenishment parameters. |
WH_DYNAMIC | Contains Warehouse dynamic replenishment parameters. |
WH_TIMESUPPLY | Contains Warehouse Timesupply replenishment parameters. |
WH_HYBRID | Contains Warehouse Hybrid replenishment parameters. |
WH_POISSON | Contains Warehouse Poisson replenishment parameters. |
WH_MINSS | Contains Warehouse Minimum safety stock data. |
WH_ROUPDATE | Contains information of intersections for which export/ import need to occur for warehouses. |
The details of data elements and their formats have been detailed in the Oracle Retail Advanced Inventory Planning Implementation Guide.
The batch creates a <filename>.error file for bad records found in each of the previous mentioned files. The import batch processes one file at a time for available files present in the $RO_INPUT directory.
Each file is validated and then loaded in the system. Standard AIP logs are created through BSA.
Prerequisites
Files must be copied or FTP'ed to the $RO_INPUT directory and unpacked by a Retailer-created scheduled task before executing this script.
Restart/Recovery
If this script fails, perform the following steps:
Examine the log files to determine the cause of the failure.
Correct any identified setup or environment issues.
Restart the import of data by executing aip_import_from_ro.sh. The files already processed by batch need not be reloaded.
The following sections describe the AIP Export to RO.
Script Call
aip_export_to_ro.sh
Functional Overview
This script exports lead time, review time and pack size information from AIP into pre- formatted/csv flat files for RO. This batch step is not required to operate AIP replenishment. This step is only for those Retailers integrating with RO or who wish to export the data to an external system.
Lead Time
The lead time (order cycle) pattern generally always contains the same lead time on all days that have a lead time, or the lead time increases for the weekend. Therefore it is expected that the most common lead time is found during the business week.
Review Time
Review Time is the number of days until the next possible receipt + availability lead time. The review time is a key factor in determining the minimum amount of projected stock that should be available until the point of ordering. The projected available inventory needs to cover the projected need until the next earliest possible receipt. Because review time can change daily or cyclically, in order to avoid stock outs, the minimum available inventory must cover the longest review time.
Ordering Pack Size
The Ordering pack size is the preferred pack size of a SKU that should be ordered from a source to destination.
Technical Details
The following process describes the AIP Export to RO.
The batch script runs the rule group RoExtract on each local domain and populates temporary measures.
The data in the temporary measures is extracted in the flat files STR_AIP_DATA and WH_AIP_DATA. The file contents are designed in a way such that each row within the file contains all required data elements.
File Name | Description |
---|---|
STR_AIP_DATA | Contains Store lead time, review time and pack size data. |
WH_AIP_DATA | Contains warehouse lead time, review time and pack size data. |
The details of data elements and their formats have been detailed in the Oracle Retail Advanced Inventory Planning Implementation Guide.The data extracted to the files is limited by:
The Replenishment Optimization Location Types setting which indicates the location types-stores and/or warehouses-which are integrated with RO.
The replenishment optimization update flag for stores or warehouses that is set at a SKU/location intersection and indicates which SKU/stores and/or SKU/warehouses should be extracted for updating and optimization in RO.
Note: For each location type that is specified in the Replenishment Optimization Location Types measure the RO update flag is retrieved. If no SKU/location combinations are flagged for update of a particular location type then ALL SKU/location combinations of that location type are extracted. |
The batch script clears all the temporary measures.
Files generated are placed at the location configured in the environment variable $RO_OUTPUT. The outbound files from the AIP RPAS server should be retrieved by FTP using a job scheduling application.
Prerequisites
When running a stores extract the STR_ROUPDATE file should be loaded from RO first to indicate which SKU/stores are being optimized in the next Optimization run. Optionally, AIP users may manage this setting in an AIP Workbook.
When running a warehouse extract the WH_ROUPDATE file must be loaded from RO first to indicate which SKU/warehouses are being optimized in the next optimization run.
Restart/Recovery
If this script fails, perform the following steps:
Examine the log files to determine the cause of the failure.
Correct any identified setup or environment issues.
Restart the export of data from AIP by restarting the script aip_export_to_ro.sh.
Hierarchy and historical data is purged from Oracle database tables using aip_purge.sh script. Hierarchy data that is not loaded into Oracle table for the specified number of days or historical data where the end date is in the past is deleted from the tables. In addition to this, data that has become invalid due to invalid or missing relationships is also deleted from tables. Hierarchy data left after purging is exported to AIP-RPAS so that AIP-RPAS can also perform the necessary purging/cleanup.
AIP-RPAS loads the hierarchy data received from AIP-Oracle during a purging interface with a purge age set to 0, indicating that only the data in the load files remain in the AIP domain's hierarchy arrays at the completion of the load. In addition to the hierarchy data purging, measures whose values are positions along hierarchy dimensions are considered to ensure that no purged hierarchy positions remain as values.
The AIP-Oracle and AIP-RPAS procedures described in this section are not a part of the regular AIP batch processes. They are initiated separately and are controlled by different scripts.
This section describes the process for the AIP Oracle data purge.
Script Call
aip_purge.sh
Input Parameters
None.
Technical Details
This is not a critical process and so it can be scheduled to run in any non-critical time window of the day. Also it does not need to run daily. It can be scheduled to run once a week or once a month or less frequently. Due to the functional dependencies involved in purging data, certain tables must be purged first before other tables. Also due to technical dependencies (like referential key constraints) child tables must be purged before parent tables. Table purge_parameters is used to configure the purge age of hierarchical data tables.
The script purges data in groups of parent tables. Each purge group includes several parent tables that are purged in parallel. Groups themselves are purged in sequence. For example, first group to be purged includes following parent tables: supplier, warehouse, store, commodity_pack_size, chamber, historic data and on_supply_off_supply. At the end, of purging invalid data in parent tables, the remaining hierarchy positions are exported to AIP on RPAS in a compressed tarred file called purge_hierarchy.tar.Z.
Restart/Recovery
Before any parent table is purged, a log is inserted in a temporary log file which is removed at the end if all tables were successfully purged. If aip_purge.sh script fails in the middle, then following actions can be taken:
Examine the log files to determine the cause of the failure.
Correct any identified setup or environment issues.
Restart the script. Parent tables that were successfully purged are not attempted again.
The AIP RPAS Data Purging master script, purging_aip_batch.sh, accepts a number of arguments that allow more control over what portion of the batch scripts are run. Step names have been defined, which may also be passed into the script as arguments that define exactly which steps and corresponding scripts should be run.
Usage
The following table provides descriptions of the purging_aip_batch.sh arguments
Argument | Description |
---|---|
-s | Indicates that a starting step is defined. The step at which the purging batch should start must follow this flag. Only one batch step can follow the flag. This flag must be used along with the -e flag and its associated argument. |
-e | Indicates that an ending step is defined. The step after which the purging batch should end must follow this flag. Only one batch step can follow the flag. This flag must be used along with the -s flag and its associated parameter. |
The following are valid steps that can be used with the -s and -e flags. These steps can also be passed as parameters to the purging_aip_batch.sh script, in the form of a list of steps (not flagged with -s and -e). Each step is described in detail in the following section.
Execution Sequence of the AIP RPAS Purging Batch Scripts
Table 8-1 describes the steps in the order that purging_aip_batch.sh execute them.
Table 8-1 Execution Sequence of the AIP RPAS Purging Batch Scripts
Step Name | Script Name | Technical Details | Purging Batch Run |
---|---|---|---|
purging_prep_oracle_data |
purging_prep_from_aiporacle.sh |
Prepares the export files from AIP Oracle for loading into the AIP RPAS platform. |
Yes |
purging_process_hierarchies |
purging_process_hierarchies.sh |
Pre-processes the hierarchy data exported from AIP Oracle before it is loaded into RPAS domain by inserting positions into labels, removing field separators, and creating stocking point hierarchy load files. |
Yes |
purging_load_hierarchies |
purging_load_hierarchies.sh |
Purges and load all hierarchies in the AIP domain. |
Yes |
purging_process_measures |
purging_process_measures.sh |
Deletes positional measure values from the domain's measure arrays. |
Yes |
The command line interface of purging_aip_batch.sh is identical to that of aip_batch.sh, described previously, except that there is no first-day flag (-f). All the steps of the purging_aip_batch.sh script are intended to be run in the same window of time, in order that the purging is synchronized across both hierarchy and measure data. However the interface to this script is modeled after aip_batch.sh for consistency.
Step Name
purging_prep_oracle_data
Script Call
purging_prep_from_aiporacle.sh
Technical Details
AIP RPAS processes data from AIP Online. AIP Online exports hierarchy information and DM measures which are placed by the user into the AIP RPAS domain, in the $AIPDOMAIN/interface/import directory.
The prep_from_aiponline.sh script is called to process the data files created by the AIP Online export. The data files should be transferred from AIP Online to the export directory by a job scheduling application.
Interval Processing
Using prep_files.sh, the archive file purge_hierarchy.tar.Z is unpacked from $AIPDOMAIN/interface/purge/import into $AIPDOMAIN/interface/purge/import/hier.
The unpacked files are verified to ensure all the data from AIP Oracle Purging batch is present, as listed in the $AIPDOMAIN/interface/purge/config/purge_hier_import.config file. The following hierarchies mastered by AIP Oracle Purging are expected to be in purge_hierarchy.tar.Z.
File Name | Explanation |
---|---|
hspl.dat | Supplier Hierarchy |
loc.dat | Location Hierarchy |
ntwg.dat | Network Group Hierarchy |
oltc.dat | Order Lead Time Cycle Hierarchy |
ordg.dat | Order Group Hierarchy |
proc.dat | Profile Order Cycle Hierarchy |
prod.dat | Product Hierarchy |
prof.dat | Profile Hierarchy |
whse.txt | Warehouse Hierarchy |
Restart/Recovery
If this step fails, perform the following steps:
Examine the log files to determine the cause of the failure.
Correct any identified setup or environment issues.
Ensure that the exported data from AIP Oracle exists inside the purge_hierarchy.tar.Z file, and this file is located in $AIPDOMAIN/interface/purge/import.
Ensure the contents of purge_hierarchy.tar.Z match those in the $AIPDOMAIN/interface/purge/config/purge_hier_import.config configuration file. All files are required.
Restart the purging batch.
Step Name
purging_process_hierarchies
Script Call
purging_process_hierarchies.sh
Technical Details
This step pre-processes the AIP Oracle purging exported hierarchy data before they are loaded into RPAS domain. The processing consists of inserting positions into labels, removing field separators, and creating stocking point hierarchy data.
Interval Processing
The following describes interval processing.
Copy all files listed in $AIPDOMAIN/interface/purge/config/purge_hier_import.config from $AIPDOMAIN/interface/purge/import/hier to $AIPDOMAIN/input.
Move clnd.csv.dat, if it exists, from $AIPDOMAIN/interface/purge/import/hier to $AIPDOMAIN/input.
The Source Stocking Point and Destination Stocking Point hierarchies are created in $AIPDOMAIN/input using elements of the Warehouse, Supplier and Location hierarchies.
The positions are prepended to the position labels in the whse, hspl, ssp, and dsp hierarchy data files.
Export the product and location hierarchies from the AIP RPAS domain, and reduce them by the SKPS (from product) and STR (from location) keys from the AIP Oracle purging export. Write the outputs to the $AIPDOMAIN/input directory.
Restart/Recovery
If this step fails, perform the following steps:
Examine the log files to determine the cause of the failure.
Correct any identified setup or environment issues.
Ensure that the individual hierarchy data files to be loaded (as specified in the $AIPDOMAIN/interface/purge/config/purge_hier_import.config) exist in the $AIPDOMAIN/interface/purge/import/hier directory.
Restart the purging batch.
Step Name
purging_load_hierarchies
Script Name
purging_load_hierarchies.sh
Technical Details
This step loads the purged hierarchy data processed in the previous steps, using a purge age of 0. The end result is that only the hierarchy data positions in the load files survive the load process. Those RPAS measures whose base intersections include dimensions that have been purged of unneeded positions are re-sized to not include those positions.
Although calendar hierarchy purging is not mastered by AIP Oracle, the client may purge their calendar hierarchy during this step. Either copy a manually constructed clnd.dat containing only those days to be retained, into the $AIPDOMAIN/input directory, or run the RMS calendar extract, process it through the RMS-AIP Transformation scripts to generate a clnd.csv.dat, which is copied to the $AIPDOMAIN/interface/purge/import/hier directory, prior to running purging_load_hiearchies.sh. For details on the RMS-AIP Transformation process, read the chapter on AIP Interfaces and Transformation Scripts in this guide and the Oracle Retail Advanced Inventory Planning Implementation Guide.
Interval Processing
Call loadHier RPAS utility with -loadAll and -purgeAge 0 options to load all the processed hierarchy data files into the AIP RPAS domain.
Restart/Recovery
If this step fails, perform the following steps:
Examine the log files to determine the cause of the failure.
Correct any identified setup or environment issues.
Ensure that the individual hierarchy data files to be loaded exist in the $AIPDOMAIN/interface/purge/import/hier directory.
Restart the purging batch.
Step Name
purging_process_measures
Script Call
purging_process_measures.sh
Technical Details
Some AIP RPAS measures contain values corresponding to positions along a dimension. This guide refers to these measures as positional measures and their data as positional values. During the previous load hierarchy step, unused positions are removed from the hierarchy arrays. If any of these measures' positional values are purged positions, the loadHier step does not clean these up. Those measures that have been predetermined to be positional measures are listed in the configuration file $AIPDOMAIN/interface/purge/config/purge_meas_values.config. The configuration file also lists the dimensions in which the measure's value can be a position. This step iterates through each measure in this configuration file and verifies that their values still exist in the hierarchy. If a purged value is detected, it is replaced with the measure's NA Value to keep the hierarchy and the positional values in synchronization.
Interval Processing
Iterate over $AIPDOMAIN/interface/purge/config/purge_meas_values.config and execute in parallel the purgeMeasureValues binary on each measure.
Restart/Recovery
If this step fails, perform the following steps:
Examine the log files to determine the cause of the failure.
Correct any identified setup or environment issues.
Restart the purging batch.
This script must be called before other scripts in the AIP batch. This ensures that the data exists on the correct date and locations.
For each local domain the Baseline Safety Stock Units Override is calculated. Once this is calculated the Re-planned URP Output measure is cleared for the upcoming batch run.
Once this script has been run it must be run in each successive batch run. To stop running this script, between batch runs both the Baseline Safety Stock Units Override and Re-planned URP Output measures must be cleared.
Script Call
warehouse_feedback.sh
Input Parameters
None.
Restart/Recovery
This script follows the BSA method of logging. The logs are placed in the directory defined by BSA.
Examine the log files to determine the cause of the failure.
Correct any identified setup or environment issues.
Restart the script.