New Fields for SYS3005 ESC

Also look at SYS3082 to see how the system is built to handle this code.
SYS3082

New Fields for SYS3005 ESC

SYS3005 ESC

There are 3 new columns of data:

  • Status = Is the code considered an Active or Inactive code (A/I)
  • Order = Used purely to sort by life cycle
  • PO/MRP = Are these parts available in POs/MRP/WOs (Y/N)
Note that code 2 (HISTORIC) was invented a few years ago.
Code 3 (IN PROGRESS) is a new code for parts we are still designing.



Common Subroutine to Consistantly Get All Info & ESC.BANK Structure

CALL UTLS9026.5(ESC.BANK)

This routine will read all the ESC records from SYSTBL and populate ESC.BANK as follows:

Field Desc Example of Data
F1 mv list of the ESC codes 3^0^1^2
F2 mv list of life cycle (for sorting only) 1^2^3^4
F3 mv list of active/inactive (A/I) I^A^A^I
F4 mv list of Descs IN PROGRESS^ACTIVE^HISTORIC^INACTIVE
F5 mv list of available in Purchasable/MRP/WO (Y/N) N^Y^N^N
F6 Active codes enclosed in double quotes so you do not need to
build this each time - used for SELECT statments
"1""2"
F7 Active codes seperated by @MVs
so you do not need to build this each time
1^2
F8 Inactive codes enclosed in double quotes so you do not need to
build this each time - used for SELECT statments
"3""0"
F9 Inactive codes seperated by @MVs
so you do not need to build this each time
3^0
F10 Purchasable/MRP/WO codes enclosed in double quotes so you do not need to
build this each time - used for SELECT statments
"1"
F11 Purchasable/MRP/WO codes seperated by @MVs
so you do not need to build this each time
1
F12 Active but phasing out codes1 enclosed in double quotes so you do not need to
build this each time - used for SELECT statments
"2"
F13 Active but phasing out codes1 seperated by @MVs
so you do not need to build this each time
2
1 - This is a blending of Active codes (Y) and Purchasable/MRP/WOs (N).

Note that ESC.BANK is sorted by F2 (life cycle). Most things will not care about the order, but if they do, that is the most likely order wanted.
This routine is not SB compliant so that it can be used by ePortal.


If you have a loop that needs to make determinations based on this data, do not put the CALL UTLS9026.5(ESC.BANK) inside the loop! It should be before the looping or it will waste time building the same array over and over. Here are several examples of how best to use this code:

Get the Active / Inactive Status Determine If Active
CALL UTLS9026.5(ESC.BANK)
.
.
.
ENG.STAT = DITMMST<57>[4,1]
LOCATE ENG.STAT IN ESC.BANK<1> SETTING ENG.STAT.POS THEN
   ACTIVE = ESC.BANK<3, ENG.STAT.POS>
END ELSE
   ACTIVE = "I" ;* Should never happen
END
CALL UTLS9026.5(ESC.BANK)
.
.
.
ENG.STAT = DITMMST<57>[4,1]
LOCATE ENG.STAT IN ESC.BANK<7> SETTING ENG.STAT.POS THEN
   * Part is active - act accordingly
END ELSE
   * Part is not active - act accordingly
END

If you simply need to build a SELECT statement, use it something like one of these:

Build a SELECT Statement of Active Parts Build a SELECT Statement of Inactive Parts
CALL UTLS9026.5(ESC.BANK)
STMT = "SELECT ITMMST WITH ACTIVE = ":ESC.BANK<6>
CALL UTLS9026.5(ESC.BANK)
STMT = "SELECT ITMMST WITH ACTIVE = ":ESC.BANK<8>


SB Paragraphs

You can't call a normal subroutine directly from a SB paragraph. However, by adding some simple wrapping code, we can still use the above logic. This requires some simple setup, then calling the process UTLS9026.5.DRIVER which in turn simply launcheds BP UTLS9026.5.DRIVER, then extracting the desired results from WORK.

Determine if Active Determine if PO/MRP/WO
SAVE.WORK = @WORK
@WORK = INV.CODES[4,1]
@WORK<2> = 3 ;* Return the status A/I
CALL SB.PROCESS("UTLS9026.5.DRIVER")
RTN.VAL = @WORK<1>
RTN.DESC= @WORK<2>
@WORK = SAVE.WORK
IF RTN.VAL = "I" THEN
   DISP 4, "Item ":@VALUE:" is flagged as ":RTN.DESC:"!"
   EXIT 1
END
SAVE.WORK = @WORK
@WORK = INV.CODES[4,1]
@WORK<2> = 5 ;* Return the PO/MRP/WO (Y/N)
CALL SB.PROCESS("UTLS9026.5.DRIVER")
RTN.VAL = @WORK<1>
RTN.DESC= @WORK<2>
@WORK = SAVE.WORK
IF RTN.VAL = "N" THEN
   DISP 4, "Item ":@VALUE:" is flagged as ":RTN.DESC:"!"
   EXIT 1
END


Dicts (I-Descs)

To consistantly get the same answer with an I-descriptor, the dict should simply:

  • Extract the CPN as needed (different for each file)
  • Call UTLS9026.5.DICT with the desired FLAVOR
There are 3 arguments for UTLS9026.5.DICT. When calling from a DICT
  • Pgm name/RTN.VALUE (The pgm to call/what is returned by the pgm)
  • CPN
  • Flavor

Flavor Code Returns
A Returns if the part is active or not (A/I)
L Returns the Life Cycle order (a number)
D Returns the Description of the code
P Returns if the part is available for POs/MRP/WOs (Y/N)
Example File Example I-Desc
SAVE.WORK = @WORK
@WORK = INV.CODES[4,1]
@WORK<2> = 3 ;* Return the status A/I
CALL SB.PROCESS("UTLS9026.5.DRIVER")
RTN.VAL = @WORK<1>
RTN.DESC= @WORK<2>
@WORK = SAVE.WORK
IF RTN.VAL = "I" THEN
   DISP 4, "Item ":@VALUE:" is flagged as ":RTN.DESC:"!"
   EXIT 1
END
SAVE.WORK = @WORK
@WORK = INV.CODES[4,1]
@WORK<2> = 5 ;* Return the PO/MRP/WO (Y/N)
CALL SB.PROCESS("UTLS9026.5.DRIVER")
RTN.VAL = @WORK<1>
RTN.DESC= @WORK<2>
@WORK = SAVE.WORK
IF RTN.VAL = "N" THEN
   DISP 4, "Item ":@VALUE:" is flagged as ":RTN.DESC:"!"
   EXIT 1
END


UTLS9026.5.DRIVER (IIPROCESS or from TCL)

This process simply calls a BP by the same name. The BP simply:
  • Extracts the data from WORK,
  • Resets WORK,
  • Calls UTLS9026.5,
  • Tests if run from TCL or not
    • From TCL (just to see what the contects are)
      • Clears the screen & renders a title
      • Returns the field #s, descriptions & values of ESC.BANK
    • Not from TCL (likely a SB paragraph)
      • Gets the desired info (based on what was originally passed in WORK),
      • Returns the desired code in WORK<1> and the desired code's description in WORK<2>
      • How this is used is up to the programmer/calling process.