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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is rmode(24)

906


Define cobol?

1077


please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?

2187


What do you understand by psb and acb?

850


What is the utilization of copybook in cobol? Could we utilize a similar copybook?

953


What are the different types of condition in cobol and write their forms.

876


What is the difference between structured cobol programming and object alternativelyiented cobol programming?

972


Name the divisions, which are available in a cobol program?

931


Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?

912


Are you comfortable in cobol or jcl?

812


In COBOL programming, what is PERFORM? What is VARYING?

874


What is amode(31)

915


How do define dynamic array in cobol.

866


Write a program that uses move corresponding.

876


Name some of the examples of COBOl 11?

2887