I've a doubt on the below scenario. Please help me out understanding the same.
There is copybook as below
Code: Select all
copybook: COPYMAIN
01 COPY-MAIN.
05 COPY-INPUT-FIELDS.
07 INPUT-1 PIC X(02)
07 INPUT-2 PIC X(03)
07 INPUT-3 PIC X(04)
05 COPY-OUTPUT-FIELDS.
07 OUTPUT-1 PIC X(02)
07 OUTPUT-2 PIC X(03)
07 OUTPUT-3 PIC X(04)
.
.
.
PROCEDURE DIVISION.
.
.
.
CALL "PROG1" USING COPY-INPUT-FIELDS.
Code: Select all
Linkage section
COPY COPYMAIN
PROCEDURE DIVISION USING COPY-MAIN.
Move values for OUTPUT-* fields and Go BACK
I've called the program using part of the copybook variables, and in return I'll receive the data in output variables too. This is working fine for me. But is it a effective way.? Should I call the program with COPY-MAIN.? what is the difference if I'm calling with COPY-MAIN and COPY-INPUT-FIELDS.