Highlighted
Respected Contributor.
Respected Contributor.
1135 views

Display ... On Exception?

Jump to solution

I'm getting an "invalid operand" as well as a couple of other errors on the following statement:

display ctr in-emp-record upon console
    on exception
        display "Wow!"
    not on exception
        add 1 to ctr
end-display.

I thought that adding "upon console" would have satisfied the syntax rule 7 for format 1 on the following documentation page:

http://documentation.microfocus.com/help/index.jsp?topic=%2Fcom.microfocus.eclipse.infocenter.visualcobol.vs2013%2FGUID-CBF8DCDC-1F63-4C02-AC0C-7FABBE6A04AD.html

Any other suggestions on using the "on exception" clause?

Tags (2)
0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.
Absent Member.

RE: Display ... On Exception?

Jump to solution

Rule 7 says: "The ON EXCEPTION and NOT ON EXCEPTION phrases can only be specified when mnemonic-name is associated with ENVIRONMENT-NAME or ENVIRONMENT-VALUE."  CONSOLE is an (implied) mnemonic-name not associated with either of those.  There is no exception condition for displays upon the console, so the ON EXCEPTION / NOT ON EXCEPTION phrases are not allowed.

View solution in original post

0 Likes
1 Reply
Highlighted
Absent Member.
Absent Member.

RE: Display ... On Exception?

Jump to solution

Rule 7 says: "The ON EXCEPTION and NOT ON EXCEPTION phrases can only be specified when mnemonic-name is associated with ENVIRONMENT-NAME or ENVIRONMENT-VALUE."  CONSOLE is an (implied) mnemonic-name not associated with either of those.  There is no exception condition for displays upon the console, so the ON EXCEPTION / NOT ON EXCEPTION phrases are not allowed.

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.