DEFINE VARIABLE liCount AS INTEGER NO-UNDO.
DEFINE VARIABLE liNumber AS INTEGER NO-UNDO.
DEFINE VARIABLE lcName AS CHARACTER NO-UNDO.
DEFINE OUTPUT PARAMETER DATASET-HANDLE oDataset. /* output dataset-handle parameter */
DEFINE TEMP-TABLE ttExample NO-UNDO /* Defining Temp-table */
FIELD ExampleNo AS INTEGER
FIELD ExampleName AS CHARACTER .
DEFINE TEMP-TABLE ttTest NO-UNDO /* Defining Temp-table */
FIELD TestNo AS INTEGER
FIELD TestName AS CHARACTER .
DEFINE DATASET dsExample FOR ttExample. /* Defining Dataset for Temp-table ttExample */
REPEAT liCount = 1 TO 2 : /* creating records for Temp-table ttExample */
SET liNumber lcName.
CREATE ttExample.
ASSIGN
ttExample.ExampleNo = liNumber
ttExample.ExampleName = lcName
.
END.
oDataset = DATASET dsExample:HANDLE. /* Created Temp-table data records are been assigned
to output dataset-handle parameter */
/* Main Procedure */
DEFINE VARIABLE hExample AS HANDLE NO-UNDO. /* define handle varaible to use as dataset handle */
RUN pdsExample.p (OUTPUT DATASET-HANDLE hExample). /* Run the external procedure pdsExample.p with one output parameter */
hExample:WRITE-XML("file","ExampleData.xml"). /* To check the Data which is created in pdsExample.p */