What are subroutines ? and how do we pass data to the sub
routines?
Answers were Sorted based on User's Feedback
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 |
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 |
when COMP-3 is preferrable?
What are declaratives and what are their uses in cobol?
Which of the following characters is NOT valid in column 7? a. - b. \ c. * d. # e. $
How to declare if emp-name = AAAAA""BBB in working-storage section. After display emp-name should print like AAAAA""BB
What do you understand by passing by reference and passing by content?
Why IBM?
HOW WE WILL SORT THE ARRAY WHICH IS GOING TO USE FOR SEARCH ALL?
how can we code index in an array of cobol pgm?
What will happen if you code GO BACK instead of STOP RUN in a stand-alone COBOL program i.e. a program which is not calling any other program ?
can we use COPY statement in w-s section? how?
How does IDMS insure data integrity?
What is an explicit scope terminator?