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

What are the pertinent COBOL

0 Answers   IBM,


Where the Plan is located in CICS-DB2

2 Answers   IBM,


consider the following two IF statements: IF X AND NOT Y MOVE A TO B IF Z=1 OR 9 MOVE A TO B select one of the following data divusion entries which gives identical results for both the above IF statements a.01 Z PIC 9 88 X VALUE 1.9 88 Y VALUE 0.2 THRU 8 b.01 Z PIC 9 88 X VALUE 0.2 THRU 8 Y VALUE 1.9 c.01 Z PIC 9 88 X VALUE 1.9 88 NOT-Y VALUE 0.2 THRU 1.9 d.none of yhe above

3 Answers   TCS,


How does IDMS communicate with CICS?

1 Answers   Covansys, Satyam,


.How to add one input & one Out file in existing cobol program. how approach tell me step by step.

2 Answers   Syntel,






What is a scope terminator? Give examples.

2 Answers  


can you declare redefine in level 01?

8 Answers   Patni,


Can we move SPACES to numeric field and ZEROES to alphabetic field? If yes what are the way doing this?

6 Answers   T systems,


2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic

0 Answers  


What is the usage of comp fields in cobol?

0 Answers  


What type of SDLC u followed? Why?

0 Answers   IBM,


Hi all, I have a following requirement to write the cobol program. I have to load the 129 variables from input sequential file which are in excel sheet to the cobol inernal table. and after loading into table i have to compare this data with the business file. here compare means controlling the data whether the format(numeric,alpha) is same in the business file and in the table??? i have the same data in input and business file. could anyone please give me any idea of the logic?// i have all the 129 different variables(129rows,1 column)is there .

4 Answers   IBM, Syntel, TCS,


Categories