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 |
In my table having 3000 Records. How can I delete the 500th row? (we don't know what is data inside the table)
what is dynamic array in cobol? what is the difference b/w array and table in cobol?
how the control comes back from subprogram to mainprogram
What do you understand by psb and acb?
whats the difference between search and search all?
What is the difference between external and global variables in COBOL?
How is sign stored in a comp-3 field?
Whats the difference between search & search ALL?
what is filler and what is use of filler
given the following piece of code: CALL SUB-PGM USING A, B, C. CALL SUB-PGM USING A, C, C. (a) Both CALL statements will always produce same result. (d) Both CALL statements may produce different result. (c) Compile-time error because SUB-PGM is a dataname. (d) Compile-time error because A, B, C are used twice.
how many maximum no of variables can be declared in linkage section ?
what are the isolation levels and where we use it in the db2 program