PROCEDURE DIVISION USING COPY-MAIN.
Move values for OUTPUT-* fields and Go BACK
Now, I have few questiosn on this.
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.
With the copybook as it is at the moment, you will get the same results using COPY-MAIN or COPY-INPUT-FIELDS. This is because the start addresses of those two fields coincide.
It is much better to use COPY-MAIN in the CALL ... USING ... 1) it is clearer to the human reader 2) if someone defines data before COPY-INPUT-FIELDS, so the addresses no longer coincide, then it will no longer work.
There are no other differences. I'd also suggest that when defining new copybooks, if site standards allow, do so without the 01-level, so that it can be defined with different 01-level names.