Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

Analysing Declarative and SQL Whenever statements

Analysing Declarative and SQL Whenever statements

Problem:

What happens if I try to perform clipper queries or Impact analysis on items that appear in the declaratives section, or are used within SQL Whenever statements?

 

Resolution:

The Declarative Section of a Cobol program is used to define sections and paragraphs, that are performed after any file access is performed. This will normally be checking the file status and performing some error recovery work, and allows the programmer to define the actions to be taken.

With Embedded SQL statements there is a similar concept, which is the SQL WHENEVER clause.

The SQL WHENEVER clause work against the SQL CODE that is set once an SQL statement has completed. This is a way to code generic error handling for SQL statements.

When clipper queries or impact analysis is run against a program with a declaratives section or SQL Whenever, just the actual code that appears in the relevant statement will be analysed, not every file access or SQL statement.

This means that, for example a paragraph within the declaratives section will only seem to be executed once within a program and a paragraph mentioned within a SQL Whenever will only seem to be called by the SQL Whenever statement.   In actual fact, the declaratives paragraph could be called after every file access and the SQL Whenever paragraph could be called after any SQL statement.

Note:  Changing these items may have a larger impact than Enterprise Analyzer indicates.

Incident # 2610150

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Version history
Revision #:
1 of 1
Last update:
‎2013-03-26 06:00
Updated by:
 
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.