What's New in V3R1?

The following list describes the enhancements made to ILE COBOL in V3R1:

  • EXTERNAL data items

    You can define data items that are available to every program in the ILE COBOL run unit by using the EXTERNAL clause. No longer do you need to pass all variables that are to be shared across programs as arguments on the CALL statement. This support encourages greater modularity of applications by allowing data to be shared without using arguments and parameters on the CALL statement.

  • EXTERNAL files

    You can define files that are available to every program in the run unit. You can seamlessly make I/O requests to the same file from any ILE COBOL program within the run unit that declares the file as EXTERNAL. For external files there is only one file cursor regardless of the number of programs that use the file. You can share files across programs, and thereby develop smaller, more maintainable programs. Using EXTERNAL files provides advantages over using shared open files since only one OPEN and CLOSE operation is needed for all participating programs to use the file. However, an EXTERNAL file cannot be shared among different activation groups nor with programs written in other programming languages.

  • Nested Source Programs

    An ILE COBOL source program can contain other ILE COBOL source programs. These contained programs may refer to some of the resources, such as data items and files, of the programs within which they are contained or define their own resources locally, which are only visible in the defining program. As the ILE COBOL programs are themselves resources, their scope is also controlled by the nesting structure and the scope attribute attached to the program. This provides greater flexibility in controlling the set of ILE COBOL programs that can be called by an ILE COBOL program. Nested ILE COBOL programs provides a mechanism to hide resources that would otherwise be visible.

  • INITIAL Clause

    You have a mechanism whereby an ILE COBOL program and any programs contained within it are placed in their initial state every time they are called. This is accomplished by specifying INITIAL in the PROGRAM-ID paragraph. This provides additional flexibility in controlling the COBOL run unit.

  • REPLACE statement

    The REPLACE statement is useful to replace source program text during the compilation process. It operates on the entire file or until another REPLACE statement is encountered, unlike the COPY directive with the REPLACING phrase. The REPLACE statements are processed after all COPY statements have been processed. This provides greater flexibility in changing the ILE COBOL text to be compiled.

  • DISPLAY WITH NO ADVANCING statement

    By using the NO ADVANCING phrase on the DISPLAY statement, you have the capability to leave the cursor following the last character that is displayed. This allows you to string together items to be displayed on a single line from various points in the ILE COBOL program.

  • ACCEPT FROM DAY-OF-WEEK statement

    ILE COBOL now allows you to accept the day of the week (Monday = 1, Tuesday = 2 ...) and assign it to an identifier. This support complements the existing ACCEPT FROM DAY/DATE/TIME support.

  • SELECT OPTIONAL clause for Relative Files

    This allows for the automatic creation of relative files even when the file is opened I-O. This extends the support that is already available for sequential files.

  • Support for Nested COPY statements

    Copy members can contain COPY statements thereby extending the power of the COPY statement. If a COPY member contains a COPY directive, neither the containing COPY directive nor the contained COPY directive can specify the REPLACING phrase.

  • Enhancements to Extended ACCEPT and DISPLAY statements

    You can work with tables on the Extended ACCEPT statement. This allows you to easily and selectively update the elements of the table.

    Variable length tables are also allowed on the Extended ACCEPT and DISPLAY statements.

    Also, the SIZE clause is supported on the extended ACCEPT statement.

  • Procedure-pointer support

    Procedure-pointer is a new data type that can contain the address of an ILE COBOL program or a non-ILE COBOL program. Procedure-pointers are defined by specifying the USAGE IS PROCEDURE-POINTER clause on a data item. This new data type is useful in calling programs and or ILE procedures that are expecting this type of data item as its parameter. Procedure-pointer data items can also be used as the target of a CALL statement to call another program.

  • New Special Registers
    • RETURN-CODE special register

      Allows return information to be passed between ILE COBOL programs. Typically, this register is used to pass information about the success or failure of a called program.

    • SORT-RETURN special register

      Returns information about success of a SORT or MERGE statement. It also allows you to terminate processing of a SORT/MERGE from within an error declarative or an input-output procedure.

  • New Compiler options
    • *PICGGRAPHIC/*NOPICGGRAPHIC

      *PICGGRAPHIC is a new parameter for the CVTOPT option which allows the user to bring DBCS data into their ILE COBOL program.

    • *IMBEDERR/*NOIMBEDERR option

      *IMBEDERR is a new compiler option which includes compile time errors at the point of occurrence in the compiler listing as well as at the end of the listing.

    • *FLOAT/*NOFLOAT

      *FLOAT is a new parameter for the CVTOPT option which allows you to bring floating-point data items into your ILE COBOL programs with their DDS names and a USAGE of COMP-1 (single-precision) or COMP-2 (double-precision).

    • *NOSTDTRUNC/*STDTRUNC option

      *NOSTDTRUNC is a new compiler option which suppresses the truncation of values in BINARY data items. This option is useful in migrating applications from IBM® System/390® (S/390®).

    • *CHGPOSSGN/*NOCHGPOSSGN option

      This option is useful when sharing data between the IBM i and IBM S/390®. This option is provided for IBM System/390 compatibility. It changes the bit representation of signed packed and zoned data items when they are used in arithmetic statements or MOVE statements and the values in these data items are positive.

  • Quoted system names support

    Support has been added to allow literals where system-names are allowed. You can use whatever names the system supports and is no longer limited to valid COBOL names.

  • There is no COBOL limit on the following functions as these are now determined by system constraints.
    • Number of declared files.
    • Number of parameters on the CALL statement and on the Procedure Division USING phrase. A system limit of 400 for ILE procedures and 255 for program objects does apply here.
    • Number of SORT-MERGE input files and the number of SORT-MERGE keys. The maximum number of SORT-MERGE input files is 32 and the maximum length of the SORT-MERGE key is 2000 bytes.
  • START with NO LOCK statement.
    By using the NO LOCK phrase on the START statement, the file cursor will be positioned on the first record to be read without placing a lock on the record. This support is provided for indexed and relative files and complements the READ with NO LOCK function that is already available.
    Note: START with NO LOCK is a new statement in both ILE COBOL and OPM COBOL/400.
  • Static procedure call support

    You can develop your applications in smaller, better maintainable module objects, and link them together as one program object, without incurring the penalty of dynamic program call overhead. This facility, together with the common runtime environment provided by the system, also improves your ability to write mixed language applications. The ILE programming languages permits the binding of C, RPG, COBOL, and CL into a single program object regardless of the mix of source languages.

    New syntax on the CALL literal statement and a new compiler option have been added to ILE COBOL to differentiate between static procedure calls and dynamic program calls.

  • Variable Length Record support (RECORD IS VARYING Clause)

    You can define and easily use different length records on the same file using standard ANSI COBOL syntax. Not only does this provide great savings in storage but it also eases the task of migrating complex applications from other systems.

  • Expanded compiler limits
    ILE COBOL now offers expanded compiler limits:
    • size of group and elementary data items
    • size of fixed and variable length tables
    • number of nesting levels for conditional statements
    • number of operands in various Procedure Division statements