Consultor Eletrônico



Kbase 18215: How To Call Progress 4GL From AS/400 CLP Using PROCALL
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/15/2008
Status: Unverified

GOAL:

How to call Progress 4GL programs running natively on the AS/400 (using the Progress/400 Native Client) from OS/400 HLL (High Level Language) programs?

FACT(s) (Environment):

Progress/400 DataServer

SYMPTOM(s):

Progress/400 DataServer 8.0C30

FIX:

A new Progress/400 program, called PROCALL, calls the 4GL program and two new External Programming Interface commands are provided to allow parameters to be input into the 4GL program and output back to the HLL caller.

Following is the correct example of a CLP program passing parameters to a Progress 4GL procedure

CLP Program:

PGM
DCL VAR(&DOTP) TYPE(*CHAR) LEN(128)
DCL VAR(&PARM1) TYPE(*CHAR) LEN(50)
DCL VAR(&PARM2) TYPE(*DEC) LEN(15 5)
CHGVAR VAR(&DOTP) VALUE('/anydir/sample.p')
CHGVAR VAR(&PARM1) VALUE('OLD VALUE')
CHGVAR VAR(&PARM2) VALUE(12.345678)
CALL PGM(PROCALL) PARM(&DOTP &PARM1 &PARM2)
ENDPGM
Progress 4GL program:

/* sample.p */

DEFINE NEW SHARED VARIABLE sts AS INTEGER.
DEFINE NEW SHARED VARIABLE msgarr AS CHARACTER EXTENT 1.
DEFINE NEW SHARED VARIABLE parm1 AS CHARACTER.
DEFINE NEW SHARED VARIABLE parm2 AS DECIMAL.

OS400 EPI STATUS(sts) MESSAGES(msgarr)
ENTRY PARM(parm1 AS CHARACTER(50) USE INPUT-OUTPUT)
PARM(parm2 AS DECIMAL(15, 5) USE INPUT-OUTPUT).

OUTPUT TO PRINTER.
DISPLAY parm1 parm2 WITH DOWN.
DOWN.
parm1 = "NEW VALUE".
parm2 = 87.65432.
DISPLAY parm1 parm2.
OUTPUT CLOSE.

OS400 EPI STATUS(sts) MESSAGES(msgarr) EXIT.
To test the example you have to:

1) You need to add PROGRESS and IFSTOOLS library to your library list.
2) Use STRPDM to edit and compile the CLP program.
3) Use EDTF to edit the Progress 4GL program.
4) Run the program: CALL PGM(<library>/SAMPLE)