Kbase 17481: How to Pass Parameters to Native 4GL Procedure with Progress/400 DataServer Clinet?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/16/2008 |
|
Status: Verified
GOAL:
How to pass parameters to Native 4GL procedure with Progress/400 DataServer Client?
FACT(s) (Environment):
Progress/400
FIX:
This is an example which illustrates the parameter passing between a Client 4GL session and a Native 4GL procedure on the AS/400. It works with any Progress/400 DataServer 8.0C and later releases. It uses a copy of the PROSPORT database.
The example prints a list of the customer's order numbers on an AS/400 printer. The customer number is passed as a parameter from the 4GL client to the Native 4GL procedure. The -d dmy Progress parameter is also passed to the Native 4GL to choose the date format.
client.p (to be run in a Windows client connected to AS/400 database)
--------
DEF VAR vcust AS INTEGER NO-UNDO.
ASSIGN vcust = 3.
CREATE qcmd.
cmd = "* STRPROCLI " +
"STRPROC('procs/orders.p') " + /* Procedure Name */
"SCHDB(SPORTS) " + /* Database name */
"PROPARMS('-d dmy') " + /* Progress parameters */
"PRMSTR(" + STRING(vcust) + ")". /* User parameters */
VALIDATE qcmd.
procs/orders.p (has to exist in the AS/400 IFS directory)
--------
DEF VAR vcust AS INTEGER NO-UNDO.
ASSIGN vcust = INT(SESSION:PARAMETER).
OUTPUT TO PRINTER.
DISPLAY "Orders of Customer" vcust NO-LABEL.
FOR EACH order WHERE order.cust-num = vcust NO-LOCK:
DISPLAY order.order-num.
END.
OUTPUT CLOSE.