VGTDLI()

The vgLib.VGTDLI() system function uses the CBLTDLI interface to invoke a DL/I function directly.

The function differs from the EGLTDLI() dliLib function only in that it uses an index variable to reference the PCB for the call, whereas EGLTDLI() uses the name of the PCB record. EGL includes this function to ensure compatibility with the CSPTDLI() function in VisualAge® Generator.

Syntax

  vgLib.VGTDLI()(
    func CHAR(4) in,
    pcbindex SMALLINT in
    parms... ANY)
func
A four-character DL/I function name such as ISRT or GHNP
pcbindex
A zero-based index following the lexical order of the fields in the program PSB (ignoring redefining fields), referencing a PCB
parms...
A complete list of parameters, matching in number and type those that the given DL/I function requires

To invoke a DL/I function using the AIBTDLI interface, use dliLib.AIBTDLI().

Example

You can use vgLib.VGTDLI() if there is no EGL I/O statement that corresponds to the DL/I call you want to issue. For example, there is no EGL I/O statement that corresponds to a DL/I FLD call against an Main Storage Database (MSDB) or Data Entry Database (DEDB). However, you can use vgLib.VGTDLI() to issue the FLD call. First define your PSBRecord part and base a program variable on the PSBRecord. For example:
Record CustomerPSBRecord type PSBRecord { defaultPSBName="STBICLG" } 
  // 3 other PCBs
  ...
  // database PCB 
  customerPCB DB_PCBRecord { @PCB { pcbType = DB, 
    hierarchy = [ @relationship { segmentRecord = "CustomerRecord" },
    ...]}}; 
end

  mypsb CustomerPSBRecord;
Notice that you do not need to specify the pcbName property for the customerPCB record because the runtime PCB name is not used with vgLib.VGTDLI(). For this example, assume that there are three PCBs before the customerPCB in the CustomerPSBRecord.
Next define your I/O area. Also define and format your SSAs. Note that when you use vgLib.VGTDLI(), you are responsible for correctly formatting the SSA according to the DL/I rules for SSAs. Once you have done this, you can issue the DL/I FLD call as follows:
  vgLib.VGTDLI("FLD", 4, myIOArea, mySSA1, ... mySSAn);
  if (mypsb.customerPCB.statusCode != "  ")
    // do error processing
  end
Notice that you specify the index of your PCB (4) as the second argument of the call. EGL converts vgLib.VGTDLI() into a DL/I call that uses the DL/I CBLTDLI interface. After the call you can use the fields in the EGL predefined record DB_PCBRecord to determine the results of the call.

Feedback