What is "Call by content" and "call by reference"?
Answers were Sorted based on User's Feedback
Answer / sruthi
Call by reference means address of var is passed to sub pgm.
The modifications on the passed vars in sub pgm will be
effected in main pgm.
call by content means value of the var is passed to sub pgm.
The modifications on the passed vars in sub pgm will not be
effected in main pgm. that is local to sub pgm.
| Is This Answer Correct ? | 47 Yes | 2 No |
'Call by Content' means value of the variable is passed to
the subprogram and after modification on this variable in
sub-program will not effected in main program.
'Call by Address' is opposite to above. Here address of the
variable is pass to the sub-program at the time of call and
modification on this passed variable in sub-prog will be
effected in main program.
| Is This Answer Correct ? | 12 Yes | 2 No |
Answer / shiva
call by reference passes address of variable to the subprogram
and any changes to this variable will affect the main program
this is bcoz they have allocated the same memory..
whereas in call by content the value of the variable is
passed to the subprogram and any changes to that variable
does not affect the main pprogram..this is bcoz they have
allocated seperate memories.......
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / siri
CALL BY CONTENT CALL BY VALUE
---------------- ------------------
*CALL 'SUB1' BY USING CONTENT *CALL 'SUB1' BY USING REFERE
WS-VAR1 NCE WS-VAR2
*ITS NEED TO BE CODE PASS AN *ITS NO NEED TO CODE PASS AD
ELEMENT BY VALUE. DRESS ON THE VARIABLE.
*THE SUBPROGRAMS MODIFICATIONS *THE SUB PROGRAM MODIFICATIO
ON THE PASSED ELEMENTS ARE NOT NS ON THE PASSED ELEMENTS
VISIBLE IN THE MAIN PROGRAM. ARE VISIBLE IN THE MAIN PRO
GRAM.
| Is This Answer Correct ? | 0 Yes | 0 No |
What are differences between Static Call and Dynamic Call?
10 Answers IBM, KBC, Keane India Ltd, Verizon,
) How do u handle errors in BMS macro?
is this below syntax correct? CALL 'subprg' using A,B Please help
wht is the difference between goto and perform stmts
01 ws-p pic 9(2). 01 ws-q pic 9(2) value 01. 01 ws-r pic 9(2) value 99. p.d. compute p = q + r what will be result of p ans(00) but my question is that how i got 10 on the place of 00. (truncation will ocuure on right side not left). please tell me ?
How we copy a program from production region to development region.What is the process & syntax ?
Write a program to concert an Indexed file into Sequential file?
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
What is the difference between write & move in COBOL?
when COMP-3 is preferrable?
what happens of we dont give time stamp in precompilation process
Suppose, file A has 100 records and file B has 500 records. We want to write records common to both A and B into file C and records which are present only in either A or B into another file D. What should be the logic of Cobol program to achieve this?
7 Answers Bank Of America, Mind Tree,