Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

CALLing a sub-program - W-S values can be different second time round

$
0
0

I have a small Project that contains 3 programs

PROGA is the 'driver' and sets up a common data file and then calls PROGB which processes and then PROGB calls PROGC and further work is done

PROGC then returns to PROGB which then returns to PROGA

PROGA then sets up a fresh load of data and calls PRGB again, and so on

This all works well and is extremely fast

However, the behaviour of PROGB changes because some of it's WORKING-STORAGE values are not being loaded as intended

For example, if I have the WS entry as this

77  FLAG-A   PIC  X(001) VALUE 'N'.

and PROGB sets it to 'Y' during it's first run, FLAG-A is not being loaded as value 'N' when PROGB is called for the second and further times

My workaround is to discover this each time and MOVE 'N' TO FLAG-A early in the processing for PROGB which works

However, I most probably do not have a parameter set correctly

Is there a specific way to CALL or prepare in advance a program and force the setup of the W-S values per item?  I would expect that when PROGB is loaded for the second and ensuing times that it is laid down 'clean' and all values are set as per the sources code's settings


Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>