Compatibility considerations for iSeriesC

There are a number of platform issues to consider in preparing programs to run in an iSeries® environment.

call statement error handling

Error handling for a call statement varies based on the method the program uses for exception handling. If the program sets the v60ExceptionCompatibility property to YES, you can receive the escape message sent by a called program if the call statement is contained in a try block. The escape message ID is placed in the sysVar.errorCode system variable. The escape message ID is 7 alphanumeric characters:
aaannnn 
aaa
Usually a message ID prefix consisting of alphabetic characters
nnnn
Hexadecimal digits in the range of 0 through 9 and A through F

Calls to server programs return the same sysVar.errorCode values as on other server program platforms.

If the program sets the v60ExceptionCompatibility property to NO and a called program ends due to an exception that is not caught in a try block, the error propagates to the calling program. If there is a try block coded around the call statement and an onException block matches the exception that was thrown, then control passes to that onException block. There is no additional information available to the EGL exception record; however, the following are common reasons for the exception:
  • Program not found
  • Insufficient security
  • Lack of memory

Variable length records

EGL does not support variable length records for iSeries.

DBCS data type

EGL supports the DBCHAR primitive type. The MBCHAR primitive type requires program-programmer management of shift-out and shift-in DBCS data delimiters when setting or referencing values of MBCHAR data items.

Message tables

EGL message tables are implemented as iSeries message files. Enter GO CMDMSGF from any iSeries system command line for a menu of message file commands.

As a result of the message table to message file conversion, EGL programs generated for iSeriesC cannot reference message tables using EGL statements and expressions that operate on DataTables. These statements and expressions include the move statement, conditional expressions that use the in operator, and the source and the target of an assignment statement.

Serial file I/O

Serial files in EGL-generated programs are opened for write access in one of two methods (OUTPUT or EXTEND), which affect the disposition of the existing file. OUTPUT and EXTEND are COBOL OPEN verb phrases. The phrase produced in the OPEN statement for a particular file depends on the EGL resource association file type value at generation time.

EGL supports two file type values, vsam and seq. For serial files, you can use either vsam or seq file types. The vsam file type produces the EXTEND phrase. The EXTEND phrase writes append records to the end of the existing file. The seq file type produces the OUTPUT phrase. The OUTPUT phrase clears the file and writing begins at the first record position.

iSeries and COBOL attempt to manage conflicting open methods when a file is already open in the job, taking into consideration its SHARE status. For more information on serial files, see the the i5/OS™ Information Center and the COBOL runtime messages.


Feedback