Features Added in 2.2

Consolidated Tracing Facility

The following changes have been made to the Consolidated Tracing Facility (CTF):

CTF for JVM COBOL applications

CTF tracing is now supported in JVM COBOL applications.

Emitters

A new emitter, JAVALOGGER, is available for JVM COBOL.

Emitter properties and variables

The following support has been added to existing emitters.

The following property has been added to the BINFILE emitter:

Property Description
RunUnitID Controls whether the RunUnit information is included in the trace.

Four new pseudo-variables for the FILE property have been added to the BINFILE and TEXTFILE emitters:

pseudo-variable Description
$(PLATFORM) A platform specific constant, useful when two run-time systems are in the same process, and you require separate trace files
$(RUNUNIT) A unique number that represents the managed RunUnit ID
$(RUNUNIT_SESSIONNAME) The session name passed to the managed RunUnit
$(RUNUNIT_GUID) The globally unique identifier associated with the managed RunUnit

File Handling

New features include:

  • The DATEDIFF function as part of the DFSORT emulation. There are some limitations of its use.

Managed COBOL

Named and optional parameters
Two new types of parameter have been introduced for use during method invocation:
Named parameters
As part of the invocation expression, you can define a value for a parameter named in the method definition. The named argument must be specified after any positional arguments, and must not correspond to any of those preceding arguments.
Optional parameters
Optional parameters are parameters defined with a default value in the procedure division header of the invoked method. If none of the arguments passed in during invocation correspond to this parameter, the default value is used in the method; if an argument does correspond, the value that was passed in is used.
Delegates and events

A number of new features have been added that relate to delegates and events:

Note: Some of these features were also available in previous versions of Visual COBOL.
The ATTACH and DETACH statements
Use these statements to attach or detach a delegate, method group or an anonymous method to or from an event.
The RUN statement
Use this statement to invoke a delegate once it has been created.
Combining delegates
Use the '+' operator to add a method group, anonymous method or another delegate to a delegate, and use the '-' operator to remove a method or another delegate from a delegate.
Method groups conversions
Use the METHOD keyword to specify a compatible method from a method group, and convert it to a delegate.

SQL

EXEC ADO LOAD DATATABLE Statement
Enables you to populate DataTables using both static and dynamic queries.
EXEC SQL GET DIAGNOSTICS Statement
Enables you to get diagnostic information for the last OpenESQL statement executed.
OPTION compiler directive option
New parameters have been added to handle additional host variable types, and to set the DATE SQL compiler directive option to EXTERNAL for .NET applications.