Consultor Eletrônico



Kbase P13613: How to access data area from 4GL on AS/400
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/15/2004
Status: Verified

GOAL:

How to access data area from 4GL on AS/400

FACT(s) (Environment):

Progress 9.1x
IBM AS/400 (RISC)
Progress/400 DataServer

FIX:

/*
DataArea.p
This program demonstrate how to access a data from a 4GL program
In order to use this properly, please be sure to replace KSSPORT9 with your AS/400 Dictionary Library Name
*/
DEFINE VAR data-length AS INTEGER.
DEF VAR data-value AS CHAR.
DEF VAR stat AS INTEGER.

data-value = "This is a test string to be placed into the *LDA".
data-length = 100.

RUN as4dict/chgdara.p ( INPUT "KRSSPORT9", INPUT "*LDA", INPUT "", INPUT 1,
INPUT data-length, INPUT-OUTPUT data-value, OUTPUT stat ) NO-ERROR.
IF stat = data-length THEN DO:
ASSIGN data-value = " ".
RUN as4dict/rtvdara.p ( INPUT "KRSSPORT9", INPUT "*LDA", INPUT " ", INPUT 1,
INPUT data-length, INPUT-OUTPUT data-value, OUTPUT stat ) NO-ERROR.
IF stat = data-length THEN
DISPLAY data-value FORMAT "x(64)".
END.