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 |
What is the purpose of Identification Division?
can i use multiple when statements in search & search all ? justify ur answer?
Hi , I am posting some questons which are asked at interview. These may help u for ur interview... what is static and dynamic call?
Consider the following COBOL entries: 05 X PIC 99 VALUE 10. SUBTRACT 20 FROM X. The resultant value of X wil be
suppose a cobol programme A calling programme B,C and D. If C undergoes some change what if A,B,C,D need to be recompiled or only C nee to be recompliled.
how do you reference the fixed unblock file formats from cobol programs
Explain call by context by comparing it to other calls.
Is this allowed? 01 WS-TABLE. 03 FILLER-X PIC X(5) VALUE 'AAAAA'. 03 WS-EX REDEFINES FILLER-X OCCURS 5 TIMES PIC X(1). can redefines clause be used with occurs clause?
1.Is it possible to move the data from 99.99 to 99v99? 2.What is the CICS-vsam Compilation process? 3.In My GDG 5 generation will be there GDG3 got an abend what will happen? 4.In my GDG first generation is +1 And I want to add the new generation what will happen previous generation? 5.How can you give the PIC clause below conditions A). s9 (reddy), B). s9 (5) occurs 5 times? 6.How override the proc from a particular step? and what is symbolic and override Procs?
Can we move X(9) to 9(9). If yes what are the ways for doing this?
How do we get current date from system with century?
Is It Possible to Update or change in VIEW Mode?