Information Systems:Trigger Programs
There are dozens of files that define an item (I counted – I came up with 70). Some of these files are date sensitive; which means there can be many records for a single item, but not all are effective. This makes it hard – maybe even impossible – to use some of this data in SQL or Query. So we created the consolidated item master file (XXITEMP). It is rebuilt every night, but would become inaccurate as soon as any item maintenance is done. So we put triggers on the more significant files, so that when they are changed XXITEMP is automatically updated. These programs, are in library UWDASWPRDS, file QRPGLESRC, and start with ‘TRG’.
Because these programs are attached to files, they can only be compiled when those files are not in use. The trigger programs have to be detached from the files, compiled, then re-attached. Because this is such an awkward process, that has to be done at night, I have occasionally manually updated XXITEMP when a user makes a change using InfoNet. For example, NPN (natural product number)is an important field, so I manually update XXITEM when it is changed.
Program File TRGCXITPRP CXITPRP Contract Item Prices TRGIXMARKP IXMARKP Item to Mark Up Class Links TRGIXPRICP IXPRICP Item Base Pricing TRGPXPRICP PXPRICP Promotional Item Pricing TRGSROPCR SROPCR Item Cross Reference TRGSROPRG SROPRG Item Master TRGSROPRX SROPRX Item Extended Description TRGSROSRO SROSRO Warehouse Balance TRGWHOLOC WHOLOC Location Definition