Skip to main content

Basically the problem is this

 

working-storage.

01 data1 pic x(25).

01 data2 pic x(25).

procedure division.

The current values of data1 and data2

data1 = "A                                   " 

data2 = "   some old data left over"

 

In Micro focus COBOL when I do the following statement

move data1 to data2 

 

data2 ends up equaling 

data2 = "A                                   "

Which is ideally what I want to happen

 

However when I move the code and compile it in OPEN VMS which uses VAX Cobol when I do the same statement I end up with

data2 ends up equaling 

data2 = "A   some old data left over"

 

So it appears that Micro focus Cobol clears the old data automatically out of data2 with a move statement and vax cobol ends up just merging the data in the 2

variables which I don't want to happen. I'd like to know if it is possible to disable this auto clearing or merging or whatever it is called in Visual Cobol so I can use the

debugging tools to track down the source of the left over data and fix it.

 

Thanks 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Basically the problem is this

 

working-storage.

01 data1 pic x(25).

01 data2 pic x(25).

procedure division.

The current values of data1 and data2

data1 = "A                                   " 

data2 = "   some old data left over"

 

In Micro focus COBOL when I do the following statement

move data1 to data2 

 

data2 ends up equaling 

data2 = "A                                   "

Which is ideally what I want to happen

 

However when I move the code and compile it in OPEN VMS which uses VAX Cobol when I do the same statement I end up with

data2 ends up equaling 

data2 = "A   some old data left over"

 

So it appears that Micro focus Cobol clears the old data automatically out of data2 with a move statement and vax cobol ends up just merging the data in the 2

variables which I don't want to happen. I'd like to know if it is possible to disable this auto clearing or merging or whatever it is called in Visual Cobol so I can use the

debugging tools to track down the source of the left over data and fix it.

 

Thanks 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I don't understand your question as it pertains to Visual COBOL. You state that the behavior in Micro Focus is the desired behavior and indeed it also happens to be the correct behavior according to the rules of the COBOL standard.

If the behavior is incorrect in VAX COBOL as you state is it that you wish for Visual COBOL to exhibit this same incorrect behavior?

In Visual COBOL, in order to get the merge behavior you would need to use reference modification:

MOVE data1(1:1) to data2(1:1)