Information Systems:WSOVERNIT2
Jump to navigation
Jump to search
This rebuilds files used in Web Orders. They are built once here, so they don't have to be rebuilt every time a store makes a request. This is called by EODREBLD.
/* Keep last 14 Web item master files so that the regular catalogue can */
/* tell if there has been a price change to the customer within the last 2 */
/* weeks, and display that price in blue. (It uses WSITEMX14 only) */
DLTF FILE(WSITEMX14)
RNMOBJ OBJ(WSITEMX13) OBJTYPE(*FILE) NEWOBJ(WSITEMX14)
RNMOBJ OBJ(WSITEMX12) OBJTYPE(*FILE) NEWOBJ(WSITEMX13)
RNMOBJ OBJ(WSITEMX11) OBJTYPE(*FILE) NEWOBJ(WSITEMX12)
RNMOBJ OBJ(WSITEMX10) OBJTYPE(*FILE) NEWOBJ(WSITEMX11)
RNMOBJ OBJ(WSITEMX09) OBJTYPE(*FILE) NEWOBJ(WSITEMX10)
RNMOBJ OBJ(WSITEMX08) OBJTYPE(*FILE) NEWOBJ(WSITEMX09)
RNMOBJ OBJ(WSITEMX07) OBJTYPE(*FILE) NEWOBJ(WSITEMX08)
RNMOBJ OBJ(WSITEMX06) OBJTYPE(*FILE) NEWOBJ(WSITEMX07)
RNMOBJ OBJ(WSITEMX05) OBJTYPE(*FILE) NEWOBJ(WSITEMX06)
RNMOBJ OBJ(WSITEMX04) OBJTYPE(*FILE) NEWOBJ(WSITEMX05)
RNMOBJ OBJ(WSITEMX03) OBJTYPE(*FILE) NEWOBJ(WSITEMX04)
RNMOBJ OBJ(WSITEMX02) OBJTYPE(*FILE) NEWOBJ(WSITEMX03)
RNMOBJ OBJ(WSITEMX01) OBJTYPE(*FILE) NEWOBJ(WSITEMX02)
CRTPF FILE(&DATALIB/WSITEMX01) OPTION(*NOSOURCE +
*NOLIST) SIZE(*NOMAX)
CPYF FROMFILE(WSITEMP) TOFILE(WSITEMX01) +
MBROPT(*REPLACE) CRTFILE(*NO) FMTOPT(*NOCHK)
/* get an exclusive lock on all files before clearing */
/* if a lock cannot be obtained, send email to IT group, and end */
ALCOBJ OBJ((WSITEMP *FILE *EXCL)) WAIT(0)
ALCOBJ OBJ((WSVENDP *FILE *EXCL)) WAIT(0)
ALCOBJ OBJ((WSALTIP *FILE *EXCL)) WAIT(0)
ALCOBJ OBJ((WSPROMP *FILE *EXCL)) WAIT(0)
/* Clear files. */
CLRPFM FILE(WSPROMP)
CLRPFM FILE(WSALTIP)
CLRPFM FILE(WSVENDP)
CLRPFM FILE(WSITEMP)
/* Clear spool files from output queues. */
/* These are only used when first generated. */
CLROUTQ OUTQ(CATPRCTKTS)
CLROUTQ OUTQ(CATSHFLBLS)
/* Overrides. ASW uses shared access paths; meaning that if a program */
/* reading a file sequentially calls a program that reads that same file, */
/* the first program will continue to read the file from the record the */
/* second program read. */
OVRDBF FILE(SRBPRG) SHARE(*NO)
/* Import item data. */
CALL PGM(WSIMPITM) PARM(&BLANKITEM &BLANKPROMO +
&BLANKBOOK)
/* Import promotions. */
CALL PGM(WSIMPPRO)
/* Import Vendors. */
CALL PGM(WSIMPVND)
/* Update minimum order values in site options files. */
CALL PGM(WSUPDMIN)
/* Rebuild top sellers file if this is the first day of the month. */
RTVJOBA DATE(&DATE)
IF COND(%SUBSTRING(&DATE 3 2) = '01') THEN(CALL +
PGM(WSIMPTOPC))
/* Rebuild top "buyers" file if this is the first day of the month. */
IF COND(%SUBSTRING(&DATE 3 2) = '01') THEN(CALL +
PGM(WSIMPBUY))
/* BUILD FILE OF ITEM GROUPS THAT ARE IN THE WEB TOP BUYERS OR TOP */
/* SELLERS FILES */
CLRPFM FILE(WSCTLDB)
CALL PGM(WSITEMGRP)
/* BUILD FILE OF ITEM CATEGORY 1 THAT ARE IN THE WEB ITEM FILE */
CLRPFM FILE(WSCTLP1)
CALL PGM(WSCAT1)
/* BUILD HIERARCHIAL GROUP/CLASS FILE */
RUNQRY QRY(CATEGORY1) QRYFILE((*LIBL/WSITEMP) +
(*LIBL/SROPRG))
RUNQRY QRY(CATEGORY2) QRYFILE((*LIBL/CAT1) +
(*LIBL/SROCTLDG) (*LIBL/SROCTLDB) +
(*LIBL/SROCTLP1))
/* BUILD NEW ITEMS FILE (FIRST RECEIPT WITHIN LAST MONTH) */
CLRPFM FILE(WSNEWITM)
CALL PGM(WSNEWITEMS)
/* Delete overrides */
DLTOVR FILE(SRBPRG)