Program A calls program B. Will the working storage
variables declared in program B be initialized every time
it is called by program A or will the values be retained
until the end of program A?

Answers were Sorted based on User's Feedback



Program A calls program B. Will the working storage variables declared in program B be initialized..

Answer / vinod babu bachina

when PROGA made a call to PROGB, if it is first time then
the execution in PROGB start from workign storage
section.suppose progA calls again PROGB then the execution
will start from procedure division only .So when we made a
second call to anu subprogram we have to intialize the
working storage section variables.otherwise second call
retains the values of first call.

Is This Answer Correct ?    22 Yes 2 No

Program A calls program B. Will the working storage variables declared in program B be initialized..

Answer / rajagopalan

The variables in the working-storage section of prog-b will
be initialized only if prog-a has given a CANCEL statement
after CALL statement. Othrwise the WS variables of prog-B
will retain the latest contents of the previous call.

Is This Answer Correct ?    13 Yes 1 No

Program A calls program B. Will the working storage variables declared in program B be initialized..

Answer / s.rajagopalan

none of the above answer is correct.
In static call the working storage varibales is not
initialised when the sub program is called. It retains the
latest values of ws variables in the subrpogram.

In case of dynamic call if you use "cancel" stament then
the ws variables of the sub program are initialised.
if you dont use cancel statement and call the subprogram
then the latest values are retained for the WS vriables.

Is This Answer Correct ?    7 Yes 2 No

Program A calls program B. Will the working storage variables declared in program B be initialized..

Answer / vivek

Rajagopalan's answer is the correct one.

Refer the IBM documentation.

http://publib.boulder.ibm.com/infocenter/pdthelp/v1r1/index.
jsp?topic=/com.ibm.entcobol.doc_3.4/tpsub04.htm

Is This Answer Correct ?    5 Yes 1 No

Program A calls program B. Will the working storage variables declared in program B be initialized..

Answer / nagesh

Well, it depends on the type of call u r making, if it's
dynamic call working storage variable will be initialized
every time automatically.
But if it's static call u can use either 'cancel' or
'is initial' .

Is This Answer Correct ?    7 Yes 4 No

Program A calls program B. Will the working storage variables declared in program B be initialized..

Answer / ab

I think Nagesh's answer is correct.

Is This Answer Correct ?    1 Yes 2 No

Program A calls program B. Will the working storage variables declared in program B be initialized..

Answer / ramanujam

Everything will be cleared in Program B.
once it returns

Is This Answer Correct ?    1 Yes 15 No

Post New Answer

More COBOL Interview Questions

hi, can you ppl tell me, how to check whether the rewrite we gave for the ksds file is successful or not in the program.? i gave rewrite, the rewrite code is executing and maxcc=0 but updation doenot happen in the file?

1 Answers   CGI,


COMP field occupy ?

2 Answers  


If A>B next sentence end-if display 1 display 2. display 3. If a>b, it will display only 3.(the next sentence, ie., after fullstop/period) ____________________________________ if a>b continue end-if display 1 display 2. display 3. If a>b, it Will display 1 2 3 (the next statement) ____________________________________ if a>b continue display 1 end-if display 2 display 3. display 4. If a>b, Will it display 2 3 4 (or) 1 2 3 4 ?

8 Answers   UST,


Suppose i have a variable with s9(18)v99 comp3 . what is the size of variable . If s9(18) comp3 is 10 bytes . There should be some difference between two allocations ? Thanks krishna chaitanya

2 Answers   CSC,


) How do you access the migrate the data from production region to development region

1 Answers   IBM,






what is meant by binary search?

4 Answers  


What the difference is between continue and next sentence?

0 Answers  


COBOL program to read the string ' BOMBAY' in reverse order as 'YABMOB'

8 Answers   Barclays, IBM,


consider the following two statements MOVE 10 TO N PERFORM PARA-X N TIMES STOP RUN PARA-X MOVE 5 TO N how many times PARA-X willbe exicuted? a.10 b.5 c.infinate d.execution error

6 Answers   ABCL, TCS,


If a file has 1000 records.. if i have to replace the first and last characters of the file with another character. how it can be done....

1 Answers   HCL,


I have a variable account-number declared as comp-3, s9(10) comp-3 in a file. How do i find a particular account number say 123456 in that file?

3 Answers  


Describe the difference between subscripting and indexing ?

2 Answers  


Categories