Setting Up Alternate Source Suppliers / Diverters

How to set up an Alternate Source Supplier / Diverter

Some industries are able to take advantage of the K3S Alternate Source System, also known as the Diverter System. In this section we will describe the steps to set up a new Alternate Source Supplier in the K3S system.

 

Establish the Alternate Source Supplier in the K3S Supplier File

 
From the K3S Main Menu choose option 1. Suppliers, and then press F6=Add to add the new Alternate Source Supplier. This will cause the screen below to appear:


You will need to enter the Supplier ID into the Supplier field, the name of the diverter into the Name field, and also use a code of '1' to indicate this is an Alternate Source Supplier.

With the design of the K3S system, Alternate Source Suppliers are coded differently than Regular Suppliers. Alternate Source Suppliers do not have any products permanently assigned to them; once a supplier is coded as an Alternate Source Supplier, you are not able to put any product records under that supplier.

The key to identifying a new supplier as an Alternate Source Supplier is the field with the text of 
Regular =0, AltSr=1, Cmb=2.  The default value for this field is a 0, but you want to change this
field to have a value of 1 which means Alternate Source Supplier (see example below).  



If you forget to set that field to a value of 1 during entry, then you will need to remove the supplier record with 4=Delete, and then use F6=Add to re-enter the new Alternate Source Supplier record. The supplier type field is not accessible for maintenance,and therefore must be established correctly during entry.

Determine the Physical File That Will Hold the Weekly Offerings  

There are 15 files available to use from file name K_ALTSRC01 through K_ALTSRC15. More files can be established if you will be buying from more than 15 sources. These files are located in library K3S_5DTA and are flat files with 80 bytes records. If this is the first Alternate Source Supplier you are setting up, then use the first file called K_ALTSRC01.

Most Alternate Source Suppliers send the offerings via email att
achment or by using FTP to a site you designate. You will need to receive their offerings and then populate the appropriate K3S offering's K_ALTSRCxx file.

The weekly Alternate Source process will use their offerings that make the cut off time, and then automatically clear the files for the next week’s process. 


Setup the ASE Alternate Source Entries Table Code Record to Match the Physical File 

You will find Table Code records that can be used to describe which files are currently setup for the weekly process. From the K3S Main Menu, take option 9. Operations, then take option 3. Table codes, and use 1=Select on the ASE Alternate source entries record.
 
In the screen below you will see four Alternate Source Suppliers have been established:

 

                                                                                                                                         
To set up a fifth Alternate Source Supplier use 2=Change on the record that has the Value of ‘K3S_0051  05’. This will let you change the Description 1 information to contain the Alternate Source Supplier’s ID and name.

In this example we have established a new Alternate Source Supplier 15730 Purity Wholesale, who will appear on the list as the fifth entry. The weekly offerings for this new supplier should be populated into the file K_ALTSRC05.



                                                                                                                                     
After you have changed the Table code record for the fifth Alternate Source record, you will be able to see all of your sources on another screen.

From the K3S Main Menu, take option 9. Operations, then option 6. Alternate source entries. Below we can see that the weekly offerings for Alternate Source Supplier 41330 Supreme have already been populated into file K_ALTSRC01 for 132 records.

 


 
                                                                                                                        

Make Adjustments to the RPGLE Program K3S_9100 

The purpose of program K3S_9100 is to map the weekly offerings sent by the Alternate Source Suppliers to field positions that are understood by this program.

For each Alternate Source Supplier added you will change the Input specifications for the proper ‘from’ and ‘to’ positions, and then down in the Calculation statements you will change the supplier ID to match the appropriate value for this new alternate source.

See example below for setting up the fifth new supplier Purity Wholesale
 
* --------------------------------------------------
Ik_altsrc05ns  05                                    
I                                  5   15  ndc_upc_05
I                                 24   53  descrip_05
I                                 54   58 0qty_avl_05
I                                 60   63 0cost_dl_05
I                                 64   65 2cost_cn_05

The only mandatory values from the Alternate Sources would be the NDC/UPC code and their cost. Most of them will provide a description, and some of them provide a quantity available.

Change each input specification to match how they have sent their offering.  The field defined by ndc_upc_xx (05 in the example) will be compared to the field PR_NDC_UPC in the file K_PRODUCT for matching purposes.

You will notice that the cost information from the alternate source is broken down into whole dollars and the cents value. Some sources include the decimal point in their transmission, and therefore having two fields defined makes putting the pieces together easy down in the calculations.
 


* --------------------------------------------------------------
                                                                 
 ** Alternate source entries for Purity Wholesale           
                                                                 
c                   if        *in01                              
                                                                 
 **  prime fields for subroutine $_write                         
c                   eval      altsrc    = '15730     '              
c                   eval      ndc_upc   = ndc_upc_05             
c                   eval      descript  = descrip_05             
c                   eval      qty_avl   = qty_avl_05             
c                   eval      cost      = cost_dl_05 + cost_cn_05
c                   eval      cost_each = cost / 12                
c                   eval      cost_div  = 12                                                                         
c                   exsr      $_write                            
c                   endif  

 
                                    

In the calculation section you must populate field ‘altsrc’ with the correct Alternate Source Supplier ID information.

The three fields ‘cost_each’, ‘cost’ and ‘cost_div’ work together to provide information for both the buyer to view more easily, and also for the program to use for comparing differences.

In the example above the alternate source has sent costs per dozen.

If your alternate sources send you costs in different increments, and you want them represented in your cost per divisor, this section of calculations provides the means to make that happen.
 


Determine the Day of the Week to Process Alternate Source Entries  

You will need to set the processing schedule to know which day of the week to build orders for Alternate Source Suppliers. This is performed from
the K3S Processing Schedule as shown below. To get here, start from the K3S Main Menu and take option 9. Operations, then option 1. Processing
schedule
.


                                                                                                                                                    
The sample screen above shows Tuesday as a ‘Yes’ in the ‘Alt Source’ column.  This means that Tuesday is the day of the week for alternate source processing.
 
If we want to change the day of the week, then use F7=Global maintenance

This will bring up a WINDOW (shown below) where you can change the Alt Source flag for Tuesday to 0=No, and in the example we have chosen Wednesday
and set the Alt Source flag to 1=Yes.


 

Next press F7=Process globally and the future Wednesdays are all changed to process on that day.


Exclude Updating Product Information for Alternate Source Suppliers 

RPGLE program K3S_9000 builds the K3S interface file for products (K_INTPROD). However, since Alternate Source suppliers will have zero
active products in the K3S system, we must add a statement in K3S_9000 to exclude building interface records for this type of supplier. 

See example below where products have been excluded for three different Alternate Source suppliers. 

 * --------------------------------------------------                                                                
**   don't take products for alternate source suppliers           
c                   if        ip_supl = '41330  ' or               
c                             ip_supl = '39990  ' or               
c                             ip_supl = '37011  '                                 
c                   goto      end                                  
c                   endif                                          
                                                                                               
                                        
 


Using CL program K3S_GETALT to Populate K3S files with Weekly Offerings

One method of getting the weekly offerings loaded into the appropriate K_ALTSRC* files is by setting up CL program K3S_GETALT in library K3S_5MOD.

Using this method requires the weekly offerings to be FTP'd to the IFS. Then program K3S_GETALT imports the data into a file and does a copy file
to get the data into the appropriate K_ALTSRC* file.

Depending upon how the data looks that the diverter sends, you will either copy the data in the stream file to a physical file with defined fields or a flat
120 byte file.

First let's look at what to do if the data sent from the diverter has different field lengths.  Below is an example of diverter data from Supreme that has
different field lengths; notice how the records don't match up going down the page:

    ITEM,CASE UPC,DESCRIPTION,CASE QTY,PRICE,PACK

    ,00300258109310,100 CT EQUAL PACKETS,264,32.59,12
    ,00300258942672,4 OZ EQUAL SPOONFUL SWEETNER,210,20.60,8
    ,00305210014008,6.1 OZ PONDS COLD CREAM,122,54.00,24
    ,00305210179004,300 CT QTIPS SWAB ANTI MICROBI,512,41.50,24
    ,00305212352009,7.5 OZ VPJ JAR REG,64,81.60,48
    ,00305212384000,2.5 OZ VPJ TUB,126,70.40,48
    ,00305215128007,500 CT QTIPS COTTON SWABS,93,56.60,24
    ,00305215163282,375 CT QTIPS COTTON SWABS BONU,43,43.40,24
    ,00009800008247,12/24CT TIC TAC SPEARMINT SING,1,127.01,288
    ,00009800008292,12/24CT TIC TAC CITRUS TWIST S,34,127.01,288
    ,00009800123247,12/12CT FERRERO ROCHER 3 PC,14,93.51,144
    ,00309971185007,1.5 OZ LDY MITCHUM SHWR FRSH R,78,24.70,24
    ,00309972322104,1 CT RVLN SLANT TIP TWEEZER,24,99.50,72


The program K3S_GETALT will import the above data to a physical file. See example physical file below called SUPREME which resides in library K3S_5MOD. 

    A          R RSUPREME                                           
    A            ITEM          10          COLHDG('Item#')          
    A            UPC           14          COLHDG('UPC')            
    A            DESC          30          COLHDG('Description')    
    A            QTYAVAIL       5  0       COLHDG('Qty' 'available')
    A            PRICE          7  2       COLHDG('Price')          
    A            PACK           5  0       COLHDG('Pack')


Below is sample code from K3S_GETALT that will copy the data from stream file /KING/SUPREME.CSV and put it into physical file SUPREME.
Then the data is copied from SUPREME into physical file K_ALTSRC01.

    /*** Supreme to K_ALTSRC01 ***********************************/
                                                                  
             CPYFRMIMPF FROMSTMF('/king/supreme.csv') +                
                          TOFILE(K3S_5MOD/SUPREME) MBROPT(*REPLACE) +  
                          RCDDLM(*ALL) DTAFMT(*DLM) STRDLM(*NONE) +    
                          RPLNULLVAL(*FLDDFT)                          
             MONMSG     MSGID(CPF2817)                                 
             MONMSG     MSGID(CPFA0D4) EXEC(DO)                        
             GOTO       CMDLBL(NO_SUPREME)                             
             ENDDO                                                     
                                                                       
             RMVLNK     OBJLNK('/KING/supreme.csv')                    
             MONMSG     MSGID(CPFA0A9)                                 
                                                                       
             CPYF       FROMFILE(K3S_5MOD/SUPREME) +                   
                          TOFILE(K3S_5DTA/K_ALTSRC01) +                
                          MBROPT(*REPLACE) FMTOPT(*NOCHK)              
             MONMSG     MSGID(CPF2817)                                 
             CLRPFM     FILE(SUPREME)                                  
    NO_SUPREME:


As a last step in K3S_GETALT the link /KING/SUPREME.CSV is removed in order to be ready for the next week's offerings to be sent.

Now let's look at another example where the diverter sends the data with matching fields lengths. Below is an example of diverter data
from Quality King that has the same field lengths; notice how the records match up going down the page:

            UPC,DESCRIPTION                  ,ONHAND,   PRICE,
    07476492642,SURGI CRM MOUSSE HAIR REMV 5.85,00024,     .66
    85024100088,POWER STICK SH/GEL INTENSTY 12Z,02352,     .75
    85024100014,POWER STICK SH/GEL OLYMPIAN 12Z,02688,     .75
    85024100004,POWER STICK SHWR/GEL PPLINE 12Z,02640,     .75
    71525690021,QLTY ALCOHOL ISOPROPYL 50% 12 Z,27264,     .63
    71525690027,QLTY ALCOHOL WNTRGREN 50% 12 OZ,25512,     .63
    71525611001,QLTY WITCH HAZEL 16 OZ         ,02652,    1.44
    30074283800,FAULT EAR SYRINGE              ,00204,    1.36
    30074281401,FAULTLESS GOODHEALTH PREM BTTL ,03180,    3.46
    07007457513,ALIMENTUM ADV IRN RTF32 OZ CS/6,02382,    6.40
    07007440702,ENSURE PLUS 8OZ CHOC CS 4/6PKS ,05804,    8.07
                                                         


Because the fields match up the program K3S_GETALT can import the above data to flat 120 byte file. See example below of this flat file
called K_ALTSRC which resides in library K3S_5MOD.


      A          R RKALTSRC                  TEXT('Altsrc Work File')   
      A            DATA         120                                     

Below is sample code from K3S_GETALT that will copy the data from stream file /KING/QKING.CSV and put it into the flat file K_ALTSRC.
Then the data is copied from K_ALTSRC into physical file K_ALTSRC02.


/***  Quality King to K_ALTSRC02   ***********************************/
                                                                        
              CPYFRMIMPF FROMSTMF('/king/qking.csv') +                  
                           TOFILE(K3S_5MOD/K_ALTSRC) +                  
                           MBROPT(*REPLACE) RCDDLM(*ALL) +              
                           DTAFMT(*DLM) STRDLM(*NONE) +                 
                           RMVBLANK(*NONE) FLDDLM(*TAB)                 
              MONMSG     MSGID(CPF2817 CPFA0D4) EXEC(DO)                
              GOTO       CMDLBL(NO_QKING)                               
              ENDDO                                                     
                                                                        
              RMVLNK     OBJLNK('/KING/qking.csv')                      
                                                                        
              CPYF       FROMFILE(K3S_5MOD/K_ALTSRC) +                  
                           TOFILE(K3S_5DTA/K_ALTSRC02) +                
                           MBROPT(*REPLACE) FMTOPT(*NOCHK)              
 NO_QKING:                                                              
 

Once again as a last step in K3S_GETALT the link /KING/QKING.CSV is removed in order to be ready for the next week's offerings to be sent.

Program K3S_GETALT should be compiled to our activation group of K3S_ACTG_5.

Some customers choose to have K3S_GETALT called as a first step in program K3S_9110CL, which is the program that processes diverter orders
in the night job. Be sure to compile K3S_9110CL into K3S_ACTG_5 as well.

The code below shows how the CALL to K3S_GETALT occurs right after the declaration of variables as the first step in program K3S_9110CL:

 /*      Count records to see if orders are to be built               */

              DCL        VAR(&REC_COUNT) TYPE(*DEC) LEN(9 0)                                                                                   

 /*-------------------------------- pull offerings from directory     */

 /*     get offerings from directory /KING                            */

              CALL       PGM(K3S_GETALT)                                                                                                       



Set up the ALT_SYSTEM Table Code Record to be 1=Yes 

The last step in setting up Alternate Source Suppliers is to set the ALT_SYSTEM table code record to 1=Yes.  

To get there, start from the main menu and choose 9. Operations, 3. Table codes, Page down until you see type NJP Night job parameters
and use option 1=Select on it, and lastly use 2=Change on ALT_SYSTEM.

You will then be on a screen like the one seen below.  Change Flag 1 to option 1=Yes to signify that ‘Yes’ an alternate source system has
been installed. 

Important Note: Turning this table code record ON causes the night job to process alternate source offerings. It is highly recommended
that you save this step until you have done thorough testing on your alternate source data so that the night job does not blow up.  The
following chapter shows you how to perform tests on your alternate source data.
 

                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                  Next:  How To Perform a Test for Alternate Source Suppliers
                                                                                                                                                                                                                                                                                  Previous:   F8= Exit in K3S-Replenish® System

                                                                                                                                 

Comments