What are subroutines ? and how do we pass data to the sub
routines?

Answers were Sorted based on User's Feedback



What are subroutines ? and how do we pass data to the sub routines?..

Answer / harish

subroutines are normal cobol program called by another
program...

so data passed through linkake section

in main prog we have to code

call 'sub' using a1,a2

then in subprog accept these a1 and a2 with same name or
differnt doesnt matter

then in procedure division

procedure division using a1,a2.
.........

pls correct me if anything wrong


HARISH POOMGAME SHIVAPPA
NIIT TECHNOLOGY
KOLKATA

Is This Answer Correct ?    5 Yes 1 No

What are subroutines ? and how do we pass data to the sub routines?..

Answer / ramanuajam

subroutines are usefull, it can reduce the redendency.
and we can minimise code.

Ex. I have finance project. I need noof day calculation
between todates for every program.
I wont write this code in ever program.
i pass the date1, date2 and noof days through main program.
like

main1.cob
call 'nodays' using date1,date2,nodays.

sub.cob
linkage section.
01 wdate1 pic 9(8).
01 wdate2 pic 9(8).
01 wnodays pic 9(4).
procedure division using wdate1,wdate2,wnodays.
mm.

write your logic.
exit program.

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More COBOL Interview Questions

DATAONLY, MAPONLY functionality?

1 Answers   IBM,


What is the purpose of Identification Division?

1 Answers  


If we use GO BACK instead of STOP RUN in cobol?

2 Answers   Temenos,


i want to enter the name 'pandu' into ur table how?

1 Answers   Fidelity,


If I want to increase the Limit in GDG. What should I do?

2 Answers   IBM,






what is a load module ?

3 Answers   TCS,


how the control comes back from subprogram to mainprogram

3 Answers   IBM,


wirte a pgm in using files in which we hav 10 ,20,30 40...100 records in inputfile and i want them to be send to outputfile in reverse order. PLZ HELP ME OUT .........THIS IS A RECENT QUESTION IN IGATE..

5 Answers   iGate,


can internal sort be applied to sort ksds files?

1 Answers  


what is difference between the sysabend and userabend?

2 Answers  


Explain about level numbers?

3 Answers  


What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?

0 Answers   TryTechnicals Pvt Ltd,


Categories