This message alerts you to a potentially important coding error:
IBM2402I E <variable x> is declared as BASED on the ADDR of <variable y>,
but <variable x> requires more storage than <variable y>.
The importance of this message depends on how the variables are used in your program. For instance, if X is a 100-byte structure and Y is declared as CHAR(200) BASED(ADDR(X)), the compiler issues this message; note that, in this example, the message is issued only when X is not subscripted. If your program also contains the statement Y = ’’, you have a severe problem (because that assignment wipes out 100 bytes of storage that the compiler is likely to be using for other purposes). You must correct this kind of problem.
However, your program might use Y only in the statements such as:
In this case, your code does not need to be changed.
However, in this case, you could change the declare of Y to eliminate these messages: if you declare Y after X, you could then declare Y as CHAR(STG(X)) BASED(ADDR(X)). This would eliminate this occurrence of the message without your having to make any changes to your code. But, if you wanted, you could also then simplify the above assignment statements to: