Reload of History After Conversion
This is a general overview of reloading history after conversion.
The steps may vary depending upon the environment.
Before you begin, read through all steps.
!!! Strive to complete all steps in one day !!!
1) Lock everyone out of the system: CHGDTAARA DTAARA(5DTA/K3S_NITE (1 1)) VALUE(‘1’)
2) Make sure that the appropriate K3S libraries are in your library list. Use EDTLIBL to verify.
3) Make a backup of these files using CRTDUPOBJ: K_PRODHIS, K_PRODH52, K_PRODUCT, K_INTDALY
It is recommended to put the backup copy of the files into library 5CNV with an alternate name.
It is very important the backup does not have the same name as the file in 5DTA.
Example: create a backup of K_PRODUCT with a name of Z_PRODUCT in library 5CNV. CRTDUPOBJ OBJ(K_PRODUCT) FROMLIB(5DTA) OBJTYPE(FILE) TOLIB(5CNV) NEWOBJ(Z_PRODUCT) DATA(YES)
4) Clear the product history files.
Clear K_PRODHIS (monthly and 13 four weekly) and/or K_PRODH52 (weekly) files depending
upon which products you are rebuilding history for.
5) You may or may not need to clear K_INTDALY and refresh the data.
If this step is needed, ensure K_INTDALY is refreshed with valid data.
Look for negative values in IE_DLYSALE and/or IE_DLYOUTS. Remove these if you find any!
6) If you are rebuilding for monthly or 13 four weekly, create empty K_PRODHIS shells with PH_HISTYPE = 0 for the last 4 years for every COMP/LOCN/PROD under forecast interval 12 or 13. You can edit or clone program 5MOD/K3S_REDO01 as a guide.
If you are rebuilding for weekly, create empty K_PRODH52 shells with PW_HISTYPE = 0 for the last 2 years for every COMP/LOCN/PROD under forecast interval 52. You can edit or clone program 5MOD/K3S_REDO02 as a guide.
7) Populate K_PRODHIS and/or K_PRODH52 with data from K_INTDALY. You can edit or clone these programs as a guide: 5MOD/K3S_REDOCL (CLLE) 5MOD/K3S_REDO52 (RPGLE) for weekly 5MOD/K3S_REDO13 (RPGLE) for thirteen four weekly
8) Call program 5OBJ/K3S_3034FX with PARM of ‘Y’. This will ensure the 1st sales period (PR_FSTSLPR) and 1st sales year (PR_FSTSLYR) fields in K_PRODUCT are in sync with history.
9) Re-set the forecasting values in K_PRODUCT using SQL.
UPDATE 5DTA.K_PRODUCT set pr_forcast = 0, pr_fordevp = 20, pr_seasonl = ‘ ‘, pr_forserr = 0, pr_sysstat = ‘N’, pr_group1 = ‘MYGROUP’
10) Clear the forecast log file K_PRODFOR using CLRPFM.
11) Clear the seasonal profiles file K_PRODSEZ using CLRPFM.
12) Reforecast the products by location. Program K3S_3037CL will need to be called for each location if the products span multiple locations.
CALL 5OBJ/K3S_3037CL with 4 PARMs of COMP, LOCN, GROUP1, LOGYN
Comp = ‘Z’, Locn = ‘ZZZ’, GROUP1 = ‘MYGROUP’, LOGYN = ‘Y’
13) Use SQL to ensure all K_INTDALY records are set to processed (otherwise the night job will accumulate all demand as 1 day of demand!). update 5DTA.k_intdaly set ie_procflg = 1, ie_process = ie_birth
14) Create a one time use fix program to re-sync the three Period-to-date values in file K_PRODUCT which are:
* PR_ACCSALE – Accumulated period-to-date sales
* PR_ACCOUTS – Accumulated period-to-date outs
* PR_ACCDEM – Accumulated period-to-date demand
15) Let the users back in the system: CHGDTAARA DTAARA(5DTA/K3S_NITE (1 1)) VALUE(‘0’)
Additional steps that are OPTIONAL:
*You may want to remove old records from file K_DLYPROD, although this is not required.
*Re-generate suggested orders. To do so, first use CLRPFM on both K_SUPLSOQ and K_PRODSOQ, and then call program K3S_1500CL with PARM of &COMP.
*Re-generate PE (Period End) batches. To do so, first use CLRPFM on both K_PRODSEB and K_PRODSED, then call program K3S_PE_CNV with four PARMs.
The first PARM is &COMP. The next three PARMs control creating PE batches for specific forecasting interval groups:
* 2nd PARM for forecast interval 12 (monthly)
* 3rd PARM for forecast interval 13 (13 four weekly)
* 4th PARM for forecast interval 52 (weekly)
Note: For the 2nd, 3rd and 4th PARMs, use ‘0’ to not generate PE batch, and use ‘1’ to generate PE batch