The IMPORT and EXPORT keywords let you share data among the procedures in
a program without explicitly passing the data as parameters — in other words,
they provide a “hidden interface” between procedures.
PGM – EXP_IMP1
d Var1 S 5p 0 Export Inz(3)
c Var1 dsply r 1
c callb ‘EXP_IMP1’
c Var1 dsply r
c return
PGM – EXP_IMP1
d Var1 S 5p 0 Import
c Var1 dsply r 1
c z-add 77 Var1
c Var1 dsply r
c return
THEN USE
CRTRPGMOD OR PDM OPTION 15 TO CREATE MODULE
THEN
CRTPGM PGM(LIB/PGM_NAME) MODULE() ()
Discuss This Question: