Inventory Subroutines

Inventory management - bins, adjustments, transfers, quantities

Subroutine count: 6

Table of Contents


VB_ADJUST

Signature: SUBROUTINE ADJUST(BIN,BIN.PRODUCT,BINXREF,CO.STDS,CO.STDS.COST,ITEMCA,JOB.BIN,JOB.BINXREF,JOB.PRODUCT,LOCODE,LOT,LOTCOST,LOTCOSTXREF,LOTHIST,LOTHIST.AUDIT,LOTXREF,PRODUCT,CO,PART,MAT C,LCF,LOTNO,LOC,RDATE,BINNO,QTY,AQTY,CQTY,CLOTS,CQTYS,ADJCLOTS,ADJCQTYS,ADJOFFLOTS,ADJLOTS,ADJQTYS,ADJBINS,ADJBQTYS,CAJOBNO,INITS,CRTNO,PGM,BEL,CEL,EXPDATE,OWNER,CONSIGNFLAG,CWS,DUMMY5,CUSTDUMMY1,CUSTDUMMY2,CUSTDUMMY3,CUSTDUMMY4,CUSTDUMMY5)

Source: S:\LinuxShare\pro3prog\VBBASE\VB_ADJUST

PropertyValue
Status[+] analyzed
Safety[INT] internal
PatternInternal
Args53
DescriptionInventory lot adjustment subroutine. Updates LOT, BIN, LOTHIST, LOTCOST, and associated cross-reference files for both location-controlled and lot/serial-controlled parts. Handles material and cost quantity adjustments, bin tracking, LIFO/FIFO costing, consignment, and lot history maintenance.

Arguments:

IndexNameDirectionDescription
0BINinPre-opened file handle: BIN
1BIN.PRODUCTinPre-opened file handle: BIN.PRODUCT
2BINXREFinPre-opened file handle: BINXREF
3CO.STDSinPre-opened file handle: CO.STDS
4CO.STDS.COSTinPre-opened file handle: CO.STDS.COST
5ITEMCAinPre-opened file handle: ITEMCA
6JOB.BINinPre-opened file handle: JOB.BIN
7JOB.BINXREFinPre-opened file handle: JOB.BINXREF
8JOB.PRODUCTinPre-opened file handle: JOB.PRODUCT
9LOCODEinPre-opened file handle: LOCODE
10LOTinPre-opened file handle: LOT
11LOTCOSTinPre-opened file handle: LOTCOST
12LOTCOSTXREFinPre-opened file handle: LOTCOSTXREF
13LOTHISTinPre-opened file handle: LOTHIST
14LOTHIST.AUDITinPre-opened file handle: LOTHIST.AUDIT
15LOTXREFinPre-opened file handle: LOTXREF
16PRODUCTinPre-opened file handle: PRODUCT
17COinCompany number
18PARTinPart number to adjust
19CinCost element array (9 elements: material, MO-purch, labor, fixed OH, variable OH, outside, outside OH, MO-issue, ODC)
20LCFinLot control flag (1=location, 2=lot, 3=serial, 4=location with bins)
21LOTNOinLot number (for lot/serial control modes)
22LOCinInventory location code
23RDATEinReceipt date for lot history
24BINNOinBin number
25QTYinMaterial quantity to adjust
26AQTYinAllocated quantity to adjust
27CQTYinCost quantity to adjust
28CLOTSinCost lot numbers (VM delimited)
29CQTYSinCost lot quantities (VM delimited)
30ADJCLOTSoutAdjusted cost lot numbers (returned)
31ADJCQTYSoutAdjusted cost lot quantities (returned)
32ADJOFFLOTSoutAdjusted offset lot numbers (returned)
33ADJLOTSoutAdjusted lot numbers (returned)
34ADJQTYSoutAdjusted lot quantities (returned)
35ADJBINSoutAdjusted bin numbers (returned)
36ADJBQTYSoutAdjusted bin quantities (returned)
37CAJOBNOinCost account job number
38INITSinUser initials
39CRTNOinTerminal CRT number
40PGMinProgram name for audit trail
41BELinTerminal bell character
42CELinClear end-of-line escape sequence
43EXPDATEinLot expiration date
44OWNERinConsignment owner
45CONSIGNFLAGinConsignment flag (Y/N)
46CWSinClear whole screen escape sequence
47DUMMY5inReserved for future use
48CUSTDUMMY1inCustomer dummy parameter 1
49CUSTDUMMY2inCustomer dummy parameter 2
50CUSTDUMMY3inCustomer dummy parameter 3
51CUSTDUMMY4inCustomer dummy parameter 4
52CUSTDUMMY5outCustomer dummy parameter 5 (reserved output)

Tables Written: LOT, BIN, JOB.BIN, LOTHIST, LOTHIST.AUDIT, LOTCOST, LOTXREF, LOTCOSTXREF, LOCODE, CO.STDS

API Call Example:

POST /api/admin/subroutine/call
{
    "name":  "VB_ADJUST",
    "args":  {
                 "0":  "",
                 "1":  "",
                 "2":  "",
                 "3":  "",
                 "4":  "",
                 "5":  "",
                 "6":  "",
                 "7":  "",
                 "8":  "",
                 "9":  "",
                 "10":  "",
                 "11":  "",
                 "12":  "",
                 "13":  "",
                 "14":  "",
                 "15":  "",
                 "16":  "",
                 "17":  "",
                 "18":  "",
                 "19":  "",
                 "20":  "",
                 "21":  "",
                 "22":  "",
                 "23":  "",
                 "24":  "",
                 "25":  "",
                 "26":  "",
                 "27":  "",
                 "28":  "",
                 "29":  "",
                 "37":  "",
                 "38":  "",
                 "39":  "",
                 "40":  "",
                 "41":  "",
                 "42":  "",
                 "43":  "",
                 "44":  "",
                 "45":  "",
                 "46":  "",
                 "47":  "",
                 "48":  "",
                 "49":  "",
                 "50":  "",
                 "51":  ""
             }
}

VB_BINS.REV1

Signature: SUBROUTINE VB_BINS.REV1(CO,PARTNO,LOCATION,BINDATA,MSG)

Source: S:\LinuxShare\pro3prog\VBBASE\VB_BINS.REV1

PropertyValue
Status[+] analyzed
Safety[SAFE] safe
PatternInquiry
Args5
DescriptionReturns the list of bins and their on-hand quantities for a given part number and location. The last-used bin (from PRODUCT field 12) is placed first in the returned list.

Arguments:

IndexNameDirectionDescription
0COinCompany number
1PARTNOinPart number to look up bins for
2LOCATIONinInventory location code (e.g. ‘STOCK’)
3BINDATAoutReturned bin data: attribute 1 = VM-delimited bin numbers, attribute 2 = VM-delimited quantities
4MSGoutError message if location not found

API Call Example:

POST /api/admin/subroutine/call
{
    "name":  "VB_BINS.REV1",
    "args":  {
                 "0":  "",
                 "1":  "",
                 "2":  ""
             }
}

VB_ITEMQTY.REV1

Signature: SUBROUTINE VB_ITEMQTY(PARTLIST,BSQL,RETURNDATA)

Source: S:\LinuxShare\pro3prog\VBBASE\VB_ITEMQTY.REV1

PropertyValue
Status[+] analyzed
Safety[SAFE] safe
PatternInquiry
Args3
DescriptionExecutes a pre-built SQL/RetrieVe query (BSQL) against a part list to return quantity data. Forms the PARTLIST into select list 0, executes the query, and returns the resulting list as RETURNDATA.

Arguments:

IndexNameDirectionDescription
0PARTLISTinList of part IDs to query (used as select list 0)
1BSQLinRetrieVe/SQL command to execute against the part list
2RETURNDATAoutResult list from the executed query

API Call Example:

POST /api/admin/subroutine/call
{
    "name":  "VB_ITEMQTY.REV1",
    "args":  {
                 "0":  "",
                 "1":  ""
             }
}

VB_ITEMQTY_DETAIL.REV1

Signature: SUBROUTINE VB_ITEMQTY_DETAIL.REV1(CO,PARTNO,JOBQTYREC)

Source: S:\LinuxShare\pro3prog\VBBASE\VB_ITEMQTY_DETAIL.REV1

PropertyValue
Status[X] deprecated
Args3
Superseded ByVB_ITEMQTY_DETAIL.REV2

Arguments:

IndexNameDirectionDescription
0COin
1PARTNOin
2JOBQTYRECout

API Call Example:

POST /api/admin/subroutine/call
{
    "name":  "VB_ITEMQTY_DETAIL.REV1",
    "args":  {
                 "0":  "",
                 "1":  ""
             }
}

VB_ITEMQTY_DETAIL.REV2

Signature: SUBROUTINE VB_ITEMQTY_DETAIL.REV2(CO,PARTNO,JOBQTYREC)

Source: S:\LinuxShare\pro3prog\VBBASE\VB_ITEMQTY_DETAIL.REV2

PropertyValue
Status[+] analyzed
Safety[SAFE] safe
PatternInquiry
Args3
DescriptionReturns detailed on-hand and on-order quantity breakdown by job for a given part. Walks the lot/bin structure to build on-hand quantities per job/location/bin, and reads REQ/ALLOCXREF for on-order PO/WO data. Returns a structured JOBQTYREC with 8 attributes.

Arguments:

IndexNameDirectionDescription
0COinCompany number
1PARTNOinPart number to query
2JOBQTYRECoutJob quantity record: <1>=job numbers, <2>=allocated qtys, <3>=on-hand qtys, <4>=on-order qtys, <5>=PO/WO type, <6>=order numbers, <7>=dates, <8>=quantities (all VM-delimited by job, SVM-delimited by detail)

API Call Example:

POST /api/admin/subroutine/call
{
    "name":  "VB_ITEMQTY_DETAIL.REV2",
    "args":  {
                 "0":  "",
                 "1":  ""
             }
}

VB_TRANSFER

Signature: SUBROUTINE TRANSFER(BIN,BIN.PRODUCT,BINXREF,CO.STDS,CO.STDS.COST,ITEMCA,JOB.BIN,JOB.BINXREF,JOB.PRODUCT,LOCODE,LOT,LOTHIST,LOTHIST.AUDIT,LOTXREF,CO,PART,MAT C,LOTNO,FLCD,TLCD,LFLAG,FBINFLAG,TBINFLAG,FBIN,TBIN,QTY,ADJLOTS,ADJQTYS,ADJCLOTS,ADJCQTYS,CAJOBNO,INITS,CRTNO,PGM,BEL,CEL)

Source: S:\LinuxShare\pro3prog\VBBASE\VB_TRANSFER

PropertyValue
Status[+] analyzed
Safety[INT] internal
PatternInternal
Args36
DescriptionInventory lot transfer subroutine. Transfers parts from one inventory location to another without changing overall on-hand quantity. Updates LOT, BIN, JOB.BIN, LOTHIST, LOTXREF, LOCODE, and bin cross-reference files for both location-controlled and lot/serial-controlled parts.

Arguments:

IndexNameDirectionDescription
0BINinPre-opened file handle: BIN
1BIN.PRODUCTinPre-opened file handle: BIN.PRODUCT
2BINXREFinPre-opened file handle: BINXREF
3CO.STDSinPre-opened file handle: CO.STDS
4CO.STDS.COSTinPre-opened file handle: CO.STDS.COST
5ITEMCAinPre-opened file handle: ITEMCA
6JOB.BINinPre-opened file handle: JOB.BIN
7JOB.BINXREFinPre-opened file handle: JOB.BINXREF
8JOB.PRODUCTinPre-opened file handle: JOB.PRODUCT
9LOCODEinPre-opened file handle: LOCODE
10LOTinPre-opened file handle: LOT
11LOTHISTinPre-opened file handle: LOTHIST
12LOTHIST.AUDITinPre-opened file handle: LOTHIST.AUDIT
13LOTXREFinPre-opened file handle: LOTXREF
14COinCompany number
15PARTinPart number to transfer
16CinCost element array (9 elements)
17LOTNOinLot number (for lot/serial control)
18FLCDinFrom location code
19TLCDinTo location code
20LFLAGinLot control flag (4=location control, else lot/serial)
21FBINFLAGinFrom-bin flag (B=bin, J=job bin, blank=no bins)
22TBINFLAGinTo-bin flag (B=bin, J=job bin, blank=no bins)
23FBINinFrom bin number
24TBINinTo bin number
25QTYinQuantity to transfer
26ADJLOTSoutAdjusted lot numbers (returned)
27ADJQTYSoutAdjusted lot quantities (returned)
28ADJCLOTSoutAdjusted cost lot numbers (returned)
29ADJCQTYSoutAdjusted cost lot quantities (returned)
30CAJOBNOinCost account job number
31INITSinUser initials
32CRTNOinTerminal CRT number
33PGMinProgram name for audit trail
34BELinTerminal bell character
35CELoutClear end-of-line escape sequence (unused output placeholder)

Tables Written: LOT, BIN, JOB.BIN, LOTHIST, LOTHIST.AUDIT, LOTXREF, LOCODE, CO.STDS

API Call Example:

POST /api/admin/subroutine/call
{
    "name":  "VB_TRANSFER",
    "args":  {
                 "0":  "",
                 "1":  "",
                 "2":  "",
                 "3":  "",
                 "4":  "",
                 "5":  "",
                 "6":  "",
                 "7":  "",
                 "8":  "",
                 "9":  "",
                 "10":  "",
                 "11":  "",
                 "12":  "",
                 "13":  "",
                 "14":  "",
                 "15":  "",
                 "16":  "",
                 "17":  "",
                 "18":  "",
                 "19":  "",
                 "20":  "",
                 "21":  "",
                 "22":  "",
                 "23":  "",
                 "24":  "",
                 "25":  "",
                 "30":  "",
                 "31":  "",
                 "32":  "",
                 "33":  "",
                 "34":  ""
             }
}


Last updated: 2026-02-05 11:29 PM