COBCH1140 Warning with VALUE clause in copybook; Visual COBOL

[Migrated content. Thread originally posted on 02 May 2012]

I am getting a warning for every working storage definition with a VALUE clause saying that VALUE can only be used with the INITIALIZE statement. My source format is Fixed. Is there a way to resolve this warning? I have some legacy code that uses the VALUE clause extensively and will cause a lot of recoding to put the initial values in the variable fields. Most of the values are not spaces or zero. Below is an example:

10 FILLER PIC X(05) VALUE ' '.
10 FILLER PIC X(15) VALUE '044044044044044'.
10 FILLER PIC X(02) VALUE ' '.
10 FILLER PIC X(11) VALUE ' LXXO001 '.
'Online Update '.
  • Verified Answer

    This warning should not appear for working-storage section data items but it will appear for data items in the linkage or file section because the value clause is ignored for these.

    You can get rid of the message by changing the warning level in your project properties on the COBOL tab from Include Warnings to Include Recoverable Errors or Include Severe Errors.

    If you wanted to still report other warnings but selectively turn off just this one than you can add the following directive to the project properties COBOL tab: