Home > Software > Mainframe > Cobol
Interview Questions   Tutorials   Discussions   Programs   

Cobol - What is CALL statement in COBOL?




352
views
asked mar August 3, 2014 01:08 AM  

What is CALL statement in COBOL?


           

1 Answers



 
answered By Mswami   0  
CALL statement(Sub-Programs):

When a specific functionality need to be performed in more than one program, it is best to write them separately and call them into each program. Sub Programs can be written in any programming language. They are typically written in a language best suited to the specific task required and thus provide greater flexibility.

CALL statement is used for executing the sub-program from the main program.
A sample of CALL statement is given below:

CALL ‘PGM2’ USING BY REFERENCE WS-VAR1, BY CONTENT WS-VAR2.
PGM2 is called here. WS-VAR1 and WS-VAR2 are working storage items.
WS-VAR1 is passed by reference. WS-VAR2 is passed by Content. BY REFERENCE is default in COBOL and need not be coded. BY CONTENT LENGTH phrase permits the length of data item to be passed to a called program.
flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert