Sunday, November 20, 2011

Difference between Pass-by-reference and Pass-by-content


         

          Passl By Reference
                    Pass By Content
1
CALL ‘sub1’ USING BY REFERENCE WS-VAR1
CALL ‘sub1’ USING BY CONTENT WS-VAR1
(BY CONTENT keyword is needed)
2
It is default in COBOL. BY REFERENCE is not needed.
BY CONTENT key word is mandatory to pass an element by value.
3
Address of WS-VAR1 is passed
Value of WS-VAR1 is passed
4
The sub-program modifications on the passed elements are visible in the main program.
The sub-program modifications on the passed elements are local to that
sub-program and not visible in the main program.

No comments:

Post a Comment