(C) Copyright IBM Corp. 1995, 1997
The Year 2000 and 2-Digit Dates: Guide
INDEX
CHAPTER 8. TOOL CATEGORIES AND AVAILABLE TOOLS TO EASE YEAR2000 CHANGES 8-1
Tool Characteristics . . . . . . . . . . . . . . . . . . . . . . 8-1
Tool Categories . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
Impact Analysis . . . . . . . . . . . . . . . . . . . . . . . . 8-3
Project Management . . . . . . . . . . . . . . . . . . . . . . 8-4
Program Level Analysis . . . . . . . . . . . . . . . . . . . . 8-4
Code Editing and Restructuring . . . . . . . . . . . . . . . . 8-5
Code Generation . . . . . . . . . . . . . . . . . . . . . . . . 8-6
Automate Testing . . . . . . . . . . . . . . . . . . . . . . . 8-7
IBM Tools for OS/390 and MVS . . . . . . . . . . . . . . . . . . 8-8
The IBM COBOL Family for MVS & VM . . . . . . . . . . . . . . . 8-8
The IBM PL/I Family for MVS & VM . . . . . . . . . . . . . . 8-20
DFSORT . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-26
COMUDAS (COMmon Uithoorn DAte Services) . . . . . . . . . . . 8-29
IBM Tools for VM/ESA . . . . . . . . . . . . . . . . . . . . . 8-32
The IBM COBOL Family for MVS & VM . . . . . . . . . . . . . . 8-32
The IBM PL/I Family for MVS & VM . . . . . . . . . . . . . . 8-32
REXX/EXEC Migration Tool for VM/ESA . . . . . . . . . . . . . 8-32
IBM Tools for VSE/ESA . . . . . . . . . . . . . . . . . . . . . 8-34
The IBM COBOL Family for VSE/ESA . . . . . . . . . . . . . . 8-34
The IBM PL/I Family for VSE . . . . . . . . . . . . . . . . . 8-41
IBM Tools for AS/400 . . . . . . . . . . . . . . . . . . . . . 8-45
Using OPM RPG/400 Date Support . . . . . . . . . . . . . . . 8-54
Using System/36 Compatible Date Support . . . . . . . . . . . 8-55
The IBM COBOL Family for AS/400 . . . . . . . . . . . . . . . 8-55
The IBM C Family for AS/400 . . . . . . . . . . . . . . . . . 8-57
Integrated Language Environment for OS/400 . . . . . . . . . 8-57
DB2/400 SQL . . . . . . . . . . . . . . . . . . . . . . . . . 8-58
OS/400 System Values . . . . . . . . . . . . . . . . . . . . 8-64
OS/400 CL . . . . . . . . . . . . . . . . . . . . . . . . . . 8-65
Application Dictionary Services/400 . . . . . . . . . . . . . 8-72
Application Development Manager/400 . . . . . . . . . . . . . 8-72
IBM Tools for Personal Computers . . . . . . . . . . . . . . . 8-74
The IBM COBOL Family for the Workstations . . . . . . . . . . 8-74
The IBM PL/I Family for the Workstations . . . . . . . . . . 8-82
Solution Developer Tools . . . . . . . . . . . . . . . . . . . 8-86
http://www.ibm.com/year2000
for a partial listing of Solution Developer tools.
To be effective and efficient in providing the ability to rapidly change programs and data to properly handle the year 2000, the tools must have certain characteristics. Some important tool characteristics and tool types that are necessary to make these changes are summarized in this chapter. This chapter also provides general information and lists tool products being marketed by Solution Developers and IBM. You should contact the Solution Developers directly for specific information regarding their products.
The tools should provide necessary features such as:
o interactive environment
o batch processing capability
o graphic user interface
o ease of use
o rapid prototyping
o speedy and easy editing/updating
o stepwise refinement
o backward recovery
In addition, consider both the software DEVELOPMENT and DEPLOYMENT/TARGET
environment of the tools such as:
o Platform
- Host only
- Workstation only
- PC only
- Client/Server-based
- Cooperative processing with host
- LAN based
o Prerequisite hardware (both minimum required and recommended for PC
specification, if necessary) such as:
- memory/storage required
- DASD needed for tool installation
- DASD needed for tool usage
o Prerequisite software that is required and supported such as:
- Host operating system(s) - for example: OS/390, MVS, VM/ESA, VSE/ESA,
OS/400, Windows NT, OpenVMS, AIX
- PC/Workstation operating system(s) - for example: DOS, Windows, OS/2,
Unix, MacOS
- Network operating system(s) - for example: Netware, Banyan, Windows
NT
- Communication protocols - for example: TCP/IP, SNA, IPX, NetBios
o Languages supported or generated such as: COBOL, C, C++, PL/I, FORTRAN,
RPG, PASCAL, Smalltalk, Assembler
o Client/server models supported such as:
- Transactional - for example: CICS, Encina, Tuxedo, Remote Procedure
Call (RPC)
- Conversational - for example: APPC/CPI-C, NetBios, IPX, TCP/IP, SNA
- Database server - for example: DB2 family, Sybase, Oracle, EDA/SQL,
SQL Server
Once you run the appropriate tools against your operating system to reformat
Year2000 exposures, be certain that the 'newly created' system maintains its
ability to:
o Achieve good machine performance
o Process a reasonably large number of users
o Process reasonably large databases
o Process high-traffic volumes
o Provide networking access
o Provide recovery from failures
o Provide security
o Provide audibility or accounting
o Provide ease of maintenance.
That is, your system performs essentially as it did before running the tools.
To analyze the impact to your programs, you can use tools to:
o ANALYZE COMPLEXITY Determines the complexity of a software design or code using a metric such as 'fan-in/fan-out', degree of nesting, or other characteristics. These tools provide complexity analysis to allow you to estimate the effort required to change the date/time-related items in your source code.
o ANALYZE IMPACT Analyzes the program modules and related data to determine what is impacted and related. These tools are very time-efficient but do not always guarantee the accuracy of their analysis because they tend to over-estimate what is affected. When an impact analysis tool indicates that some data is affected, it does not always mean that the data will need to be changed (such as to reformat the date-related data and programs for Year2000 readiness).
o ANALYZE METRICS Collects, analyzes, and reports the results of metrics quantification and analysis activities. These tools can analyze and predict how much work, in quantification, will be needed to reformat the date related data and programs for the year 2000, based on a metrics or cost model. You must validate the accuracy of the metrics you intend to use; that is, its predictions against actual human performance in real-life situations.
o ANALYZE DATABASE Investigates the structure and flow within a database to observe the characteristics of the database and determine if certain measurements/requirements can be realized; for example, analyze the year fields of the databases for any use and cross reference of 2-digit years.
To help manage the project, you can use tools to:
o INVENTORY SOFTWARE
Determines all code, JCL, databases, and other programs that constitute your system to provide a complete list for impact analysis. The list can be further divided into lists of sub-systems when partitioning and prioritization of the project is necessary.
o TRACK CHANGES
Tracks and logs all requests for code and/or data changes. Requests are tracked through completion or resolution. Any inconsistent/missing changes of data or programs due to date format changes will then be minimized.
To analyze programs and data, at a program level, you can use tools to:
o ANALYZE DATA FLOW
Shows the flow of data among modules in procedures or programs. Determines if a data-flow diagram is complete, consistent, and adheres to those rules established that govern flow. This provides both high- and low-level views of data flow within the system, and can be used to verify completeness of the program and data changes.
o DIAGRAM LOGIC STRUCTURE
Diagrams how program modules call sub-modules, and what data and control information these program modules share. These tools display multiple program views.
o DIAGRAM DATA STRUCTURE
Diagrams the representation of appropriate parts of a data model as the structure is used by a database management systems structure and relational structures.
o DIAGRAM RELATIONSHIPS
Illustrates multiple relationships of a program module or data element at the same time. This is useful to understand how data is shared among the programs that have access to it.
o DIAGRAM DECOMPOSITION
Allows a high-level overview specification, for a design or data model, to be successfully decomposed into smaller entities for further observation and analysis. It facilitates the partitioning of a project that is too large to tackle all at once.
o SLICE PROGRAMS
Allows you to view all the code affecting a given variable or statement. Forward slicing starts with a name or statement, and indicates what that name or statement affects. Backward slicing starts with a name or statement, and indicates all the parts of the program that could affect it.
o ANALYZE LOGIC
Inspects the use of control logic within a program, determines if it is proper, and mechanizes the specified design. It is useful for verification and validation of the correct manipulation of time when windowing techniques are used.
To help edit and restructure code for your programs, you can use tools to:
o POWER BROWSE
Allows you to scan and inspect code. Scanning can be switched between program (data) structure charts and code. These tools are more powerful than regular text editors. They can provide, for example, syntax checking, sophisticated capability to find data or information, or the ability to edit multiple programs. These types of tools can also include reverse engineering tools or maintenance workbench tools.
o FIND DATES
Locates date-oriented data, variables, declarations, comments, or other information in code for investigation of potential reformatting.
o COMPARISON
Compares two software programs, files or data sets to identify commonalities and/or differences. It is extremely useful for verification of program changes when date reformatting is done by simple field expansion.
o CROSS REFERENCE
Lists where variables, procedures, or other items are located in the code. These tools speed up browsing and provide a limited form of impact analysis.
o EXPAND FIELDS
Automatically expands 2-digit-year fields into 4-digit-year fields. It saves editing time tremendously and provides complete coverage of field expansion.
o ANALYZE INTERFACES
Determines if a range of variables in the programming interfaces is correct, as the variables are referenced across the reference boundaries. It can designate 4-digit-year format as a standard interface and enforce the standard in the programming interfaces.
o ANALYZE STANDARD/CONSISTENCY
Determines whether prescribed development standards have been followed. Identifies inconsistency in conventions used in requirements, designs, or programs. These tools can help you introduce standard or more uniform names to date-oriented fields or keywords, and improve the consistency and accuracy of data. These tools enforce consistent indentation and alignment.
o TRACE REQUIREMENTS
Traces how the requirements are realized in the design and code.
o MODULARIZE CODE
Generates modular code and top-down control flow. Reduces the scope of complex programs by creating separate modules. Identifies routines that are frequently referenced or changed, for example date/time services routines, and creates re-usable code libraries.
o STANDARD DATE SUBROUTINE
Creates reusable program modules that have correctly implemented date handling. These date subroutines can replace individually developed date subroutines to standardize the use of a date routine. These tools also reduce the chance of error and the cost of development, maintenance, and testing.
To generate code for your programs, you can use tools to:
o GENERATE DATABASE CODE
Generates database code directly from the data structure diagram.
o PAINT SCREEN
Generates code for the screens of a computer-user dialog or data entry when the screens need update for reformatting of date.
o GENERATE DIALOG
Generates dialogs that conform to specified standards, for example, 4-digit-year input/output standard in any dialog.
o GENERATE REPORTS
Generates code for the structure and layout of a report, along with calculations of derived fields in the report.
o GENERATE CODE
Generates executable code from high-level specifications.
To automate testing for your programs, you can use tools to:
o SIMULATE
Represents certain features or functions of the behavior of a physical or abstract system. One example of such a tool is a clock simulator that can change your system clock, while being transparent to your programs. Tools such as these provide an easy way to quickly expose your programs to Year2000 scenarios.
o ANALYZE TESTS
Determines the test case coverage on a set of programs being tested (whether a segment of code had been tested by other testing).
o GENERATE TEST DATA
Generates test data directly from a specification and facilitates a sequence of testing steps.
o TEST DATA LIBRARIES
Organizes test data for use. These libraries are most useful in regression tests.
o TEST DRIVERS
Automates testing by triggering test cases during testing. These tools often provide test input, execute the test cases, compare actual test output with expected results, and report test results.
+--- THE IBM COBOL FAMILY --------------------------------------------------+ | | | IBM COBOL Family extends over multiple platforms: workstation (OS/2 and | | AIX) and host (MVS, VM, VSE, and OS/400). All the IBM COBOL compilers | | except for ILE COBOL (AS/400) share common components, which gives source | | and compiler compatibility across multiple platforms. | | | | The MVS & VM COBOL product is discussed in "The IBM COBOL Family for MVS | | & VM." The VSE COBOL product is discussed in "The IBM COBOL Family for | | VSE/ESA" on page 8-34. The OS/400 product is described in "IBM Tools for | | AS/400" on page 8-45. The OS/2 and Windows and the AIX products are | | described in "The IBM COBOL Family for the Workstations" on page 8-74. | | | +---------------------------------------------------------------------------+
IBM'S COBOL MAINFRAME PRODUCTS FOR S/370 AND S/390 ARE:
o COBOL for MVS & VM (new name for IBM COBOL/370)-the compiler
o Language Environment for MVS & VM (new name for Language Environment/370)-the run-time library
o CoOperative Development Environment (CODE/370)-edit/compile/debug tool
Companies need productive application development environments. A language compiler is only a portion of what application programmers need today to develop and maintain code. Tools that generate statistics from code; modularize, migrate, or restructure code; or search class libraries are becoming more and more important.
THESE TOOLS ASSIST IN MIGRATING YOUR EXISTING COBOL APPLICATIONS TO COBOL FOR MVS & VM:
o CCCA converts source code
o COBOL Structuring Facility supports analysis, reporting, and
restructuring
o CICS Application Migration Aid converts CICS macro-level source
o COBOL Report Writer Precompiler supports Report Writer code
o EDGE Portfolio Analyzer is a load library inventory tool.
o The Redeveloper in VisualAge for COBOL
Year2000 Highlights of IBM COBOL for MVS & VM
This COBOL compiler, COBOL for MVS & VM, is available today and provides full 4-digit year support with features including:
o Intrinsic functions o Sliding 100-year window Many applications were coded with 2-digit-year data. COBOL for MVS & VM provides intrinsic functions not available in our earlier COBOL compilers. Intrinsic functions include: o CURRENT-DATE o DATE-OF-INTEGER o DAY-OF-INTEGER o INTEGER-OF-DATE o INTEGER-OF-DAY o WHEN-COMPILED EXAMPLE OF OBTAINING THE 4-DIGIT YEAR WITH THE COBOL INTRINSIC FUNCTIONS: o DATE-OF-INTEGER gives YYYYMMDD o DAY-OF-INTEGER gives YYYYDDD
COBOL for MVS & VM provides full Year2000 support. It provides ANSI COBOL Standard Intrinsic Functions that give full date-manipulation capability with 4-digit year support. Language Environment for MVS & VM provides additional date manipulation with the Language Environment Callable Services. When the COBOL application program queries the system for the current date, COBOL for MVS & VM returns a 4-digit year.
You can use IBM VisualAge for COBOL, Professional for OS/2 to identify, change, recompile, and test your legacy code on the workstation. Using the VisualAge for COBOL, you can work from the workstation on code residing on the mainframe. Refer to "The IBM COBOL Family for the Workstations" on page 8-74 for more detail.
Features of IBM COBOL for MVS & VM
IBM COBOL for MVS & VM is the high-performance compiler with a supporting run-time environment product (Language Environment for MVS & VM), that facilitates multiple-language interaction. This is different from the single packaging of compiler and run-time environment for OS/VS COBOL and VS COBOL II.
Applications written using COBOL for MVS & VM can interface with a variety of IBM products, such as SQL/DB, DB2, CICS, GDDM, ISPF, and Data Window Services available on MVS/ESA. The consistent interlanguage communication support, common protocols, and suite of callable services provided by Language Environment for MVS & VM allows easier access to in-house applications or vendor packages written in COBOL for MVS & VM.
IBM COBOL for MVS & VM Release 2 brings object-oriented programming to the MVS COBOL programmer. Object-oriented extensions to the COBOL language syntax are provided for MVS. The System Object Model (SOM) is the core object oriented (OO) architecture for SOMobjects for MVS and is IBM's strategic architecture for building and manipulating class libraries. Enabling to SOM on MVS lets IBM COBOL programmers develop class libraries using native COBOL language with object-oriented extensions. The COBOL SOM objects permit COBOL object-oriented applications to access SOM objects implemented in other languages, in addition to full interoperability with existing COBOL applications and data.
o Intrinsic functions, which reduce the need for extensive algorithms.
o Access to all of the elements in a table at once, reducing the need for
explicit loops.
o Consistent interlanguage communications, common services, and common
functions, which help extend the useful life of existing applications.
o Support for Year2000.
o Capabilities to help application programmers incrementally enhance
applications.
o Help in maintaining and enhancing the investment in existing programmer
skills.
THE FOLLOWING FEATURES ARE INCLUDED IN IBM COBOL FOR MVS & VM RELEASE 2:
o Source-level compatibility with IBM VisualAge for COBOL for OS/2 and IBM
COBOL Set for AIX.
o Improved interoperability with C and C++.
o Performance enhancements.
o Mainframe Interactive Debug Tool Feature.
o Object-oriented language extensions--letting developers create
mission-critical business applications that run only on the host or as
part of a client/server application. These extensions are based on a
subset of the evolving ANSI OO COBOL Standard.
o Support for the direct creation of SOM objects on the host via COBOL
language syntax.
o Optional SOM Interface Definition Language (IDL) generation.
o Access to existing SOM-based class libraries.
IBM COBOL for MVS & VM Release 2 is compatible with VS COBOL II and IBM COBOL/370 Release 1. For object-oriented applications, customers must also order SOMobjects for MVS.
IBM COBOL for MVS & VM, with its improved interlanguage communications (ILC), allows you to:
o develop COBOL applications and integrate them with existing applications,
irrespective of the language used,
o use existing code in new applications (code reuse) regardless of the
source code language used, and
o take advantage of functionality available in other software packages.
IBM COBOL for MVS & VM includes VS COBOL II language features, enhanced compiler options, virtual storage constraint relief, structured programming language for improved programmer productivity, enhanced double-byte character set (DBCS) support, streamlined system interfaces, expanded code optimization, and flexible run-time options.
With IBM COBOL for MVS & VM, the "RES multitasking restriction" is lifted. Thus, independent COBOL applications can be executed under different tasks in the same MVS address space. In particular, COBOL applications can be executed from both halves of an ISPF split screen.
With Language Environment for MVS and VM, interlanguage communication in mixed-language applications is easy, efficient, and consistent. You can share and reuse code easily. You can write a service routine in the language of your choice--C, C++, COBOL, Fortran, PL/I, or assembler--and then allow that routine to be called from C, C++, COBOL, Fortran, PL/I, or assembler applications. Similarly, vendors can write one application package in the language of their choice and allow the application package to be called from C, C++, COBOL, Fortran, PL/I, and assembler routines.
Language Environment for MVS & VM enables existing applications to function as with pre-Language Environment runtime libraries with little, if any, changes required, thus helping preserve company investment in those applications. Language Environment for MVS & VM condition handler permits programs to handle errors in a predictable, logical manner without highly-specialized routines.
Language Environment for MVS & VM replaces the existing language-specific run-time libraries and provides a common run-time environment for all languages that conform to the Language Environment architecture. In a single product, Language Environment for MVS & VM combines essential run-time services, such as routines for message handling, condition handling, and storage management. All these services are available through a set of interfaces that are consistent across programming languages. With Language Environment for MVS & VM, application programmers can use one run-time environment for their applications, regardless of the programming language or system resource needs.
Today, IBM Language Environment for MVS & VM is the pre-requisite run-time library for IBM COBOL for MVS & VM, C/C++ for MVS/ESA, and PL/I MVS & VM. IBM realizes the importance our customers place on complete, open, high-quality solutions. Therefore, IBM has established an IBM Language Environment Partner Program that encourages and assists tool and application package vendors to support and take advantage of Language Environment services. Companies with existing 3GL applications will benefit from the wider choice of tools and application packages.
LANGUAGE ENVIRONMENT FOR MVS & VM PROVIDES A NUMBER OF ADVANTAGES OVER OTHER PACKAGES:
o Ability to parse dates in an infinite number of formats by using a
picture string feature as a parsing guide.
o Provide NLS support by using a built-in table of defaults based on a
country code.
o A sliding window feature.
IBM Language Environment for MVS & VM provides a valuable short-term solution with the sliding 100-year window feature. If you are unable to change all of your applications and data at the same time, this feature allows 2-digit years to be interpreted in a 100-year window. Any 100-year window can be selected. You pass a valid date containing a 2-digit year to Language Environment and Language Environment returns an integer date based on the 100-year window.
The advantage to the 100-year window is that you need to change only the application code and not the databases or files with 2-digit years. This lets you change the application programs one at a time or groups at a time without affecting your data files. Note, this only works for dates that range less than 100 years. For example, dates of birth may not be appropriate for this solution; a person born in '94' could be over 100 years of age.
Disadvantages of the 100-year window are:
- It doesn't last forever. If your application has a long life expectancy, you may need to go back and replace the 100-year window with full 4-digit year support. Some of your applications will be replaced prior to those changes.
- Your system will likely experience some performance impact due to the additional programming logic used to determine and append the century digits.
IBM CoOperative Development Environment/370 (CODE/370) has been replaced by the VisualAge for COBOL for OS/2. This lets you use the workstation to edit, compile, and debug COBOL source code that resides on a host computer. For details about this product, refer to "The IBM COBOL Family for the Workstations" on page 8-74.
Other Host COBOL Compilers for MVS & VM
IBM has developed three COBOL products for the MVS & VM mainframe: OS/VS COBOL, VS COBOL II, and COBOL for MVS & VM.
OS/VS COBOL was withdrawn from marketing in June of 1992 and withdrawn from service in June of 1994. This section describes issues involved with migrating from OS/VS COBOL to COBOL for MVS & VM.
MIGRATING FROM OS/VS COBOL: Because OS/VS COBOL service has been discontinued, IBM encourage companies to upgrade their COBOL technology to COBOL for MVS & VM (compiler) with Language Environment for MVS & VM (run-time library). This is especially important for the Year2000 solution providing 4-digit year support. Depending on which product is currently being used and how fast a company is willing to migrate, you can take three possible migration paths:
1. OS/VS COBOL TO COBOL FOR MVS & VM We encourage companies with OS/VS COBOL to migrate directly to IBM COBOL for MVS & VM (compiler) and IBM Language Environment for MVS & VM (run-time library) if the IBM Language Environment for MVS & VM prerequisites are met. See the IBM Language Environment for MVS & VM Licensed Program Specification for prerequisite information.
2. OS/VS COBOL TO VS COBOL II TO COBOL FOR MVS & VM Companies with OS/VS COBOL who do not yet meet the IBM Language Environment for MVS & VM prerequisites must migrate to VS COBOL II first. After the IBM Language Environment for MVS & VM prerequisites are met, then companies can move to IBM COBOL for MVS & VM.
3. VS COBOL II TO COBOL FOR MVS & VM After the IBM Language Environment for MVS & VM prerequisites are met, companies with VS COBOL II can migrate to IBM COBOL for MVS & VM.
Each successive COBOL product contains more capabilities than the previous product.
VS COBOL II: VS COBOL II builds on the functions of OS/VS COBOL but has a variety of features that provide many advantages over earlier IBM COBOL products. VS COBOL II includes additional language features, enhanced compiler options, virtual storage constraint relief, structured programming language for improved programmer productivity, enhanced double-byte character set (DBCS) support, streamlined system interfaces, expanded code optimization, flexible run-time options, and support for VSE/ESA's 31-bit addressing feature.
Companies that do not yet meet the IBM Language Environment for MVS & VM prerequisites should run VS COBOL II until they can migrate to Language Environment.
VS COBOL II does provide some support for the Year2000 transition:
o The date-identifier CALL 'IGZEDT4' USING BY REFERENCE returns the current
date in the form YYYYMMDD. IGZEDT4 is provided because VS COBOL II does
not include support for the 4-digit year. The ability to obtain a
4-digit-year date was first included in COBOL/370 release 1.
o For VS COBOL II programs that are running under Language Environment the
following routines can be using dynamic CALLs only:
CEECBLDY--Convert Date to COBOL Integer Format
CEEDATE--Convert Lilian Date to Character Format
CEEDATM--Convert Seconds to Character Timestamp
CEEDAYS--Convert Date to Lilian Format
CEEDYWK--Calculate Day of Week from Lilian Date
CEEGMT--Get Current Greenwich Mean Time
CEEGMTO--Get Offset from Greenwich Mean Time to Local Time
CEEISEC--Convert Integers to Seconds
CEELOCT--Get Current Local Date or Time
CEEQCEN--Query the Century Window
CEESCEN--Set the Century Window
CEESECI--Convert Seconds to Integers
CEESECS--Convert Timestamp to Seconds
CEE3CTY--Set Default Country
Thus, there are various ways to make VS COBOL II programs Year2000-ready. However:
o IGZEDT4 is not supported under CICS.
o The VS COBOL II compiler is not Year2000 ready because it has no COBOL language support for 4-digit years and none is planned.
o IBM COBOL for MVS & VM, IBM COBOL for VSE/ESA, IBM VisualAge for COBOL of OS/2, IBM COBOL Set for AIX, and ILE COBOL for AS/400 are all Year2000 ready.
BENEFITS OF COBOL MIGRATION: OS/VS COBOL is the ANSI 68/74 compiler. ANSI 85 introduced many significant functions which are provided to customers in either VS COBOL II or COBOL for MVS & VM and its companion host product, COBOL for VSE/ESA. Customers who have migrated to the newer COBOL Standard have additional function, increased developer productivity, and exploitation of S/390 hardware capabilities. Benefits of upgrading COBOL technology are:
o Improved Interlanguage Communication (ILC).
o Condition management features of Language Environment, which bring PL/I-like condition handling to COBOL and C.
o Fully Year2000 ready.
o Language Environment callable services, including a date/time service routine that interprets a 2-digit year to a 4-digit year to accommodate the year 2000.
o Improved application performance of COBOL for MVS & VM compared to VS COBOL II for ILC and dynamic call users.
o Increased maintenance productivity from structuring tools such as IBM's COBOL Structuring Facility that is part of the Redeveloper in VisualAge for COBOL, Professional for OS/2.
o Object-oriented extensions in COBOL for MVS.
For more information on the value of migrating from OS/VS COBOL or VS COBOL II to COBOL for MVS & VM, obtain a copy of Why Migrate to COBOL and Language Environment?, which is available from your IBM representative (COBMGVAL PACKAGE on MKTTOOLS) or by calling 1-800-IBM-3333 extension STAR703. This document contains examples of customer benefits of migrating to COBOL for MVS & VM.
For a detailed explanation of why and how to migrate to COBOL for MVS & VM and to Language Environment, refer to Compiler and Run-Time Migration Guide, GC26-4764.
+--- CONVERTING ON THE WORKSTATION -----------------------------------------+ | | | The Redeveloper in the VisualAge for COBOL, Professional for OS/2 lets | | you convert and structure COBOL programs using the workstation with a GUI | | interface. Refer to "Redeveloper Tools" on page 8-79 for details on this | | component instead of CCCA and COBOL/SF. | | | +---------------------------------------------------------------------------+
COBOL and CICS/VS Command Level Conversion Aid (CCCA) is an effective tool that makes it easier to convert old COBOL source code and copy modules to the new COBOL standard. CCCA converts OS/VS COBOL, DOS/VS COBOL, and COBOL 74 Standard VS COBOL II (either VS COBOL II Release 1 and 2 or VS COBOL II Release 3 and 4 (CMPR2)) source code to COBOL 85 Standard VS COBOL II Release 3 or 4 (NOCMPR2) or to IBM COBOL for MVS & VM.
In cases where a statement is no longer supported and has no equivalent statement in the target COBOL, CCCA flags the statement. You can use CCCA to convert from OS/VS COBOL to COBOL for MVS & VM and to convert from OS/VS COBOL to VS COBOL II. The source file output for compiling under VS COBOL II can also be used for compiling under COBOL for MVS & VM.
When converting from OS/VS COBOL, you can use the COBOL Structuring Facility, a re-engineering tool, to automatically invoke CCCA. This lets you convert programs before structuring them with the COBOL Structuring Facility.
CCCA identifies and converts source code incompatibility, to reduce the effort required to convert programs, and to minimize conversion errors. You can customize the conversion process to meet unique conversion requirements. Installation and usage are easy, fast, and straightforward.
CCCA KEY BENEFITS ARE:
o Identification and conversion of source code
o Reduction of the effort required to convert programs
o Minimization of conversion errors
o Enhanced programmer productivity during migration.
CCCA PROVIDES FACILITIES TO:
o Convert most syntax differences between OS/VS COBOL, DOS/VS COBOL, or VS
COBOL II Release 1 or 2, and the current release of VS COBOL II and COBOL
for MVS & VM programs.
o Convert EXEC CICS commands.
o Remove and/or convert the base locator for linkage (BLL) section
mechanism and references.
o Eliminate conflicts between user-defined names and words reserved for VS
COBOL II.
o Convert both source programs and copy modules.
o Create conversion management reports.
o Produce a statement-by-statement diagnostic listing showing the result of
the conversion process for each program.
o Change and/or create COBOL conversion modules.
o Allow foreground conversion of CICS programs.
o Perform conversion from various levels of COBOL into other COBOL levels
through an open converter design.
o Read from PDSEs, not just PDSs.
COBOL Structuring Facility
+--- CONVERTING ON THE WORKSTATION -----------------------------------------+ | | | The Redeveloper in the VisualAge for COBOL, Professional for OS/2 lets | | you convert and structure COBOL programs using the workstation with a GUI | | interface. Refer to "Redeveloper Tools" on page 8-79 for details on this | | component instead of CCCA and COBOL/SF. | | | +---------------------------------------------------------------------------+
IBM COBOL Structuring Facility/MVS & VM (COBOL/SF) reduces the amount of time needed to maintain code by automatically transforming complex unstructured programs into structured programs. Improved maintenance productivity frees programmers to focus on creating new applications. COBOL/SF promotes application redevelopment by providing a set of complexity metrics for inventory analysis. Information provided on program complexity and control flow can promote code reuse and speed up the development of new applications.
COBOL/SF provides a connection to COBOL and CCCA that automates the conversion of COBOL code to a higher-level standard and new COBOL technology. COBOL/SF also provides access to VIA/Renaissance (ViaSoft), which does program slicing to extract program logic from COBOL source code and generate self-contained program modules. These three tools can be used together to automatically convert, restructure, and modularize COBOL applications for use in maintenance, code sharing, new development, or modularizing any date calculation or processing.
COBOL/SF automatically produces a structured COBOL program from unstructured source code. In addition, statistical metrics, structure charts to aid in program understanding, and modularization analysis reports are provided.
Three steps form the basis for creating program parts that you can use in a client/server application architecture:
1. Converting OS/VS COBOL to VS COBOL II or to COBOL for MVS & VM 2. Restructuring 3. Modularizing to create functional program units.
If the functional units are wrapped with an object-oriented COBOL wrapper, then you can use these primitive parts for new OO applications.
STRUCTURING FACILITY PROVIDES:
o Analysis of potential problem areas in source code and expert advice on
how to manually improve source code quality.
o Improved reporting capability and visual program display.
o Online tutorial.
o Comprehensive online documentation.
o Automatic structuring of COBOL code containing:
CICS HANDLE commands
COBOL for MVS & VM intrinsic functions
Language Environment for MVS & VM support
o Cross-reference browser.
o Conformance to CUA 1991 standards.
o DBCS support consistent with IBM COBOL for MVS & VM enablement.
COBOL/SF is more than a one-time restructuring tool. You can use it regularly to maintain structured programs for ease of maintenance and program understanding. By offering modularization advice, COBOL/SF also proves useful as a redevelopment tool to aid in isolating reusable program functions such as standard date routines. It is generally recommended that a program be restructured whenever 10 to 15 percent of a program has changed because of program errors or enhancements.
CICS Application Migration Aid
The CICS Application Migration Aid assists you to convert CICS applications from the macro-level API to the command-level API. Applications written in assembler or COBOL can be used with the migration aid.
Old CICS transactions used a macro-level interface. However, CICS/ESA V3.3 (which is required when using Language Environment for MVS & VM ) does not support the macro level. Instead it requires a command level for applications to run on CICS/ESA V3.
The CICS Application Migration Aid simplifies and speeds the conversion of COBOL and Assembler language application programs from macro to command level. The tool completely converts simple macros and provides guidance on converting more complex macros.
Conversion is key not only to using Language Environment for MVS & VM but also to obtain the benefits of the CICS command-level application interface (API), which is common across the CICS family.
COBOL Report Writer Precompiler
You can use the COBOL Report Writer Precompiler to perform two functions: 1) to permanently convert Report Writer statements to valid COBOL statements that can be compiled in IBM COBOL for MVS & VM or IBM COBOL for VSE/ESA, or 2) to precompile applications containing Report Writer statements so the code will be acceptable to the IBM COBOL for MVS & VM or IBM COBOL for VSE/ESA compiler.
When used to precompile, the Precompiler automatically invokes the IBM COBOL compiler as though Report Writer statements in the source program were being processed by the IBM COBOL for MVS & VM or IBM COBOL for VSE/ESA compiler itself. The fact that two separate processes are involved is transparent to you.
The EDGE Portfolio Analyzer Version 1 can significantly reduce the effort necessary to migrate from earlier versions of IBM host COBOL and PL/I compilers to the latest levels of these products.
This migration tool analyzes existing application load libraries and provides data and statistical information about:
o Which release of a compiler and what compiler and linkage editor options
were used to produce an existing load module.
o Application programs:
- Containing shared subroutines
- Requiring re-linking of run-time modules as a result of any arbitrary
change
- Impacted by implementation of a new run-time package
- Not expected to be affected by the implementation of a new run-time
package
- Containing interlanguage dependencies that may prove obstacles to
migration
o Load modules not conforming to the installation's established compiler
and linkage editor standards.
o Performance improvements of certain load modules simply by recompiling
them with different options.
The EDGE Portfolio Analyzer frees you from many hours of tedious investigation and lets you move more quickly into the new complier environment.
WITT Year2000 for OS/2 is a test tool to assist you in testing of the Year 2000 transformation.
COBOL programmers can use WITT Year2000 as a GUI test tool that automatically facilitates the creation of reusable unit test, function test, system test, and regression test cases. You can create these reusable test cases when you develop or implement a newly developed program, and you should run them continuously during the years that the program is maintained. Once created, the test cases can be played back interactively or in an unattended batch mode. The execution of a set of WITT test cases provides an audit trail of errors that a tester can provide to a programmer to document program failures.
WITT automatically records and plays back all keystroke and mouse movements and compares and identifies test inconsistencies between benchmark test cases and test cases run after you make enhancements and fixes to a program. This automatic playback and comparison capability is best suited for testing of Year 2000 transformation work. Because once you make a modification to an application programs, you should test repeatedly with a variety of system dates such as:
o 1997/02/28 (1997-February-28) o 1999/12/31 (1999-December-31) o 2000/01/01 (2000-January-01) o 2000/02/29 (2000-February-29) o 2004/02/29 (2004-February-29)
WITT also allow you to add program intelligence to your test cases though scripting in 2/REXX, thus easing your modification of WITT to meet your needs.
WITT Year2000 installs on an OS/2 desktop and allows the testing of OS/390, MVS, VM, IMS, CICS, OS/400, and OS/2 PM and Text (that is, Micro Focus and CICS/OS2) applications.
For application code written in PL/I for S/370 and S/390 (for OS/390, MVS, and VM) platforms, IBM has developed a PL/I compiler. These products target the host application development environment.
IBM's PL/I mainframe products for S/370 and S/390 are:
o PL/I FOR MVS & VM - the compiler o LANGUAGE ENVIRONMENT FOR MVS & VM - the run-time library o COOPERATIVE DEVELOPMENT ENVIRONMENT (CODE/370) - edit/compile/debug tool
Features
This PL/I compiler, PL/I for MVS & VM, is available today and provides full 4-digit year support with features including:
o Built-in functions o Sliding 100-year window
PL/I for MVS & VM provides full Year2000 support. It provides a built-in function which provides 4-digit-year support. Language Environment for MVS & VM provides additional date manipulation with the Language Environment Callable Services. PL/I for MVS & VM will return a 4-digit year when the PL/I application program queries the system for the current date.
Companies need productive application development environments. A language compiler is only a portion of what application programmers need today to develop and maintain code. Tools to:
o generate statistics o modularize, migrate, or restructure code o search class libraries. These tools assist in developing PL/I applications with PL/I for MVS & VM: o EDGE PORTFOLIO ANALYZER - load inventory tool o WITT Product Family - testing
IBM PL/I for MVS & VM is the high-performance PL/I compiler for the MVS/ESA and VM/ESA environments.
PL/I for MVS & VM provides the capability of integrating PL/I applications into IBM Language Environment for MVS & VM. Language Environment for MVS & VM, a common run-time environment, supports assembler, FORTRAN, and PL/I for MVS & VM, COBOL for MVS & VM, and C/C++ for MVS/ESA. Together, Language Environment and its supported languages create a common run-time environment. This integration allows you to take advantage of features from both PL/I and Language Environment. In addition, common function across the supported languages and platforms improves usability as well as programmer productivity.
Applications written using PL/I for MVS & VM can interface with a variety of IBM products, such as SQL/DB, DB2, CICS, IMS, and Data Window Services available on OS/390 and MVS/ESA. The consistent interlanguage communication support, common protocols, and suite of callable services provided by Language Environment for MVS & VM is designed to allow easier access to in-house applications or vendor packages written in PL/I for MVS & VM.
IBM PL/I for MVS & VM together with Language Environment for MVS & VM provide:
o Consistent interlanguage communications, common services, and common
functions, which helps extend the useful life of existing applications
o Improved dynamic calls
o Support for Year2000
o Capabilities to help application programmers incrementally enhance
applications
o Help in maintaining and enhancing the investment in existing programmer
skills
IBM PL/I for MVS & VM, with its improved interlanguage communications (ILC),
allows you to:
o develop PL/I applications and integrate them with existing applications,
irrespective of the language used,
o use existing code in new applications (code reuse) regardless of the
source code language used, and
o take advantage of functionality available in other software packages.
IBM PL/I for MVS & VM includes enhanced compiler options, virtual storage constraint relief, structured programming language for improved programmer productivity, enhanced double-byte character set (DBCS) support, streamlined system interfaces, expanded code optimization, and flexible run-time options.
IBM Language Environment for MVS & VM is IBM's common runtime environment for enterprise applications written in assembler, COBOL, PL/I, C, and FORTRAN. Language Environment for MVS & VM is designed to provide defined calling conventions, enhanced interlanguage communication, callable services, language-specific services (for example, common facilities messages), common math functions, application utilities, system services, and subsystem support for Customer Information Control System (CICS) and Information Management System (IMS).
With Language Environment for MVS & VM, application programmers can extend and integrate their applications and packages, as well as reuse code with greater flexibility, due to interlanguage communication and native language restrictions. Application packages may be extended with the language of choice. Language Environment for MVS & VM enables existing applications to function as before with little, if any, changes required, thus helping preserve company investment in those applications. Language Environment for MVS & VM condition handler permits programs to handle errors in a predictable, logical manner without highly-specialized routines.
Language Environment for MVS & VM replaces the existing language-specific run-time libraries and provides a common runtime environment for all languages that conform to the Language Environment architecture. In a single product, Language Environment for MVS & VM combines essential run-time services, such as routines for message handling, condition handling, and storage management. All these services are available through a set of interfaces that are consistent across programming languages. With Language Environment for MVS & VM, application programmers can use one runtime environment for their applications, regardless of the programming language or system resource needs.
Today, IBM Language Environment for MVS & VM is the run-time library for the Language Environment-enabled compilers IBM COBOL for MVS & VM, C/C++ for MVS/ESA, and PL/I MVS & VM. IBM realizes the importance our customers place on complete, open, high-quality solutions. Therefore, IBM has established an IBM Language Environment Partner Program at the IBM Santa Teresa Laboratory. This program encourages and assists tool and application package vendors to support and take advantage of Language Environment services. Companies with existing 3GL applications will benefit from the wider choice of tools and application packages.
Language Environment for MVS & VM provides a number of advantages over other packages; its capabilities include:
o Ability to parse dates in the most commonly used formats by using a picture string feature as a parsing guide
o Provide NLS support by using a built-in table of defaults based on a country code
o A sliding window feature
IBM Language Environment for MVS & VM provides a valuable short term solution with the 100-year window feature. If you are unable to change all of your applications and data at the same time, the 100-year window feature allows 2-digit years to be interpreted in a 100-year window. Any 100-year window can be selected. You pass a valid date containing a 2-digit year to Language Environment and Language Environment returns an integer date based on the 100-year window.
The advantage to the 100-year window is that you need to change only the application code and not the databases or files with 2-digit years. This allows you to change the application programs one at a time or groups at a time without effecting your data files. Note, this only works for dates that range less than 100 years. For example, dates of birth may not be appropriate for this solution; a person born in '94' could be over 100 years of age.
The disadvantage to the 100-year window is that it doesn't last forever. If your application has a long life expectancy, you many need to go back and replace the 100-year window with full 4-digit year support. Some of your applications will be replaced prior to this formatting change.
IBM CoOperative Development Environment/370 (CODE/370) -- the common editor, compiler, debug tool -- provides a cooperative environment, allowing application programmers to more productively develop and maintain host IBM 3GL applications from the workstation. CODE/370 provides a consistent, graphical user interface across different platforms and languages, a language-sensitive editor, language-sensitive help, a compiler invocation facility, and an interactive debug tool. CODE/370 combines the richness of the S/370 or S/390 subsystem environments and the power of IBM Language Environment for MVS & VM to provide a host Debug Tool which allows programmers to find bugs, fix bugs, and test applications. The Debug Tool is available either as a stand-alone 3270 host debug tool (for programming shops where workstations are not available) or with an optional graphical workstation user interface.
CODE/370's cooperative environment allows application programmers to perform host programming tasks, such as compiling and debugging, from a workstation. Through cooperative processing, users perform functions locally on the workstation while interactively accessing the programs, data, and compilers residing on a host system. The optional workstation interface combines the Edit and Compile / Link functions together with the Debug Tool graphical user interface (GUI).
The powerful workstation-based editor integrates a rich set of functions that will speed up your application-development activities. The editor works with any type of source. The language-sensitive features help optimize coding efficiency in COBOL, C, PL/I, REXX, and JCL. Source can be stored in an MVS data set, a VM file, or an OS/2 file. As you edit source in any of these formats, CODE/370 maintains the sequence numbers and date stamps.
This method of workstation/host tool integration offers the best use of the two environments: the S/370 subsystem environments' "live" debug capabilities and the workstation GUI's easy editing capabilities. The integration also allows programming shops to grow at their own pace into developing host applications on workstations.
When programmers use the Debug Tool, the debug session is recorded in a log file, permitting edit and replay of a Debug Tool session. This allows the Debug Tool to be used to capture test cases (for future program validation) or to further isolate a problem within an application. This also allows both interactive and batch debugging of a programmer's application.
CODE/370 provides:
o Support for COBOL/370 Rel 1, COBOL for MVS & VM Rel 2, C/370 and PL/I MVS
& VM
o Limited support for VS COBOL II Rel 3.1, 3.2, and 4.0 and OS PL/I Ver 2
Rel 1, 2, and 3
o A 32-bit, user-programmable editor
o Several language-sensitive editing features for REXX and JCL
o Enhanced support for debugging under CICS:
- Pseudo conversational transaction support for COBOL applications
- Support for the full range of single-terminal Send and Receive
messages
o Program Generator, an independent compile/link program that allows
compiling from inside and outside the editor
o REXX and JCL programs can be submitted to the host from the Editor window
o An OS/2 desktop tool called WorkFrame/2
o Advanced Program to Program Communication (APPC) protocol support for
cooperative sessions between the MVS host and the workstation
o Support for debugging COBOL applications consisting of multiple enclaves
and multiple processes
o Debug Tool support for exception handling of COBOL IGZ exceptions
o The ability to perform initial installation of CODE/370's workstation
feature from a LAN server.
Other Host PL/I Compilers for MVS & VM
Other host PL/I compilers developed for the MVS and VM mainframe: OS PL/I V1, OS PL/I V2.
OS PL/1 V1 was withdrawn from service in 1995-December. This section discusses issues involved with migrating from OS PL/I V1. The two PL/I mainframe products that will continue to be available are PL/I for MVS & VM and OS PL/I V2.
Because OS PL/I V1 (5734-PL1, 5734-PL2, 5734-PL3, 5734-LM4) will be discontinued, we are encouraging companies to upgrade their PL/I technology to PL/I for MVS & VM (compiler) with Language Environment for MVS & VM (run-time library). Depending on which product is currently being used and how fast a company is willing to migrate, here are three possible migration paths that can be followed.
MIGRATION PATHS: The three paths are:
1. OS PL/I V1------------------>PL/I for MVS & VM
Companies with OS PL/I V1 are encouraged to migrate directly to IBM PL/I for MVS & VM (compiler) and IBM Language Environment for MVS & VM (run-time library) if the IBM Language Environment for MVS & VM prerequisites are satisfied. See the IBM Language Environment for MVS & VM Licensed Program Specification for prerequisite information.
2. OS PL/I V1---->OS PL/I V2---->PL/I for MVS & VM
Companies with OS PL/I V1 who do not yet satisfy the IBM Language Environment for MVS & VM prerequisites must migrate to OS PL/I V2 first. When the IBM Language Environment for MVS & VM prerequisites are satisfied, then move to IBM PL/I for MVS & VM.
3. OS PL/I V2---->PL/I for MVS & VM
Companies with OS PL/I V2 can migrate to IBM PL/I for MVS & VM once the IBM Language Environment for MVS & VM prerequisites are satisfied.
Edge Portfolio Analyzer - Language Migration Tool
The Edge Portfolio Analyzer Version 1 can significantly reduce the effort necessary to migrate from an earlier version of an IBM host PL/I compiler to the latest level of this product. (The Edge Portfolio Analyzer also recognizes COBOL, C/C++, FORTRAN, Pascal, and Assembler programs.)
This migration tool analyzes existing application load libraries and provides data and statistical information about:
o Which release of a compiler and what compiler and linkage editor options
are used to produce an existing load module
o Application programs:
- Containing shared subroutines
- Requiring re-linking of runtime modules as a result of any arbitrary
change
- Impacted by implementation of a new runtime package
- Not expected to be affected by the implementation of a new runtime
package
- Containing interlanguage dependencies that may prove obstacles to
migration
o Load modules not conforming to the installation's established compiler
and linkage editor standards
Customers can save many hours of tedious investigation and move more quickly into the new compiler products.
WITT Year2000 for OS/2 is a test tool to assist you in testing of the Year 2000 transformation.
PL/I programmers can use WITT Year2000 as a GUI test tool that automatically facilitates the creation of reusable unit test, function test, system test, and regression test cases. You can create these reusable test cases when you develop or implement a newly developed program, and you should run them continuously during the years that the program is maintained. Once created, the test cases can be played back interactively or in an unattended batch mode. The execution of a set of WITT test cases provides an audit trail of errors that a tester can provide to a programmer to document program failures.
WITT automatically records and plays back all keystroke and mouse movements and compares and identifies test inconsistencies between benchmark test cases and test cases run after you make enhancements and fixes to a program. This automatic playback and comparison capability is best suited for testing of Year 2000 transformation work. Because once you make a modification to an application programs, you should test repeatedly with a variety of system dates such as:
o 1997/02/28 (1997-February-28) o 1999/12/31 (1999-December-31) o 2000/01/01 (2000-January-01) o 2000/02/29 (2000-February-29) o 2004/02/29 (2004-February-29)
WITT also allow you to add program intelligence to your test cases though scripting in 2/REXX, thus easing your modification of WITT to meet your needs.
WITT Year2000 installs on an OS/2 desktop and allows the testing of OS/390, MVS, VM, IMS, CICS, OS/400, and OS/2 PM and Text (that is, Micro Focus and CICS/OS2) applications.
DFSORT V1R13 (with PTF UN90139) provides Year2000 capabilities by providing the ability to sort, merge, and transform 2-digit years according to a specified sliding or fixed 100-year window. New Y2C, Y2Z, Y2P, and Y2D formats, in conjunction with a new Y2PAST installation and run-time option, allow you to handle 2-digit year data in the following ways:
o Set the appropriate 100-year window for your applications. For example, set a 100-year window of 1915-2014 or 1950-2049.
o Order 2-digit character, zoned decimal, packed decimal, or decimal year data, according to the 100-year window, using DFSORT's SORT and MERGE control statements. For example, order 96 (representing 1996) before 00 (representing 2000) in ascending sequence, or order 00 before 96 in descending sequence.
o Transform 2-digit character, zoned decimal, packed decimal, or decimal year data to 4-digit character year data, according to the 100-year window, using DFSORT's OUTFIL control statement. For example, transform 99 to 1999 and 04 to 2004.
These DFSORT enhancements allow you to continue to use 2-digit years for sorting and merging, and assist those situations when you want to change 2-digit-year data to 4-digit-year data.
Additional information about DFSORT/MVS and its Year2000 enhancements is available on the World Wide Web at URL:
http://www.storage.ibm.com/storage/software/sort/srtmhome.htm
Sliding 100-Year Window
A new installation and run-time option allows you to specify a sliding or fixed 100-year window to be used with 2-digit years. Y2PAST=s specifies a SLIDING 100-year window starting s years before the current year. For example, if the current year is 1996, Y2PAST=80 starts the 100-year window at 1996 - 80 = 1916, providing a 100-year window of 1916 through 2015. In 1997, this 100-year window automatically slides to 1917 through 2016.
Y2PAST=f specifies a FIXED 100-year window starting at f. For example, Y2PAST=1950 starts the 100-year window at 1950, providing a 100-year window of 1950 through 2049. Thus, Y2PAST allows you to control how DFSORT interprets the 2-digit years 00-99 on a site-wide or application-specific basis.
As an example, both Y2PAST=1915 and Y2PAST=81 used in 1996 give a 100-year window of 1915 through 2014, and result in the following interpretation of 2-digit year formatted data by DFSORT:
YY INTERPRETED AS: 00 2000 14 2014 15 1915 61 1961 62 1962 99 1999
2-Digit Year Formats
New formats allow you to identify 2-digit character, zoned decimal, packed decimal and decimal year data for special DFSORT processing as follows (yy represents 2-digit year data in the examples below):
FORMAT MEANING
Y2C identifies 2-digit, 2-byte character year data such as C'yy',
C'mm/dd/yy', or C'yy.mm.dd'
Y2Z identifies 2-digit, 2-byte zoned decimal year data such as Z'yy',
Z'mmddyy', or Z'yymmdd'
Y2P identifies 2-digit, 2-byte packed decimal year data such as P'yy',
P'dddyy', or P'yymmdd'
Y2D identifies 2-digit, 1-byte decimal year data such as X'yy' or
P'yyddd'
Sorting and Merging 2-Digit Years
You can use the new Y2C, Y2Z, Y2P, and Y2D formats in DFSORT's SORT and MERGE statements to identify specific 2-digit year data to be ordered according to the 100-year window.
A simple example of the control statements to sort a C'mm/dd/yy' field (assume the current year is 1996) follows:
* Set the 100-year window to 1962 through 2061
OPTION Y2PAST=34
* Sort C'mm/dd/yy' as C'yymmdd'
SORT FIELDS=(7,2,Y2C,A, * sort yy using 100-year window
1,2,CH,A, * sort mm
4,2,CH,A) * sort dd
These control statements provide the following sort results:
INPUT DATA SORTED
(CH) OUTPUT DATA
(CH)
06/22/15 03/18/62
10/03/00 09/01/99
11/14/61 10/03/00
08/16/14 08/16/14
09/01/99 08/17/14
03/18/62 06/22/15
08/17/14 11/14/61
Transforming 2-Digit Years to 4-Digit Years
You can use the new Y2C, Y2Z, Y2P, and Y2D formats in the OUTREC operand of DFSORT's OUTFIL statement to identify 2-digit year data to be changed to 4-digit year data according to the 100-year window.
A simple example of the control statements to transform a P'yyddd' field follows:
* Set the 100-year window to 1970 through 2069
OPTION COPY,Y2PAST=1970
* Change P'yyddd' to C'yyyy/ddd'
OUTFIL FNAMES=Y4,
OUTREC=(1,1,Y2D, * change X'yy' to C'yyyy' using
* * 100-year window
C'/', * insert C'/'
2,2,PD,M11) * change P'ddd' to C'ddd'
This code provides the following transformation results:
INPUT DATA TRANSFORMED (HEX) OUTPUT DATA (CH) 92012F 1992/012 70225C 1970/225 69153F 2069/153 00001F 2000/001 99321F 1999/321 12054C 2012/054
COMUDAS is a common date routine that offers necessary functions for validation, conversion, and calculation of dates in any commonly-used format. A standard interface must be used to call the date routine's load module dynamically.
The package also offers the possibility to use separate functions by means of NCALs, that can be linked statically. This might be useful when converting large files or databases with validated data into other formats (for example, when reformatting year-date notation in an application).
Functions are available for updating the Calendar Tables by means of the Online Facility, that also can be used to test the Date Routines, and to print calendars.
A CICS version, as well as an MVS version, of this package is available.
Features
COMUDAS provides features including:
o Date validation
o Date calculation
o Date conversion
o Free date-format definitions
o Supports country-dependent data
- Weekend definitions
- Closing dates (for both manufacturing and fiscal purposes)
- Holidays
o Can be used by MVS applications with PL/1 runtime environment or a
Language Environment, for:
- CICS (PL/1)
- PL/1
- COBOL
o Supports terms as:
- Country codes
- Shopdates (numbering of working days)
- Production months
- Closing dates (logistics/manufacturing & finance)
o Is able to print:
- Common calendars for years in range 1760 through 9999
- Production calendars (per country/year)
o Contains functions to support a calendar owner
o Can be used as a tool when changing applications to handle the year 2000.
Components
COMUDAS consists of two main components. First is the date routine
functions. An interface is supplied that can be filled with data, and
returned to the calling program, containing the requested information,
including a return code and return message. The interface is available in
both PL/1 and COBOL format. The date routine functions can be called by
applications:
o CICS (PL/1), for example, HPS applications
o PL/1
o COBOL
The second component, the online facility, used in a TSO/ISPF environment,
can be used to:
o Get familiar with the date routines.
An online presentation of the interface can be used to test the date
routine functions.
o Update the calendar tables.
All users (with read access) may view the contents of the calendar
tables, and the calendar owner can use this function to:
- Update the calendar tables
- Generate a new table to be used by the date routine functions
- Generate production calendars
o Print a calendar.
All users will be able to print a common calendar for years in range 1760
through 9999.
o Print a Production Calendar.
All users will be able to print a production calendar for a country and
year, that has previously been created by the calendar owner.
Using COMUDAS
When using COMUDAS, the following terms can be handled by the package:
o Day of the week (number, name, 3-character abbreviation)
o Day of the month (number)
o Day of the year (Julian notation)
o Week of the year (number)
o Production Month (number)
o Month of the year (number, name, 3-character abbreviation)
o Year (two or four digits)
o Year (related to a weeknumber; this value may differ from the earlier
mentioned year-field, because weeks do not always start on January 1)
o Shopdates
o SYSDATE
o European format of a date
o ISO (International Standards Organization) format of a date
o USA format of a date
o JIS (Japanese Industrial Standard) format of a date
o Remainder days of a subtraction of two dates
o Day number suffix (for example, 10th, 23rd)
o First shopdate of a week
o Last shopdate of a week
o Startdate of a production month
o Closing date of a production month
o Closing date finance
o Addition / Subtraction fields:
- +/- days
- +/- weeks
- +/- weeks and days
- +/- months
- +/- months and days
- +/- years, months and days
- +/- shopdays
Special Ordering Information
COMUDAS is a standard programming request for price quotation (PRPQ) and can be ordered through standard IBM ordering channels.
For application code written in COBOL for S/370 and S/390 (for OS/390, MVS, and VM) platforms, IBM has developed COBOL compilers. These products target the host application development environment.
IBM's COBOL mainframe products for S/370 and S/390 are:
o COBOL FOR MVS & VM (new name for IBM COBOL/370) - the compiler
o LANGUAGE ENVIRONMENT FOR MVS & VM (new name for Language Environment/370)
- the run-time library
o COOPERATIVE DEVELOPMENT ENVIRONMENT (CODE/370) - edit/compile/debug tool
See "The IBM COBOL Family for MVS & VM" on page 8-8 for detailed information about these COBOL tools.
For application code written in PL/I for S/370 and S/390 (for MVS and VM) platforms, IBM has developed PL/I compilers. These products target the host application development environment.
IBM's PL/I mainframe products for S/370 and S/390 are:
o PL/I FOR MVS & VM - the compiler
o LANGUAGE ENVIRONMENT FOR MVS & VM (new name for Language Environment/370)
- the run-time library
o COOPERATIVE DEVELOPMENT ENVIRONMENT (CODE/370) - edit/compile/debug tool
See "The IBM PL/I Family for MVS & VM" on page 8-20 for detailed information about these PL/I tools.
The REXX/EXEC Migration Tool for VM/ESA (VM/ESA MIGR) is a tool that helps migrate REXX, EXEC2, ASSEMBLE, and other source files to the current release of VM/ESA.
VM/ESA MIGR does not make changes, but can assist the user in the following areas:
o Estimating the migration effort that is necessary.
o Identifying changes that have to be made.
o Finding commands, options, etc. which are incompatible or have been
changed and presenting information about them through Help panels.
VM/ESA MIGR uses a keyword file (ESAMIGR SAMPLIST) to flag items which may cause incompatibilities. ESAMIGR SAMPLIST may be customized by the user to search for additional items or variations (such as command abbreviations) of items.
VM/ESA MIGR is shipped on a separate tape with the VM/ESA product. It is also available on MKTTOOLS, and through PUBORDER. Complete documentation is available in REXX/EXEC Migration Tool for VM/ESA, (GC24-5607).
+--- THE IBM COBOL FAMILY --------------------------------------------------+ | | | IBM COBOL Family extends over multiple platforms: workstation (OS/2 and | | AIX) and host (MVS, VM, VSE, and OS/400). All the IBM COBOL compilers | | except for ILE COBOL (AS/400), share common components, which gives | | source and compiler compatibility across multiple platforms. | | | | The MVS & VM COBOL product is discussed in "The IBM COBOL Family for MVS | | & VM" on page 8-8. The VSE COBOL product is discussed in "The IBM COBOL | | Family for VSE/ESA." The OS/400 product is described in "IBM Tools for | | AS/400" on page 8-45. The OS/2 and Windows and the AIX products are | | described in "The IBM COBOL Family for the Workstations" on page 8-74. | | | +---------------------------------------------------------------------------+
IBM has developed COBOL compilers for application code written in COBOL for S/370 and S/390 for the VSE platform. These products target the host application development environment.
IBM'S COBOL MAINFRAME PRODUCTS FOR S/370 AND S/390 VSE ARE:
o COBOL for VSE/ESA --the compiler o Language Environment for VSE/ESA --the run-time library
Companies need productive application development environments. A language compiler is only a portion of what application programmers need today to develop and maintain code. Tools that generate statistics from code; modularize, migrate, or restructure code; or search class libraries; are becoming more and more important.
THESE TOOLS ASSIST IN MIGRATING YOUR EXISTING COBOL APPLICATIONS TO COBOL FOR VSE/ESA:
o CCCA for VSE converts source code o COBOL Report Writer Precompiler supports Report Writer code
Year2000 Highlights of IBM COBOL for VSE
This COBOL compiler, COBOL for VSE/ESA, is available today and provides full 4-digit year support with features including:
o Intrinsic functions o Sliding 100-year window
COBOL for VSE/ESA provides full Year2000 support. It provides ANSI COBOL Standard Intrinsic Functions which give full date manipulation capability with 4-digit year support. Language Environment for VSE/ESA provides additional date-manipulation with the Language Environment Callable Services.
When the COBOL application program queries the system for the current date, COBOL for VSE/ESA returns a 4-digit year.
Many applications were coded with 2-digit year data. COBOL for VSE/ESA provides intrinsic functions not available in our earlier COBOL compilers. Calendar functions include:
o CURRENT-DATE o DATE-OF-INTEGER o DAY-OF-INTEGER o INTEGER-OF-DATE o INTEGER-OF-DAY o WHEN-COMPILED EXAMPLE OF OBTAINING THE 4-DIGIT YEAR WITH THE COBOL INTRINSIC FUNCTIONS: o DATE-OF-INTEGER gives YYYYMMDD o DAY-OF-INTEGER gives YYYYDDD
Features of IBM COBOL for VSE/ESA
IBM COBOL for VSE/ESA is the high-performance compiler with a supporting run-time environment product (Language Environment for VSE/ESA), that facilitates multiple-language interaction. This is different from the single packaging of compiler and run-time environment for DOS/VS COBOL and VS COBOL II.
Applications written using COBOL for VSE/ESA can interface with a variety of IBM products, such as SQL/DS and CICS. The consistent interlanguage communication support, common protocols, and suite of callable services provided by Language Environment for VSE/ESA gives you simple access to in-house applications or vendor packages written in COBOL for VSE/ESA.
IBM COBOL FOR VSE/ESA PROVIDES:
o Intrinsic functions, which reduce the need for extensive algorithms.
o Access to all of the elements in a table at once, reducing the need for
explicit loops.
o Consistent interlanguage communications, common services, and common
functions, which helps extend the useful life of existing applications.
o Improved dynamic calls.
o Support for Year2000.
o Capabilities to help application programmers incrementally enhance
applications.
o Help in maintaining and enhancing the investment in existing programmer
skills.
IBM COBOL for VSE/ESA provides facilities to acquire and integrate packaged software, consistent with the vendor's terms, into existing applications irrespective of the language used; use existing code in new applications (code reuse) regardless of the source code language used; and invoke functions between applications with improved interlanguage communication (ILC).
IBM COBOL for VSE/ESA includes VS COBOL II language features, enhanced compiler options, virtual storage constraint relief, structured programming language for improved programmer productivity, enhanced double-byte character set (DBCS) support, streamlined system interfaces, expanded code optimization, flexible run-time options, and support for the VSE/ESA 31-bit addressing feature.
IBM Language Environment for VSE/ESA is IBM's common run-time environment for enterprise applications written in COBOL and PL/I. Language Environment for VSE/ESA provides defined calling conventions, enhanced interlanguage communication, callable services, language-specific services (for example, common facilities messages), common math functions, application utilities, system services, and subsystem support for Customer Information Control System (CICS).
With Language Environment for VSE/ESA, interlanguage communication in mixed-language applications is easy, efficient, and consistent. You can share and reuse code easily. You can write a service routine in the language of your choice--COBOL, PL/I, or assembler--and then allow that routine to be called from COBOL, PL/I, or assembler applications. Similarly, vendors can write one application package in the language of their choice and allow the application package to be called from COBOL, PL/I, and assembler routines.
Language Environment for VSE/ESA enables existing applications to function as before with little, if any, changes required, thus helping preserve company investment in those applications. Language Environment for VSE/ESA condition handler permits programs to handle errors in a predictable, logical manner without highly-specialized routines.
Language Environment for VSE/ESA replaces the existing language-specific run-time libraries and provides a common run-time environment for all languages that conform to the Language Environment architecture. In a single product, Language Environment for VSE/ESA combines essential run-time services, such as routines for message handling, condition handling, and storage management. All these services are available through a set of interfaces that are consistent across programming languages. With Language Environment for VSE/ESA, application programmers can use one run-time environment for their applications, regardless of the programming language or system resource needs.
Today, IBM Language Environment for VSE/ESA is the run-time library for IBM COBOL for VSE/ESA and IBM PL/I for VSE/ESA. IBM realizes the importance our customers place on complete, open, high-quality solutions. Therefore, IBM has established an IBM Language Environment Partner Program that encourages, and assists, tool and application package vendors to support and take advantage of Language Environment services. Companies with existing 3GL applications will benefit from the wider choice of tools and application packages.
LANGUAGE ENVIRONMENT FOR VSE/ESA PROVIDES A NUMBER OF ADVANTAGES OVER OTHER PACKAGES:
o Ability to parse dates in an infinite number of formats by using a
picture string feature as a parsing guide.
o Provide NLS support by using a built-in table of defaults based on a
country code.
o A sliding window feature.
IBM Language Environment for VSE/ESA provides a valuable short-term solution with the sliding 100-year window feature. If you are unable to change all of your applications and data at the same time, this feature lets 2-digit years be interpreted in a 100-year window. Any 100-year window can be selected. You pass a valid date containing a 2-digit year to Language Environment and Language Environment returns an integer date based on the 100-year window.
The advantage to the 100-year window is that you need to change only the application code and not the databases or files with 2-digit years. This lets you change the application programs one at a time or groups at a time without effecting your data files. Note, this only works for dates that range less than 100 years. For example, dates of birth may not be appropriate for this solution; a person born in '94' could be over 100 years of age.
The disadvantage to the 100-year window is that it doesn't last forever. If your application has a long life expectancy, you may need to go back and replace the 100-year window with full 4-digit year support. Some of your applications will be replaced prior to this.
Other Host COBOL Compilers for VSE
IBM has developed three COBOL products for the VSE environment: DOS/VS COBOL, VS COBOL II, and COBOL for VSE/ESA. This section describes issues involved with migrating from DOS/VS COBOL.
MIGRATING FROM DOS/VS COBOL: We encourage companies to upgrade their COBOL technology to COBOL for VSE/ESA (compiler) with Language Environment for VSE/ESA (run-time library). Here are three possible migration paths:
1. DOS/VS COBOL TO COBOL FOR VSE/ESA We encourage companies with DOS/VS COBOL to migrate directly to IBM COBOL for VSE/ESA (compiler) and IBM Language Environment for VSE/ESA (run-time library) if the prerequisites are met.
2. DOS/VS COBOL TO VS COBOL II TO COBOL FOR VSE/ESA
Companies with DOS/VS COBOL who do not yet meet the IBM Language Environment for VSE/ESA prerequisites should migrate to VS COBOL II first. After the IBM Language Environment for VSE/ESA prerequisites are met, then companies can move to IBM COBOL for VSE/ESA.
3. VS COBOL II TO COBOL FOR VSE/ESA
After the IBM Language Environment for VSE/ESA prerequisites are met, companies with VS COBOL II can migrate to IBM COBOL for VSE/ESA.
Each successive COBOL product contains more capabilities than the previous product.
VS COBOL II: VS COBOL II builds on the functions of DOS/VS COBOL but has a variety of features that give companies many advantages over earlier IBM COBOL products. VS COBOL II includes additional language features, enhanced compiler options, virtual storage constraint relief, structured programming language for improved programmer productivity, enhanced double-byte character set (DBCS) support, streamlined system interfaces, expanded code optimization, flexible run-time options, and support for VSE/ESA's 31-bit addressing feature.
Customers who have VSE/ESA Version 1.4 or later installed and meet the prerequisites should migrate to IBM COBOL for VSE/ESA and Language Environment for VSE/ESA.
For VS COBOL II programs that are running under Language Environment, the following routines can be called using dynamic CALLs only:
CEECBLDY--Convert Date to COBOL Integer Format
CEEDATE--Convert Lilian Date to Character Format
CEEDATM--Convert Seconds to Character Timestamp
CEEDAYS--Convert Date to Lilian Format
CEEDYWK--Calculate Day of Week from Lilian Date
CEEGMT--Get Current Greenwich Mean Time
CEEGMTO--Get Offset from Greenwich Mean Time to Local Time
CEEISEC--Convert Integers to Seconds
CEELOCT--Get Current Local Date or Time
CEEQCEN--Query the Century Window
CEESCEN--Set the Century Window
CEESECI--Convert Seconds to Integers
CEESECS--Convert Timestamp to Seconds
CEE3CTY--Set Default Country
Thus, there are various ways to make VS COBOL II programs Year2000 ready. However:
o The VS COBOL II compiler is not Year2000 ready because it has no COBOL language support for 4-digit years and none is planned.
o IBM COBOL for MVS & VM, IBM COBOL for VSE/ESA, IBM VisualAge for COBOL of OS/2, IBM COBOL Set for AIX, and ILE COBOL for AS/400 are all Year2000 ready.
BENEFITS OF COBOL MIGRATION: DOS/VS COBOL is the ANSI 74 compiler. ANSI 85 introduced many significant functions which are provided to customers in either VS COBOL II or COBOL for VSE/ESA. Customers who have migrated to the newer COBOL standard have additional functions, increased developer productivity, and exploitation of S/390 hardware capabilities. Benefits of upgrading COBOL technology are:
o Improved Interlanguage Communication (ILC).
o Condition management features of Language Environment, which bring PL/I-like condition handling to COBOL.
o Fully Year2000 ready.
o Language Environment callable services, including a date/time service routine that interprets a 2-digit year to a 4-digit year to accommodate the year 2000.
o Improved application performance of COBOL for VSE/ESA compared to VS COBOL II.
For more information on the value of migrating from DOS/VS COBOL or VS COBOL II to COBOL for VSE/ESA, obtain a copy of Why Migrate to COBOL and Language Environment?, which is available from your IBM representative (COBMGVAL PACKAGE on MKTTOOLS) or by calling 1-800-IBM-3333 extension STAR703. This document contains some examples of customer benefits of migrating to COBOL for MVS & VM that also apply to the VSE environment.
+--- CONVERTING ON THE WORKSTATION -----------------------------------------+ | | | The Redeveloper in the VisualAge for COBOL, Professional for OS/2 lets | | you convert and structure COBOL programs using the workstation with a GUI | | interface. Refer to "Redeveloper Tools" on page 8-79 for details on this | | component instead of CCCA. | | | +---------------------------------------------------------------------------+
COBOL and CICS/VS Command Level Conversion Aid (CCCA) for VSE is an effective tool for converting old COBOL source code and copy modules to the new COBOL standard. CCCA converts DOS/VS COBOL and COBOL 74 Standard VS COBOL II (Release 3 and 4 (CMPR2)) source code to COBOL 85 Standard VS COBOL II Release 3 or 4 (NOCMPR2) or to IBM COBOL for VSE/ESA.
In cases where a statement is no longer supported and has no equivalent statement in the target COBOL, CCCA flags the statement. You can use CCCA to convert from DOS/VS COBOL to COBOL for VSE/ESA, and to convert from DOS/VS COBOL to VS COBOL II. The source file output for compiling under VS COBOL II can also be used for compiling under COBOL for VSE/ESA.
CCCA identifies and converts source code incompatibility, to reduce the effort required to convert programs, and to minimize conversion errors. You can customize the conversion process to meet unique conversion requirements. Installation and usage are fast and straightforward.
CCCA KEY BENEFITS ARE:
o Identification and conversion of source code
o Reduction of the effort required to convert programs
o Minimization of conversion errors
o Enhanced programmer productivity during migration.
CCCA PROVIDES FACILITIES TO:
o Convert most syntax differences between DOS/VS COBOL and the current
release of VS COBOL II and COBOL for VSE/ESA programs.
o Convert EXEC CICS commands.
o Remove and/or convert the base locator for linkage (BLL) section
mechanism and references.
o Eliminate conflicts between user-defined names and words reserved for VS
COBOL II.
o Convert both source programs and copy modules.
o Create conversion management reports.
o Produce a statement-by-statement diagnostic listing showing the result of
the conversion process for each program.
o Change and/or create COBOL conversion modules.
o Allow foreground conversion of CICS programs.
o Perform conversion from various levels of COBOL into other COBOL levels
through an open converter design.
o Read from PDSEs, not just PDSs.
You can use the COBOL Report Writer Precompiler to perform two functions: 1) to permanently convert Report Writer statements to valid COBOL statements that can be compiled in IBM COBOL for VSE/ESA or IBM COBOL for MVS & VM, or 2) to precompile applications containing Report Writer statements so the code will be acceptable to the IBM COBOL for VSE/ESA or IBM COBOL for MVS & VM compiler.
When used to precompile, the Precompiler automatically invokes the IBM COBOL compiler as though Report Writer statements in the source program were being processed by the IBM COBOL for VSE/ESA or IBM COBOL for MVS & VM compiler itself. The fact that two separate processes are involved is transparent to you.
WITT Year2000 for OS/2 is a test tool to assist you in testing of the Year 2000 transformation.
COBOL programmers can use WITT Year2000 as a GUI test tool that automatically facilitates the creation of reusable unit test, function test, system test, and regression test cases. You can create these reusable test cases when you develop or implement a newly developed program, and you should run them continuously during the years that the program is maintained. Once created, the test cases can be played back interactively or in an unattended batch mode. The execution of a set of WITT test cases provides an audit trail of errors that a tester can provide to a programmer to document program failures.
WITT automatically records and plays back all keystroke and mouse movements and compares and identifies test inconsistencies between benchmark test cases and test cases run after you make enhancements and fixes to a program. This automatic playback and comparison capability is best suited for testing of Year 2000 transformation work. Because once you make a modification to an application programs, you should test repeatedly with a variety of system dates such as:
o 1997/02/28 (1997-February-28) o 1999/12/31 (1999-December-31) o 2000/01/01 (2000-January-01) o 2000/02/29 (2000-February-29) o 2004/02/29 (2004-February-29)
WITT also allow you to add program intelligence to your test cases though scripting in 2/REXX, thus easing your modification of WITT to meet your needs.
WITT Year2000 installs on an OS/2 desktop and allows the testing of OS/390, MVS, VM, IMS, CICS, OS/400, and OS/2 PM and Text (that is, Micro Focus and CICS/OS2) applications.
To write application code in PL/I for S/370 and S/390 for the VSE platforms, IBM has developer a PL/I complier. These products target the host application development environment.
IBM's PL/I mainframe products for S/370 and S/390 VSE are:
o PL/I FOR VSE/ESA - the compiler o LANGUAGE ENVIRONMENT FOR VSE/ESA - the run-time library Features This PL/I compiler, PL/I for VSE/ESA, is available today and provides full 4-digit year support with features including: o Built-in functions o Sliding 100-year window PL/I for VSE/ESA provides full Year2000 support. It provides a built-in function which provides 4-digit-year support. Language Environment for VSE/ESA provides additional date manipulation with the Language Environment Callable Services. PL/I for VSE/ESA will return a 4-digit year when the PL/I application program queries the system for the current date. IBM PL/I for VSE/ESA IBM PL/I for VSE is an implementation of IBM PL/I for MVS & VM and succeeds DOS PL/I for VSE - providing source code compatibility for most DOS PL/I for VSE R6 programs. PL/I for VSE requires and takes advantage of Language Environment for VSE capabilities to support use in mixed-language development environments and the use of reusable components in building applications. IBM PL/I for VSE provides: o 31-bit virtual addressing o Support for Language Environment for VSE functions o Enhanced InterLanguage Communication (ILC) with COBOL for VSE
IBM Language Environment for VSE/ESA is IBM's common runtime environment for enterprise applications written in COBOL and PL/I. Language Environment for VSE/ESA is designed to provide defined calling conventions, enhanced interlanguage communication, callable services, language-specific services (for example, common facilities messages), common math functions, application utilities, system services, and subsystem support for Customer Information Control System (CICS).
With Language Environment for VSE/ESA, application programmers can extend and integrate their applications and packages, as well as reuse code with greater flexibility, due to interlanguage communication and native language restrictions. Application packages may be extended with the language of choice. Language Environment for VSE/ESA enables existing applications to function as before with little, if any, changes required, thus helping preserve company investment in those applications. Language Environment for VSE/ESA condition handler permits programs to handle errors in a predictable, logical manner without highly-specialized routines.
Language Environment for VSE/ESA replaces the existing language-specific run-time libraries and provides a common runtime environment for all languages that conform to the Language Environment architecture. In a single product, Language Environment for VSE/ESA combines essential run-time services, such as routines for message handling, condition handling, and storage management. All these services are available through a set of interfaces that are consistent across programming languages. With Language Environment for VSE/ESA, application programmers can use one runtime environment for their applications, regardless of the programming language or system resource needs.
Today, IBM Language Environment for VSE/ESA is the run-time library for the Language Environment-enabled compilers IBM COBOL for VSE/ESA and PL/I for VSE/ESA. IBM realizes the importance our customers place on complete, open, high-quality solutions. Therefore, IBM has established an IBM Language Environment Partner Program at the IBM Santa Teresa Laboratory. This program encourages and assists tool and application package vendors to support and take advantage of Language Environment services. Companies with existing 3GL applications will benefit from the wider choice of tools and application packages.
Language Environment for VSE/ESA provides a number of advantages over other packages; its capabilities include:
o Ability to parse dates in the most commonly used formats by using a picture string feature as a parsing guide
o Provide NLS support by using a built-in table of defaults based on a country code
o A sliding window feature
IBM Language Environment for VSE/ESA provides a valuable short term solution with the 100-year window feature. If you are unable to change all of your applications and data at the same time, the 100-year window feature allows 2-digit years to be interpreted in a 100-year window. Any 100-year window can be selected. You pass a valid date containing a 2-digit year to Language Environment and Language Environment returns an integer date based on the 100-year window.
The advantage to the 100-year window is that you need to change only the application code and not the databases or files with 2-digit years. This allows you to change the application programs one at a time or groups at a time without effecting your data files. Note, this only works for dates that range less than 100 years. For example, dates of birth may not be appropriate for this solution; a person born in '94' could be over 100 years of age.
Disadvantages of the 100-year window are:
- It doesn't last forever. If your application has a long life expectancy, you may need to go back and replace the 100-year window with full 4-digit year support. Some of your applications will be replaced prior to those change.
- Your system will likely experience some performance impact due to the additional programming logic used to determine and append the century digits.
WITT Year2000 for OS/2 is a test tool to assist you in testing of the Year 2000 transformation.
PL/I programmers can use WITT Year2000 as a GUI test tool that automatically facilitates the creation of reusable unit test, function test, system test, and regression test cases. You can create these reusable test cases when you develop or implement a newly developed program, and you should run them continuously during the years that the program is maintained. Once created, the test cases can be played back interactively or in an unattended batch mode. The execution of a set of WITT test cases provides an audit trail of errors that a tester can provide to a programmer to document program failures.
WITT automatically records and plays back all keystroke and mouse movements and compares and identifies test inconsistencies between benchmark test cases and test cases run after you make enhancements and fixes to a program. This automatic playback and comparison capability is best suited for testing of Year 2000 transformation work. Because once you make a modification to an application programs, you should test repeatedly with a variety of system dates such as:
o 1997/02/28 (1997-February-28) o 1999/12/31 (1999-December-31) o 2000/01/01 (2000-January-01) o 2000/02/29 (2000-February-29) o 2004/02/29 (2004-February-29)
WITT also allow you to add program intelligence to your test cases though scripting in 2/REXX, thus easing your modification of WITT to meet your needs.
WITT Year2000 installs on an OS/2 desktop and allows the testing of OS/390, MVS, VM, IMS, CICS, OS/400, and OS/2 PM and Text (that is, Micro Focus and CICS/OS2) applications.
The IBM RPG Family
For application code written in RPG, IBM has developed several RPG language compilers. These compilers target the host application development environment.
IBM's RPG compilers for AS/400 are:
o Integrated Language Environment (ILE) RPG IV o Original Program Model (OPM) RPG/400 o System/36 compatible compiler
All three RPG language compilers are available with either the Integrated Language Environment RPG for OS/400 Version 3 product (5716-RG1) or the IBM Integrated Language Environment RPG/400 Version 3 product (5763-RG1).
USING ILE RPG IV DATE SUPPORT: The ILE RPG IV compiler has the following support for dates:
o Retrieval of the job date through special words UDATE and UYEAR, to include support for 2-digit-year data.
o Retrieval of the job date through special words *DATE and *YEAR, to include support for 4-digit-year data.
o Retrieval of the system date through operation TIME to include support for both 2-digit and 4-digit-year data.
o Date, Time, and Timestamp data type support to include support for date operations such as subtraction, addition, extraction, testing, comparison, and move.
o Calling OPM System APIs, to include support for both 2-digit and 4-digit-year data.
o Calling ILE Date APIs, to include support for both 2-digit and 4-digit-year data.
o SQL date, time, and timestamp data type support, to include support for 4-digit-year data.
This section provides information on how to use RPG date, time, and timestamp fields. Specifically, it covers:
o The date, time, and timestamp data types and their formats o User date special words o How to edit date-time fields o Date-time keywords o Date-time operations and how to use them
Date-Time Data Types and Formats
Date, time and timestamp fields have an internal format that is independent of the external format. The INTERNAL FORMAT is the way the data is stored in the program. The EXTERNAL FORMAT is the way the data is stored in files.
You need to be aware of the internal format when:
o Passing parameters
o Overlaying subfields in data structures
There is a default internal format for date, time, and timestamp fields. In general, to change the internal format for a specific field, you must define the field and specify its internal format on a Definition specification. Similarly, to change (or specify) the external format for program-described fields, you specify the format on the corresponding Input or Output specification.
For fields in an externally described file, the external data format is specified in the data description specifications in position 35. You cannot change the external format of externally described date, time, and timestamp fields.
For subfields in externally described data structures, the data formats specified in the external description are used as the internal formats of the subfields by the compiler. The reason for this difference, is that a data structure, even if externally described, exists only when a program is running.
INTERNAL FORMAT: The default format for date, time, and timestamp fields is *ISO. In general, it is recommended that you use the default ISO internal format, especially if you have a mixture of external format types.
For date, time, and timestamp fields, you can change the default format in two ways. You can use the DATFMT and TIMFMT keywords on the Control specification to change the default internal format, if desired, for all
___ date-time fields in the program. In addition, you can use the Definition specification to:
o Override the default internal format by using the DATFMT and TIMFMT keywords
o Specify an initial value for a date, time, or timestamp field that is different than the default, by using the INZ keyword
SPECIFYING AN EXTERNAL FORMAT FOR A DATE-TIME FIELD: If you have date, time, and timestamp fields in program-described files, then you must specify their external format. You can specify a default external format for all date, time, and timestamp fields in a program-described file by using the DATFMT and TIMFMT keywords on a File-Description specification. You can specify an external format for a particular field as well. Specify the desired format in positions 31-34 on an Input specification. Specify the appropriate keyword and format in positions 53-80 on an Output specification.
For more information on each format type, see the appropriate section in the remainder of this chapter.
DATE DATA TYPE: Date fields have a predetermined size and format. They can be defined on the definition specification. Leading and trailing zeros are required for all date data.
Date constants or variables used in comparisons or assignments do not have to be in the same format or use the same separators. Also, dates used for I/O operations such as input fields, output fields or key fields are also converted (if required) to the necessary format for the operation.
The default internal format for date variables is *ISO. This default internal format can be overridden globally by the control specification keyword DATFMT and individually by the definition specification keyword DATFMT.
The hierarchy used when determining the internal date format and separator for a date field is
1. From the DATFMT keyword specified on the definition specification 2. From the DATFMT keyword specified on the control specification 3. *ISO
There are two kinds of date data formats: 2-digit and 4-digit-year formats. For 2-digit-year formats, years in the range 1940 to 2039 can be represented. This leads to the possibility of a date overflow condition occurring when converting from a 4-digit-year format to a 2-digit-year format.
The following table lists the formats for date data.
+---------------------------------------------------------------------------+ | Figure 8-1. Date Formats for Date Data Type | +-------+-----------------------+---------------+-------+-------------------+ | FORMAT| DESCRIPTION | FORMAT | LENGTH| EXAMPLE | | NAME | | | | | +-------+-----------------------+---------------+-------+-------------------+ | *MDY | Month/Day/Year | mm/dd/yy | 8 | 01/15/91 | +-------+-----------------------+---------------+-------+-------------------+ | *DMY | Day/Month/Year | dd/mm/yy | 8 | 15/01/91 | +-------+-----------------------+---------------+-------+-------------------+ | *YMD | Year/Month/Day | yy/mm/dd | 8 | 91/01/15 | +-------+-----------------------+---------------+-------+-------------------+ | *JUL | Julian | yy/ddd | 6 | 91/015 | +-------+-----------------------+---------------+-------+-------------------+ | *ISO | International | yyyy-mm-dd | 10 | 1991-01-15 | | | Standards | | | | | | Organization | | | | +-------+-----------------------+---------------+-------+-------------------+ | *USA | IBM USA Standard | mm/dd/yyyy | 10 | 01/15/1991 | +-------+-----------------------+---------------+-------+-------------------+ | *EUR | IBM European Standard | dd.mm.yyyy | 10 | 15.01.1991 | +-------+-----------------------+---------------+-------+-------------------+ | *JIS | Japanese Industrial | yyyy-mm-dd | 10 | 1991-01-15 | | | Standard Christian | | | | | | Era | | | | +-------+-----------------------+---------------+-------+-------------------+ The following table lists the *LOVAL, *HIVAL, and default values for all the date formats. +---------------------------------------------------------------------------+ | Figure 8-2. Date Values | +------+---------------------+--------------+-------------+-----------------+ | FORMA| DESCRIPTION | *LOVAL | *HIVAL | DEFAULT VALUE | | NAME | | | | | +------+---------------------+--------------+-------------+-----------------+ | *MDY | Month/Day/Year | 01/01/40 | 12/31/39 | 01/01/01 | +------+---------------------+--------------+-------------+-----------------+ | *DMY | Day/Month/Year | 01/01/40 | 31/12/39 | 01/01/01 | +------+---------------------+--------------+-------------+-----------------+ | *YMD | Year/Month/Day | 40/01/01 | 39/12/31 | 01/01/01 | +------+---------------------+--------------+-------------+-----------------+ | *JUL | Julian | 40/001 | 39/365 | 01/001 | +------+---------------------+--------------+-------------+-----------------+ | *ISO | International | 0001-01-01 | 9999-12-31 | 0001-01-01 | | | Standards | | | | | | Organization | | | | +------+---------------------+--------------+-------------+-----------------+ | *USA | IBM USA Standard | 01/01/0001 | 12/31/9999 | 01/01/0001 | +------+---------------------+--------------+-------------+-----------------+ | *EUR | IBM European | 01.01.0001 | 31.12.9999 | 01.01.0001 | | | Standard | | | | +------+---------------------+--------------+-------------+-----------------+ | *JIS | Japanese Industrial | 0001-01-01 | 9999-12-31 | 0001-01-01 | | | Standard Christian | | | | | | Era | | | | +------+---------------------+--------------+-------------+-----------------+
TIME DATA TYPE: Time fields have a predetermined size and format. They can be defined on the definition specification. Leading and trailing zeros are required for all time data.
Time constants or variables used in comparisons or assignments do not have to be in the same format or use the same separators. Also, times used for I/O operations such as input fields, output fields or key fields are also converted (if required) to the necessary format for the operation.
The default internal format for time variables is *ISO. This default internal format can be overridden globally by the control specification keyword TIMFMT and individually by the definition specification keyword TIMFMT.
The hierarchy used when determining the internal time format and separator for a time field is
1. From the TIMFMT keyword specified on the definition specification 2. From the TIMFMT keyword specified on the control specification 3. *ISO
The following table lists the formats for time data.
+---------------------------------------------------------------------------+ | Figure 8-3. Time Formats for Time Data Type | +----------+--------------------------------+----------+----------+---------+ | FORMAT | DESCRIPTION | FORMAT | LENGTH | EXAMPLE | | NAME | | | | | +----------+--------------------------------+----------+----------+---------+ | *HMS | Hours:Minutes:Seconds | hh:mm:ss | 8 | 14:00:00| +----------+--------------------------------+----------+----------+---------+ | *ISO | International Standards | hh.mm.ss | 8 | 14.00.00| | | Organization | | | | +----------+--------------------------------+----------+----------+---------+ | *USA | IBM USA Standard. AM and PM | hh:mm AM | 8 | 02:00 | | | can be any mix of upper and | or hh:mm | | PM | | | lower case. | PM | | | +----------+--------------------------------+----------+----------+---------+ | *EUR | IBM European Standard | hh.mm.ss | 8 | 14.00.00| +----------+--------------------------------+----------+----------+---------+ | *JIS | Japanese Industrial Standard | hh:mm:ss | 8 | 14:00:00| | | Christian Era | | | | +----------+--------------------------------+----------+----------+---------+ The following table lists the *LOVAL, *HIVAL, and default values for all the time formats. +---------------------------------------------------------------------------+ | Figure 8-4. Time Values | +----------+--------------------------------+----------+----------+---------+ | FORMAT | DESCRIPTION | *LOVAL | *HIVAL | DEFAULT | | NAME | | | | VALUE | +----------+--------------------------------+----------+----------+---------+ | *HMS | Hours:Minutes:Seconds | 00:00:00 | 24:00:00 | 00:00:00| +----------+--------------------------------+----------+----------+---------+ | *ISO | International Standards | 00.00.00 | 24.00.00 | 00.00.00| | | Organization | | | | +----------+--------------------------------+----------+----------+---------+ | *USA | IBM USA Standard. AM and PM | 00:00 AM | 12:00 AM | 00:00 | | | can be any mix of upper and | | | AM | | | lower case. | | | | +----------+--------------------------------+----------+----------+---------+ | *EUR | IBM European Standard | 00.00.00 | 24.00.00 | 00.00.00| +----------+--------------------------------+----------+----------+---------+ | *JIS | Japanese Industrial Standard | 00:00:00 | 24:00:00 | 00:00:00| | | Christian Era | | | | +----------+--------------------------------+----------+----------+---------+
TIMESTAMP DATA TYPE: Timestamp fields have a predetermined size and format. They can be defined on the definition specification. Timestamp data must be in the format
yyyy-mm-dd-hh.mm.ss.mmmmmm (length 26).
Microseconds (.mmmmmm) are optional for timestamp literals and if not provided will be padded on the right with zeros. Leading zeros are required for all timestamp data.
The default initialization value for a timestamp is midnight of January 1, 0001 (0001-01-01-00.00.00.000000). The *HIVAL value for a timestamp is 9999-12-31-24.00.00.000000. Similarly, the *LOVAL value for timestamp is 0001-01-01-00.00.00.000000.
User Date Special Words
The user date special words (UDATE, *DATE, UMONTH, *MONTH, UDAY, *DAY, UYEAR, *YEAR) allow the programmer to supply a date for the program at run time. The user date special words access the job date that is specified in the job description. The user dates can be written out at output time; UDATE and *DATE can be written out using the Y edit code in the format specified by the control specification. (For a description of the job date, see the Work Management manual, SC41-4306.)
RULES FOR USER DATE: Remember the following rules when using the user date:
o UDATE, when specified in positions 30 through 43 of the output specifications, prints a 6-character numeric date field. *DATE, when similarly specified, prints an 8-character (4-digit year portion) numeric date field. These special words can be used in three different date formats:
Month/day/year
Year/month/day
Day/month/year
Use the DATEDIT keyword on the control specification to specify the editing to be done. If this keyword is not specified, the default is *MDY.
o For an interactive program, the user date special words are set when the job starts running. For a batch program, they are set when the job is sent to the job queue. In neither case are they updated when the program runs over midnight or when the job date changes. Use the TIME operation code to obtain the time and date while the program is running.
o UMONTH, *MONTH, UDAY, *DAY, and UYEAR when specified in positions 30 through 43 of the output specifications, print a 2-position numeric date field. *YEAR can be used to print a 4-position numeric date field. Use UMONTH or *MONTH to print the month only, UDAY or *DAY to print the day only, and UYEAR or *YEAR to print the year only.
o UDATE and *DATE can be edited when they are written if the Y edit code is specified in position 44 of the output specifications. The DATEDIT(fmt$separator) keyword on the control specification determines the format and the separator character to be inserted; for example, 12/31/88, 31.12.88., 12/31/1988.
o UMONTH, *MONTH, UDAY, *DAY, UYEAR and *YEAR cannot be edited by the Y edit code in position 44 of the output specifications.
o The user date fields cannot be modified. This means they cannot be used:
- In the result field of calculations
- As factor 1 of PARM operations
- As the factor 2 index of LOOKUP operations
- With blank after in output specifications
- As input fields
o The user date special words can be used in factor 1 or factor 2 of the calculation specifications for operation codes that use numeric fields.
o User date fields are not date data type fields but are numeric fields.
Editing Date Fields
The Y edit code is normally used to edit a 3- to 9-digit date field. It suppresses the leftmost zeros of date fields, up to but not including the digit preceding the first separator. Slashes are inserted to separate the day, month, and year. The DATEDIT(fmt$separator)and ('value') keywords on the control specification can be used to alter edit formats.
NOTE: The Y edit code is not valid for *YEAR, *MONTH, and *DAY.
The Z edit code removes the sign (plus or minus) from and suppresses the leading zeros of a numeric field. The decimal point is not placed in the field and is not printed.
The Y edit code suppresses the leftmost zeros of date fields, up to but not including the digit preceding the first separator. The Y edit code also inserts slashes (/) between the month, day, and year according to the following pattern:
nn/n
nn/nn
nn/nn/n
nn/nn/nn
nnn/nn/nn
nn/nn/nnnn Format used with M, D or blank in position 19
nnn/nn/nnnn Format used with M, D or blank in position 19
nnnn/nn/nn Format used with Y in position 19
nnnnn/nn/nn Format used with Y in position 19
Date Operations
Date operations allow you to perform date and time arithmetic, extract portions of a date, time or timestamp field; or test for valid fields. They operate on date, time, and timestamp fields, and character and numeric fields representing dates, times and timestamps. The date operations are:
o ADDDUR (Add Duration) o EXTRCT (Extract Date/Time/Timestamp) o SUBDUR (Subtract Duration) o TEST (Test Date/Time/Timestamp)
With ADDDUR (Add Duration) you can add a duration to a date or time. With SUBDUR (Subtract Duration) you can subtract a duration from a date or time, or calculate the duration between 2 dates, times or timestamps. With EXTRCT (Extract Date/Time/Timestamp) you can extract part of a date, time or timestamp. With TEST (Test Date/Time/Timestamp) you can test for a valid date, time, or timestamp field. The valid duration codes (and their short forms) are:
o *YEARS for the year (*Y) o *MONTHS for the month (*M) o *DAYS for the day (*D) o *HOURS for the hours (*H) o *MINUTES for the minutes (*MN) o *SECONDS for the seconds (*S) o *MSECONDS for the microseconds (*MS).
ADDING OR SUBTRACTING DATES: When adding (or subtracting) a duration in months to (or from) a date, the general rule is that the month portion is increased (or decreased) by the number of months in the duration, and the day portion is unchanged. The exception to this is when the resulting day portion would exceed the actual number of days in the resulting month. In this case, the resulting day portion is adjusted to the actual month end date.
For example, adding one month to '95/05/30' (*YMD format) results in '95/06/30', as expected. The resulting month portion has been increased by 1; the day portion is unchanged. On the other hand, adding one month to '95/05/31' results in '95/06/30'. The resulting month portion has been increased by 1 and the resulting day portion has been adjusted because June has only 30 days.
Subtracting one month from '95/03/30' yields '95/02/28'. In this case, the resulting month portion is decreased by 1 and the resulting day portion adjusted because February has only 28 days (in non-leap years).
Similar results occur when adding or subtracting a year duration. For example, adding one year to '92/02/29' results in '93/02/28', an adjusted value since the resulting year is not a leap year.
CALCULATING DURATIONS BETWEEN DATES: The SUBDUR operation can be used to calculate a duration by subtracting two dates, times, or timestamps. The result of the calculation is a complete unit; any rounding which is done is downwards. The calculation of durations includes microseconds.
For example, if the actual duration is 384 days, and the result is requested in years, the result will be 1 complete year because there are 1.05 years in 384 days. A duration of 59 minutes requested in hours will result in 0 hours. Here are some additional examples.
Duration in between and is
============ ========== ============ ===========
Months 1994-02-28 1994-03-28 1 month
1994-03-15 1995-03-14 11 months
1994-03-15 1995-03-15 12 months
Years 1994-03-15 1995-03-14 0 years
1994-03-31 1995-03-31 1 year
1970-03-14-23.00.00.000000 1970-03-14-22.00.00.000001 0 years
Hours 1990-03-14-12.34.45.123456 1989-03-14-12.34.45.123457 0 years
UNEXPECTED RESULTS: If adjustment takes place on a date-time addition or subtraction, then a subsequent duration calculation will most likely result in a different duration than the one originally added or subtracted. This is because the calculated duration will no longer contain a complete unit, and so, rounding down, will yield a one unit less than expected. This is shown in examples 1 and 2 below.
A second unexpected result can be seen in examples 3 and 4. Different initial dates give the same result after adding 1 month. When subtracting 1 month from the result, it is impossible to arrive at both initial dates.
1. '95/05/31' ADDDUR 1:*MONTH gives '95/06/30'
'95/06/30' SUBDUR '95/05/31' gives 0 months
You might expect the result of the SUBDUR to be 1 month.
2. '95/06/30' ADDDUR 1:*MONTH gives '95/07/30'
'95/07/30' SUBDUR '95/06/30' gives 1 month
This is the "expected" result.
3. '95/01/31' ADDDUR 1:*MONTH gives '95/02/28'
'95/01/28' ADDDUR 1:*MONTH gives '95/02/28'
Two different dates yield the same date due to adjustment.
'95/02/28' SUBDUR 1:*MONTH gives '95/01/28'
'Reversing' the addition does not result in the original dates.
The OPM RPG 400 compiler includes the following support for dates:
o Retrieval of the job date through special words UDATE and UYEAR, to include support for 2-digit-year data.
o Retrieval of the job date through special words *DATE and *YEAR, to include support for 4-digit-year data.
o Retrieval of the system date through operation TIME, to include support for both 2-digit and 4-digit-year data.
o Calling OPM System APIs, to include support for both 2-digit and 4-digit-year data.
o SQL date, time, and timestamp data type support, to include support for 4-digit-year data.
The System/36 compatible compiler has the following support for dates:
o Retrieval of the job date through special words UDATE and UYEAR, to include support for 2-digit-year data.
o Retrieval of the system date through operation TIME, to include support for 2-digit-year-data.
o Calling OPM System APIs, to include support for both 2-digit and 4-digit-year data.
For application code written in COBOL, IBM has developed several COBOL language compilers. These compilers target the host application development environment.
IBM's COBOL compilers for AS/400 are:
o Integrated Language Environment (ILE) COBOL/400 o Original Program Model (OPM) COBOL/400 o System/36 compatible COBOL compiler
All three COBOL language compilers are available with either the Integrated Language Environment COBOL for OS/400 Version 3 product (5716-CB1) or the IBM Integrated Language Environment COBOL/400 Version 3 product (5763-CB1).
Using V3R7 ILE COBOL Date Support
The COBOL ACCEPT statement supports both 2-digit and 4-digit year data.
The COBOL intrinsic functions CURRENT-DATE, WHEN-COMPILED, DATE-OF-INTEGER, DAY-OF-INTEGER, INTEGER-OF-DATE, INTEGER-OF-DAY, and YEAR-TO-YYYY provide 4-digit-year support.
Calling OPM System APIs provides for both 2-digit and 4-digit-year data.
Calling ILE Date APIs provides for both 2-digit and 4-digit-year data.
SQL supports 4-digit-year data.
Using OPM and pre-V3R7 ILE COBOL Date Support
The COBOL ACCEPT statement is supported by the three compilers listed above and supports 2-digit-year data when referencing DATE or DAY.
Calling OPM System APIs is supported by the three compilers listed above and supports both 2-digit and 4-digit-year data. years.
The COBOL WHEN-COMPILED special register is supported in both the OPM and ILE COBOL/400 compilers and supports 2-digit-year data.
Calling ILE Date APIs is supported by the ILE COBOL/400 compiler and supports both 2-digit and 4-digit-year data.
SQL is supported by both the OPM and ILE COBOL compilers and supports 4-digit-year data.
WITT Year2000 for OS/2 is a test tool to assist you in testing of the Year 2000 transformation.
COBOL programmers can use WITT Year2000) as a GUI test tool that automatically facilitates the creation of reusable unit test, function test, system test, and regression test cases. You can create these reusable test cases when you develop or implement a newly developed program, and you should run them continuously during the years that the program is maintained. Once created, the test cases can be played back interactively or in an unattended batch mode. The execution of a set of WITT test cases provides an audit trail of errors that a tester can provide to a programmer to document program failures.
WITT automatically records and plays back all keystroke and mouse movements and compares and identifies test inconsistencies between benchmark test cases and test cases run after you make enhancements and fixes to a program. This automatic playback and comparison capability is best suited for testing of Year 2000 transformation work. Because once you make a modification to an application programs, you should test repeatedly with a variety of system dates such as:
o 1997/02/28 (1997-February-28) o 1999/12/31 (1999-December-31) o 2000/01/01 (2000-January-01) o 2000/02/29 (2000-February-29) o 2004/02/29 (2004-February-29)
WITT also allow you to add program intelligence to your test cases though scripting in 2/REXX, thus easing your modification of WITT to meet your needs.
WITT Year2000 installs on an OS/2 desktop and allows the testing of OS/390, MVS, VM, IMS, CICS, OS/400, and OS/2 PM and Text (that is, Micro Focus and CICS/OS2) applications.
For application code based on C, IBM has developed language compilers for both C and C++.
IBM's C based compilers for AS/400 are:
o Integrated Language Environment (ILE) C for OS/400
o VisualAge C++ for OS/400
Using C and C++ Date Support
The C library, available to both compilers, provides many functions related to date and time retrieval, manipulation, and formatting and supports 4-digit-year data.
Calling OPM System APIs is supported by both compilers and supports both 2-digit and 4-digit-year data.
Calling ILE Date APIs is supported by both compilers and supports both 2-digit and 4-digit-year data.
SQL is supported by the ILE C for OS/400 compiler and supports 4-digit-year data.
Integrated Language Environment (ILE) for OS/400 is IBM's common runtime environment for enterprise applications written in the ILE languages of RPG, COBOL, C, and CL. ILE is designed to provide defined calling conventions, enhanced interlanguage communication, and callable services in areas such as date and time, math, storage management, and exception handling. ILE services are standard in OS/400 starting with Version 2 Release 3.
ILE provides a number of date functions which include:
o Ability to parse dates in an infinite number of formats by using a picture string as a parsing guide
o Retrieve current date
o Convert a date character string to a Lilian (integer) format thereby enabling easy date arithmetic operations
o Convert a Lilian date to a date character string
o Century sliding window
The ILE century sliding window technique may provide a short term solution for some applications. If you are unable to change all of your applications and data at the same time, the century window allows 2-digit years to be interpreted in a 100-year window. Any 100-year window can be selected. You pass a valid date containing a 2-digit year to ILE and ILE returns an integer date based on the 100-year window.
The advantage to the century window is that you need to change only the application code and not the databases with 2-digit years. This allows you to change the application programs one at a time or groups at a time without affecting your databases. Note, this only works for dates that range less than 100 years. For example, dates of birth may not be appropriate for this solution.
DB2/400, a standard part of Operating System/400, provides the run time support for SQL on the AS/400. SQL provides support for the database datatypes of date, time, and timestamp; and operations such as add, subtract, assignment, and compare. The DB2 Query Manager and SQL Development Kit product (5716-ST1 or 5763-ST1) provides SQL precompilers for AS/400 programming languages such as RPG, C, and COBOL. SQL supports 4-digit-year data.
Using Date, Time, and Timestamp Support
Date, time, and timestamp are data types represented in an internal form not seen by the SQL user. Date, time, and timestamp can be represented by character string values and assigned to character string variables. The database manager recognizes the following as date, time, and timestamp values:
o A value returned by the DATE, TIME, or TIMESTAMP scalar functions.
o A value returned by the CURRENT DATE, CURRENT TIME, or CURRENT TIMESTAMP
special registers.
o A character string when it is an operand of an arithmetic expression or a
comparison and the other operand is a date, time, or timestamp. For
example, in the predicate:
... WHERE HIREDATE < '1950-01-01'
if HIREDATE is a date column, the character string '1950-01-01' is
interpreted as a date.
o A character string variable or constant used to set a date, time, or
timestamp column in either the SET clause of an UPDATE statement, or the
VALUES clause of an INSERT statement.
For more information on character string formats of date, time, and timestamp values, refer to DB2/400 SQL Reference (SC41-3612).
SPECIFYING CURRENT DATE AND TIME VALUES: You can specify a current date, time, or timestamp in an expression by specifying one of three special registers: CURRENT DATE, CURRENT TIME, or CURRENT TIMESTAMP. The value of each is based on a time-of-day clock reading obtained during the running of the statement. Multiple references to CURRENT DATE, CURRENT TIME, or CURRENT TIMESTAMP within the same SQL statement use the same value. The following statement returns the age (in years) of each employee in the EMPLOYEE table when the statement is run:
SELECT YEAR(CURRENT DATE - BIRTHDATE)
FROM CORPDATA.EMPLOYEE
The CURRENT TIMEZONE special register allows a local time to be converted to Universal Coordinated Time (UTC). For example, if you have a table named DATETIME, containing a time column type with a name of STARTT, and you want to convert STARTT to UTC, you can use the following statement:
SELECT STARTT - CURRENT TIMEZONE
FROM DATETIME
DATETIME OPERANDS AND DURATIONS: Datetime values can be incremented, decremented, and subtracted. These operations may involve decimal numbers called durations. A duration is a positive or negative number representing an interval of time. There are four types of durations:
LABELED DURATIONS
A labeled duration represents a specific unit of time as expressed by a number (which can be the result of an expression) followed by one of the seven duration keywords: YEARS, MONTHS, DAYS, HOURS, MINUTES, SECONDS, or MICROSECONDS.(1) The number specified is converted as if it were assigned to a DECIMAL(15,0) number. A labeled duration can only be used as an operand of an arithmetic operator in which the other operand is a value of data type DATE, TIME, or TIMESTAMP. Thus, the expression HIREDATE + 2 MONTHS + 14 DAYS is valid whereas the expression HIREDATE + (2 MONTHS + 14 DAYS) is not. In both of these expressions, the labeled durations are 2 MONTHS and 14 DAYS.
DATE DURATION
A date duration represents a number of years, months, and days, expressed as a DECIMAL(8,0) number. To be properly interpreted, the number must have the format yyyymmdd, where yyyy represents the year, mm the month, and dd the day. The result of subtracting one date value from another, as in the expression HIREDATE - BRTHDATE, is a date duration.
---------------
(1) Note that the singular form of these keywords is also acceptable: YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, and MICROSECOND.
TIME DURATION
A time duration represents a number of hours, minutes, and seconds, expressed as a DECIMAL(6,0) number. To be properly interpreted, the number must have the format hhmmss where hh represents the hour, mm the minute, and ss the second. The result of subtracting one time value from another is a time duration.
TIMESTAMP DURATION
A timestamp duration represents a number of years, months, days, hours, minutes, seconds, and microseconds, expressed as a DECIMAL(20,6) number. To be properly interpreted, the number must have the format yyyymmddhhmmsszzzzzz, where yyyy, mm, dd, hh, mm, ss, and zzzzzz represent, respectively, the year, month, day, hour, minute, second, and microsecond. The result of subtracting one timestamp value from another is a timestamp duration.
DATETIME ARITHMETIC IN SQL: The only arithmetic operations that can be performed on datetime values are addition and subtraction. If a datetime value is the operand of addition, the other operand must be a duration. The specific rules governing the use of the addition operator with datetime values follow:
o If one operand is a date, the other operand must be a date duration or
labeled duration of years, months, or days.
o If one operand is a time, the other operand must be a time duration or a
labeled duration of hours, minutes, or seconds.
o If one operand is a timestamp, the other operand must be a duration. Any
type of duration is valid.
o Neither operand of the addition operator can be a parameter marker.
The rules for the use of the subtraction operator on datetime values are not the same as those for addition because a datetime value cannot be subtracted from a duration, and because the operation of subtracting two datetime values is not the same as the operation of subtracting a duration from a datetime value. The specific rules governing the use of the subtraction operator with datetime values follow:
o If the first operand is a date, the second operand must be a date, a date
duration, a string representation of a date, or a labeled duration of
years, months, or days.
o If the second operand is a date, the first operand must be a date, or a
string representation of a date.
o If the first operand is a time, the second operand must be a time, a time
duration, a string representation of a time, or a labeled duration of
hours, minutes, or seconds.
o If the second operand is a time, the first operand must be a time, or
string representation of a time.
o If the first operand is a timestamp, the second operand must be a
timestamp, a string representation of a timestamp, or a duration.
o If the second operand is a timestamp, the first operand must be a
timestamp or a string representation of a timestamp.
o Neither operand of the subtraction operator can be a parameter marker.
DATE ARITHMETIC: Dates can be subtracted, incremented, or decremented.
Subtracting Dates: The result of subtracting one date (DATE2) from another (DATE1) is a date duration that specifies the number of years, months, and days between the two dates. The data type of the result is DECIMAL(8,0). If DATE1 is greater than or equal to DATE2, DATE2 is subtracted from DATE1. If DATE1 is less than DATE2, however, DATE1 is subtracted from DATE2, and the sign of the result is made negative. The following procedural description clarifies the steps involved in the operation RESULT = DATE1 - DATE2.
If DAY(DATE2) <= DAY(DATE1)
then DAY(RESULT) = DAY(DATE1) - DAY(DATE2).
If DAY(DATE2) > DAY(DATE1)
then DAY(RESULT) = N + DAY(DATE1) - DAY(DATE2)
where N = the last day of MONTH(DATE2).
MONTH(DATE2) is then incremented by 1.
If MONTH(DATE2) <= MONTH(DATE1)
then MONTH(RESULT) = MONTH(DATE1) - MONTH(DATE2).
If MONTH(DATE2) > MONTH(DATE1)
then MONTH(RESULT) = 12 + MONTH(DATE1) - MONTH(DATE2).
YEAR(DATE2) is then incremented by 1.
YEAR(RESULT) = YEAR(DATE1) - YEAR(DATE2).
For example, the result of DATE('3/15/2000') - '12/31/1999' is 215 (or, a duration of 0 years, 2 months, and 15 days).
Incrementing and Decrementing Dates: The result of adding a duration to a date, or of subtracting a duration from a date, is itself a date. (For the purposes of this operation, a month denotes the equivalent of a calendar page. Adding months to a date, then, is like turning the pages of a calendar, starting with the page on which the date appears.) The result must fall between the dates January 1, 0001 and December 31, 9999 inclusive. If a duration of years is added or subtracted, only the year portion of the date is affected. The month is unchanged, as is the day unless the result would be February 29 of a non-leap-year. In this case, the day is changed to 28, and SQLWARN6 in the SQLCA is set to 'W' to indicate the end-of-month adjustment.
Similarly, if a duration of months is added or subtracted, only months and, if necessary, years are affected. The day portion of the date is unchanged unless the result would be invalid (September 31, for example). In this case, the day is set to the last day of the month, and SQLWARN6 in the SQLCA is set to 'W' to indicate the end-of-month adjustment.
Adding or subtracting a duration of days will, of course, affect the day portion of the date, and potentially the month and year. Adding a labeled duration of DAYS will not cause an end-of-month adjustment.
Date durations, whether positive or negative, may also be added to and subtracted from dates. As with labeled durations, the result is a valid date, and a warning indicator is set in the SQLCA whenever an end-of-month adjustment is necessary.
When a positive date duration is added to a date, or a negative date duration is subtracted from a date, the date is incremented by the specified number of years, months, and days, in that order. Thus DATE1 + X, where X is a positive DECIMAL(8,0) number, is equivalent to the expression:
DATE1 + YEAR(X) YEARS + MONTH(X) MONTHS + DAY(X) DAYS
When a positive date duration is subtracted from a date, or a negative date duration is added to a date, the date is decremented by the specified number of days, months, and years, in that order. Thus, DATE1 - X, where X is a positive DECIMAL(8,0) number, is equivalent to the expression:
DATE1 - DAY(X) DAYS - MONTH(X) MONTHS - YEAR(X) YEARS
When adding durations to dates, adding one month to a given date gives the same date one month later unless that date does not exist in the later month. In that case, the date is set to that of the last day of the later month. For example, January 28 plus one month gives February 28; and one month added to January 29, 30, or 31 results in either February 28 or, for a leap year, February 29.
NOTE: If one or more months is added to a given date and then the same number of months is subtracted from the result, the final date is not necessarily the same as the original date.
TIME ARITHMETIC: Times can be subtracted, incremented, or decremented.
Subtracting Times: The result of subtracting one time (TIME2) from another (TIME1) is a time duration that specifies the number of hours, minutes, and seconds between the two times. The data type of the result is DECIMAL(6,0). If TIME1 is greater than or equal to TIME2, TIME2 is subtracted from TIME1. If TIME1 is less than TIME2, however, TIME1 is subtracted from TIME2, and the sign of the result is made negative. The following procedural description clarifies the steps involved in the operation RESULT = TIME1 - TIME2.
If SECOND(TIME2) <= SECOND(TIME1)
then SECOND(RESULT) = SECOND(TIME1) - SECOND(TIME2).
If SECOND(TIME2) > SECOND(TIME1)
then SECOND(RESULT) = 60 + SECOND(TIME1) - SECOND(TIME2).
MINUTE(TIME2) is then incremented by 1.
If MINUTE(TIME2) <= MINUTE(TIME1)
then MINUTE(RESULT) = MINUTE(TIME1) - MINUTE(TIME2).
If MINUTE(TIME2) > MINUTE(TIME1)
then MINUTE(RESULT) = 60 + MINUTE(TIME1) - MINUTE(TIME2).
HOUR(TIME2) is then incremented by 1.
HOUR(RESULT) = HOUR(TIME1) - HOUR(TIME2).
For example, the result of TIME('11:02:26') - '00:32:56' is 102930 (a duration of 10 hours, 29 minutes, and 30 seconds).
Incrementing and Decrementing Times: The result of adding a duration to a time, or of subtracting a duration from a time, is itself a time. Any overflow or underflow of hours is discarded, thereby ensuring that the result is always a time. If a duration of hours is added or subtracted, only the hours portion of the time is affected. The minutes and seconds are unchanged.
Similarly, if a duration of minutes is added or subtracted, only minutes and, if necessary, hours are affected. The seconds portion of the time is unchanged.
Adding or subtracting a duration of seconds will, of course, affect the seconds portion of the time, and potentially the minutes and hours.
Time durations, whether positive or negative, also can be added to and subtracted from times. The result is a time that has been incremented or decremented by the specified number of hours, minutes, and seconds, in that order. "TIME1 + X", where "X" is a DECIMAL(6,0) number, is equivalent to the expression:
TIME1 + HOUR(X) HOURS + MINUTE(X) MINUTES + SECOND(X) SECONDS
TIMESTAMP ARITHMETIC: Timestamps can be subtracted, incremented, or decremented.
Subtracting Timestamps: The result of subtracting one timestamp (TS2) from another (TS1) is a timestamp duration that specifies the number of years, months, days, hours, minutes, seconds, and microseconds between the two timestamps. The data type of the result is DECIMAL(20,6). If TS1 is greater than or equal to TS2, TS2 is subtracted from TS1. If TS1 is less than TS2, however, TS1 is subtracted from TS2 and the sign of the result is made negative. The following procedural description clarifies the steps involved in the operation RESULT = TS1 - TS2.
If MICROSECOND(TS2) <= MICROSECOND(TS1)
then MICROSECOND(RESULT) = MICROSECOND(TS1) -
MICROSECOND(TS2).
If MICROSECOND(TS2) > MICROSECOND(TS1)
then MICROSECOND(RESULT) = 1000000 +
MICROSECOND(TS1) - MICROSECOND(TS2)
and SECOND(TS2) is incremented by 1.
The seconds and minutes part of the timestamps are subtracted as
specified in the rules for subtracting times.
If HOUR(TS2) <= HOUR(TS1)
then HOUR(RESULT) = HOUR(TS1) - HOUR(TS2).
If HOUR(TS2) > HOUR(TS1)
then HOUR(RESULT) = 24 + HOUR(TS1) - HOUR(TS2)
and DAY(TS2) is incremented by 1.
The date part of the timestamps is subtracted as specified in the rules
for subtracting dates.
Incrementing and Decrementing Timestamps: The result of adding a duration to a timestamp, or of subtracting a duration from a timestamp, is itself a timestamp. Date and time arithmetic is performed as previously defined, except that an overflow or underflow of hours is carried into the date part of the result, which must be within the range of valid dates. Microseconds overflow into seconds.
QCENTURY (Century)
The century (QCENTURY) system value is used to specify the century. It is used with the system value QDATE and QYEAR to determine the specific date currently being used by the system. The possible values are:
o 0 (the years from 1928 to 1999)
o 1 (the years from 2000 to 2053)
You can set the value of QCENTURY with the century indicator, or the system sets the value of QCENTURY based on the following two situations:
o At the time of the first IPL, the system sets the initial value of QCENTURY based on the following rules:
- If QYEAR is equal to or greater than 40, the system assigns a value of 0 to QCENTURY.
- If QYEAR is less than 40, the system assigns a value of 1 to QCENTURY.
o When QYEAR or the year in QDATE is changed:
- QCENTURY is set to 0 if QYEAR is 54 to 99
- QCENTURY is set to 1 if QYEAR is 00 to 27
For example, if you change QYEAR from 95 to 13, the system changes QCENTURY from 0 to 1, indicating a year of 2013. However, if you change QYEAR from 95 to 45, the system will not change QCENTURY, because both 1945 and 2045 are valid dates.
If you change this value, the change takes effect immediately. Changing this value also affects the system value QDATE.
QDATE (Date)
The system date (QDATE) is used to indicate the year, the month, and the day on the system. This value is made up of the QYEAR, QMONTH, and QDAY system values. The format in which QDATE appears is specified by the QDATFMT system value. You can change the system date. If you change QDATE, the change may affect the system values for QCENTURY, QYEAR, QMONTH, QDAY, and QDAYOFWEEK. Any change you make to QDATE takes effect immediately.
QYEAR (Year)
The system year (QYEAR) is used to specify the last two digits of the year on the system. This value ranges from 0 to 99. The system assigns the first two digits for the year based on the current setting for the QCENTURY system value. If the calculated year falls outside the range of dates supported by the system (1928 to 2053), the QCENTURY system value is changed so that the calculated year is within the supported range.
Date parameter types
CL commands which use a date (*DATE) parameter type can be used with both 2-digit years and 4-digit years. In either case the parameter value is a character string passed to the command processing program in the format cyymmdd (c = century digit, y = year, m = month, and d = day).
When using 2-digit year support the system sets the century digit based on the year in the specified date. The century digit is 0 if year equals a number from 40 through 99; it is 1 if year equals a number from 0 through 39.
When using 4-digit year support the system sets the century digit based on the specified 4-digit year where '0' represents years from 1928 to 1999 and '1' for years from 2000 to 2071.
The user must enter the date for the command in the format specified by the date format (DATFMT) job attribute. The date separator (DATSEP) job attribute determines the optional separator character to be used when the date is entered.
CVTDAT (Convert Date)
The Convert Date (CVTDAT) command converts a date value from one format to another, without changing its value. CVTDAT provides for both 2-digit and 4-digit year formats.
OPNQRYF (Open Query File)
The Open Query File (OPNQRYF) command opens a file that contains a set of database records that satisfies a database query request. OPNQRYF provides for both 2-digit and 4-digit years.
DATE, TIME, AND TIMESTAMP COMPARISONS USING THE OPNQRYF COMMAND: A date, time, or timestamp value can be compared either with another value of the same data type or with a string representation of that data type. All comparisons are chronological, which means the farther a time is from January 1, 0001, the greater the value of that time.
Comparisons involving time values and string representations of time values always include seconds. If the string representation omits seconds, zero seconds are implied.
Comparisons involving timestamp values are chronological without regard to representations that might be considered equivalent. Thus, the following predicate is true:
TIMESTAMP('1990-02-23-00.00.00') > '1990-02-22-24.00.00'
When a character, DBCS-open, or DBCS-either field or constant is represented as a date, time, or timestamp, the following rules apply:
DATE: The length of the field or literal must be at least 8 if the date format is *ISO, *USA, *EUR, *JIS, *YMD, *MDY, or *DMY. If the date format is *JUL (yyddd), the length of the variable must be at least 6 (includes the separator between yy and ddd). The field or literal may be padded with blanks.
TIME: For all of the time formats (*USA, *ISO, *EUR, *JIS, *HMS), the length of the field or literal must be at least 4. The field or literal may be padded with blanks.
TIMESTAMP: For the timestamp format (yyyy-mm-dd-hh.mm.ss.uuuuuu), the length of the field or literal must be at least 16. The field or literal may be padded with blanks.
DATE, TIME, AND TIMESTAMP ARITHMETIC USING OPNQRYF CL COMMAND: Date, time, and timestamp values can be incremented, decremented, and subtracted. These operations may involve decimal numbers called durations. Following is a definition of durations and a specification of the rules for performing arithmetic operations on date, time, and timestamp values.
Durations: A DURATION is a number representing an interval of time. The four types of durations are:
LABELED DURATION
A LABELED DURATION represents a specific unit of time as expressed by a number (which can be the result of an expression) used as an operand for one of the seven duration built-in functions: %DURYEAR, %DURMONTH, %DURDAY, %DURHOUR, %DURMINUTE, %DURSEC, or %DURMICSEC. The functions are for the duration of year, month, day, hour, minute, second, and microsecond, respectively. The number specified is converted as if it was assigned to a DECIMAL(15,0) number. A labeled duration can only be used as an operand of an arithmetic operator when the other operand is a value of data type *DATE, *TIME, or *TIMESTP. Thus, the expression HIREDATE + %DURMONTH(2) + %DURDAY(14) is valid, whereas the expression HIREDATE + (%DURMONTH(2) + %DURDAY(14)) is not. In both of these expressions, the labeled durations are %DURMONTH(2) and %DURDAY(14).
DATE DURATION
A DATE DURATION represents a number of years, months, and days, expressed as a DECIMAL(8,0) number. To be properly interpreted, the number must have the format yyyymmdd, where yyyy represents the year, mm the month, and dd the day. The result of subtracting one date value from another, as in the expression HIREDATE - BRTHDATE, is a date duration.
TIME DURATION
A TIME DURATION represents a number of hours, minutes, and seconds, expressed as a DECIMAL(6,0) number. To be properly interpreted, the number must have the format hhmmss, where hh represents the hour, mm the minute, and ss the second. The result of subtracting one time value from another is a time duration.
TIMESTAMP DURATION
A TIMESTAMP DURATION represents a number of years, months, days, hours, minutes, seconds, and microseconds, expressed as a DECIMAL(20,6) number. To be properly interpreted, the number must have the format yyyymmddhhmmsszzzzzz, where yyyy, mm, dd, hh, mm, ss, and zzzzzz represent, respectively, the year, month, day, hour, minute, second, and microsecond. The result of subtracting one timestamp value from another is a timestamp duration.
RULES FOR DATE, TIME, AND TIMESTAMP ARITHMETIC: The only arithmetic operations that can be performed on date and time values are addition and subtraction. If a date or time value is the operand of addition, the other operand must be a duration. The specific rules governing the use of the addition operator with date and time values follow:
o If one operand is a date, the other operand must be a date duration or a labeled duration of years, months, or days.
o If one operand is a time, the other operand must be a time duration or a labeled duration of hours, minutes, or seconds.
o If one operand is a timestamp, the other operand must be a duration. Any type of duration is valid.
The rules for the use of the subtraction operator on date and time values are not the same as those for addition because a date or time value cannot be subtracted from a duration, and because the operation of subtracting two date and time values is not the same as the operation of subtracting a duration from a date or time value. The specific rules governing the use of the subtraction operator with date and time values follow:
o If the first operand is a date, the second operand must be a date, a date
duration, a string representation of a date, or a labeled duration of
years, months, or days.
o If the second operand is a date, the first operand must be a date or a
string representation of a date.
o If the first operand is a time, the second operand must be a time, a time
duration, a string representation of a time, or a labeled duration of
hours, minutes, or seconds.
o If the second operand is a time, the first operand must be a time or
string representation of a time.
o If the first operand is a timestamp, the second operand must be a
timestamp, a string representation of a timestamp, or a duration.
o If the second operand is a timestamp, the first operand must be a
timestamp or a string representation of a timestamp.
DATE ARITHMETIC: Dates can be subtracted, incremented, or decremented.
Subtracting Dates: The result of subtracting one date (DATE2) from another (DATE1) is a date duration that specifies the number of years, months, and days between the two dates. The data type of the result is DECIMAL(8,0). If DATE1 is greater than or equal to DATE2, DATE2 is subtracted from DATE1. If DATE1 is less than DATE2, however, DATE1 is subtracted from DATE2, and the sign of the result is made negative. The following procedural description clarifies the steps involved in the operation RESULT = DATE1 - DATE2.
If %DAY(DATE2) <= %DAY(DATE1)
then %DAY(RESULT) = %DAY(DATE1) - %DAY(DATE2).
If %DAY(DATE2) > %DAY(DATE1)
then %DAY(RESULT) = N + %DAY(DATE1) - %DAY(DATE2)
where N = the last day of %MONTH(DATE2).
%MONTH(DATE2) is then incremented by 1.
If %MONTH(DATE2) <= %MONTH(DATE1)
then %MONTH(RESULT) = %MONTH(DATE1) - %MONTH(DATE2).
If %MONTH(DATE2) > %MONTH(DATE1)
then %MONTH(RESULT) = 12 + %MONTH(DATE1) - %MONTH(DATE2).
%YEAR(DATE2) is then incremented by 1.
%YEAR(RESULT) = %YEAR(DATE1) - %YEAR(DATE2).
For example, the result of %DATE('3/15/2000') - '12/31/1999' is 215 (or, a duration of 0 years, 2 months, and 15 days).
Incrementing and Decrementing Dates: The result of adding a duration to a date, or of subtracting a duration from a date, is itself a date. (For the purposes of this operation, a month denotes the equivalent of a calendar page. Adding months to a date, then, is like turning the pages of a calendar, starting with the page on which the date appears.) The result must fall between the dates January 1, 0001, and December 31, 9999, inclusive. If a duration of years is added or subtracted, only the year portion of the date is affected. The month is unchanged, as is the day unless the result would be February 29 of a year that is not a leap year. In this case, the day is changed to 28.
Similarly, if a duration of months is added or subtracted, only months and, if necessary, years are affected. The day portion of the date is unchanged unless the result would not be valid (September 31, for example). In this case, the day is set to the last day of the month.
Adding or subtracting a duration of days will, of course, affect the day portion of the date, and potentially the month and year.
Date durations, whether positive or negative, may also be added to and subtracted from dates. As with labeled durations, the result is a valid date.
When a positive date duration is added to a date, or a negative date duration is subtracted from a date, the date is incremented by the specified number of years, months, and days, in that order. Thus, DATE1 + X, where X is a positive DECIMAL(8,0) number, is equivalent to the expression: DATE1 + %DURYEAR(%YEAR(X)) + %DURMONTH(%MONTH(X)) + %DURDAY(%DAY(X))
When a positive date duration is subtracted from a date, or a negative date duration is added to a date, the date is decremented by the specified number of days, months, and years, in that order. Thus, DATE1 - X, where X is a positive DECIMAL(8,0) number, is equivalent to the expression: DATE1 - %DURDAY(%DAY(X)) - %DURMONTH(%MONTH(X)) - %DURYEAR(%YEAR(X))
When adding durations to dates, adding one month to a given date gives the same date one month later unless that date does not exist in the later month. In that case, the date is set to that of the last day of the later month. For example, January 28 plus one month gives February 28; and one month added to January 29, 30, or 31 results in either February 28 or, for a leap year, February 29.
NOTE: If one or more months are added to a given date and then the same number of months is subtracted from the result, the final date is not necessarily the same as the original date.
TIME ARITHMETIC: Times can be subtracted, incremented, or decremented.
Subtracting Times: The result of subtracting one time (TIME2) from another (TIME1) is a time duration that specifies the number of hours, minutes, and seconds between the two times. The data type of the result is DECIMAL(6,0). If TIME1 is greater than or equal to TIME2, TIME2 is subtracted from TIME1. If TIME1 is less than TIME2, however, TIME1 is subtracted from TIME2, and the sign of the result is made negative. The following procedural description clarifies the steps involved in the operation RESULT = TIME1 - TIME2.
If %SECOND(TIME2) <= %SECOND(TIME1)
then %SECOND(RESULT) = %SECOND(TIME1) - %SECOND(TIME2).
If %SECOND(TIME2) > %SECOND(TIME1)
then %SECOND(RESULT) = 60 + %SECOND(TIME1) - %SECOND(TIME2).
%MINUTE(TIME2) is then incremented by 1.
If %MINUTE(TIME2) <= %MINUTE(TIME1)
then %MINUTE(RESULT) = %MINUTE(TIME1) - %MINUTE(TIME2).
If %MINUTE(TIME2) > %MINUTE(TIME1)
then %MINUTE(RESULT) = 60 + %MINUTE(TIME1) - %MINUTE(TIME2).
%HOUR(TIME2) is then incremented by 1.
%HOUR(RESULT) = %HOUR(TIME1) - %HOUR(TIME2).
For example, the result of %TIME('11:02:26') - '00:32:56' is 102930 (a
duration of 10 hours, 29 minutes, and 30 seconds).
Incrementing and Decrementing Times: The result of adding a duration to a time, or of subtracting a duration from a time, is itself a time. Any overflow or underflow of hours is discarded, thereby ensuring that the result is always a time. If a duration of hours is added or subtracted, only the hours portion of the time is affected. The minutes and seconds are unchanged.
Similarly, if a duration of minutes is added or subtracted, only minutes and, if necessary, hours are affected. The seconds portion of the time is unchanged.
Adding or subtracting a duration of seconds will, of course, affect the seconds portion of the time, and potentially the minutes and hours.
Time durations, whether positive or negative, also can be added to and subtracted from times. The result is a time that has been incremented or decremented by the specified number of hours, minutes, and seconds, in that order. "TIME1 + X", where "X" is a DECIMAL(6,0) number, is equivalent to the expression: TIME1 + %DURHOUR(%HOUR(X)) + %DURMINUTE(%MINUTE(X)) + %DURSEC(%SECOND(X))
TIMESTAMP ARITHMETIC: Timestamps can be subtracted, incremented, or decremented.
Subtracting Timestamps: The result of subtracting one timestamp (TS2) from another (TS1) is a timestamp duration that specifies the number of years, months, days, hours, minutes, seconds, and microseconds between the two timestamps. The data type of the result is DECIMAL(20,6). If TS1 is greater than or equal to TS2, TS2 is subtracted from TS1. If TS1 is less than TS2, however, TS1 is subtracted from TS2 and the sign of the result is made negative. The following procedural description clarifies the steps involved in the operation RESULT = TS1 - TS2:
If %MICSEC(TS2) <= %MICSEC(TS1)
then %MICSEC(RESULT) = %MICSEC(TS1) -
%MICSEC(TS2).
If %MICSEC(TS2) > %MICSEC(TS1)
then %MICSEC(RESULT) = 1000000 +
%MICSEC(TS1) - %MICSEC(TS2)
and %SECOND(TS2) is incremented by 1.
The seconds and minutes part of the timestamps are subtracted as specified in
the rules for subtracting times:
If %HOUR(TS2) <= %HOUR(TS1)
then %HOUR(RESULT) = %HOUR(TS1) - %HOUR(TS2).
If %HOUR(TS2) > %HOUR(TS1)
then %HOUR(RESULT) = 24 + %HOUR(TS1) - %HOUR(TS2)
and %DAY(TS2) is incremented by 1.
The date part of the timestamp is subtracted as specified in the rules for
subtracting dates.
Incrementing and Decrementing Timestamps: The result of adding a duration to a timestamp, or of subtracting a duration from a timestamp, is itself a timestamp. Date and time arithmetic is performed as previously defined, except that an overflow or underflow of hours is carried into the date part of the result, which must be within the range of valid dates. Microseconds overflow into seconds.
RTVJOBA (Retrieve Job Attributes)
The Retrieve Job Attributes (RTVJOBA) command is used to retrieve the current attributes of a job so that they can be used in an application program. Year 2000 related job attributes include:
o DATE (providing a 2-digit year)
o CYMDDATE (providing a 2-digit year qualified by a century digit)
RTVSYSVAL (Retrieve System Value)
The Retrieve System Value (RTVSYSVAL) command is used to retrieve the current value of a system value so that it can be used in an application program. Year 2000 related system values include:
o QCENTURY
o QDATE
o QYEAR
IBM Application Dictionary Services/400 is a host-based, integrated impact analysis tool to improve programmer productivity and application quality during application development and maintenance.
The product is a feature of the Application Development ToolSet/400 and is integrated with such tools as Source Entry Utility (SEU), Screen Design Aid (SDA), and Data File Utility (DFU). It is fully menu-driven and simple to learn for experienced AS/400 programmers.
Application Dictionary Services provides the ability to place a "dictionary" or a cross-referencing index over data and programs. When a programmer wants to make a change to an application program, he or she uses the dictionary to determine the effect that change will have on other programs, files, and data. The programmer is saved from manually performing the tedious and error-prone work of looking for these relationships. This, coupled with the Application Dictionary Services mass compile feature, can improve the quality of applications and decrease the amount of time programmers spend maintaining existing code.
With the pervasiveness of date information in many applications, this impact analysis and mass compile capability can simplify your transition to a Year2000-ready application base.
IBM Application Development Manager/400 is a host-based change management tool that provides application developers a development environment to effectively and efficiently manage application development and maintenance.
The product is integrated with the AS/400 Product Development Manager (PDM) and is a feature of Application Development ToolSet/400. It can be used either from the PDM menu, or by typing the Control Language (CL) commands on the command line.
Application Development Manager provides a discipline to better control the development and maintenance environment. It forces the project leader to define the application environment, outlining the different stages of application (production, test, or fix) and the roles of each developer. The developers work in a well-organized environment, which in turn, leads to increased productivity. Through its version control facility, it allows the creating and managing of several versions of the same applications with less disk utilization and the audit trail feature keeps a log of all changes made to an application, allowing better monitoring of the application.
With the pervasiveness of date information in many applications, this change management tool can simplify your transition to a Year2000 safe application base.
+--- THE IBM COBOL FAMILY --------------------------------------------------+ | | | IBM COBOL Family extends over multiple platforms: workstation (OS/2 and | | AIX) and host (MVS, VM, VSE, and OS/400). All the IBM COBOL compilers | | were built from the same base product, which gives source and compiler | | compatibility across multiple platforms. | | | | The MVS & VM COBOL product is discussed in "The IBM COBOL Family for MVS | | & VM" on page 8-8. The VSE COBOL product is discussed in "The IBM COBOL | | Family for VSE/ESA" on page 8-34. The OS/400 product is described in | | "IBM Tools for AS/400" on page 8-45. The OS/2 and Windows and the AIX | | products are described in "The IBM COBOL Family for the Workstations." | | | +---------------------------------------------------------------------------+
For application code written in COBOL for the workstation or developed for the MVS, VM, VSE, or OS/400 platforms, IBM has developed COBOL compilers for the workstation. These products target the workstation and host application development environments.
IBM'S COBOL WORKSTATION PRODUCTS ARE:
o IBM VisualAge for COBOL for OS/2 with Windows** 95/NT support o IBM COBOL Set for AIX
These COBOL compilers--IBM VisualAge for COBOL for OS/2 and IBM COBOL Set for AIX--are available today and feature full Year2000 support. They provide ANSI COBOL Standard Intrinsic Functions which give full date-manipulation capability with 4-digit year support. In addition, IBM VisualAge for COBOL for OS/2 includes a native Windows 95 or Windows NT (2.51) COBOL application development environment.
Companies need productive application development environments. A language compiler is only a portion of what application programmers need today to develop and maintain code. Tools that generate statistics from code; modularize, migrate, or restructure code; or search class libraries; are becoming more and more important. Those tools are available today in VisualAge for COBOL for OS/2 and COBOL Set for AIX.
Year2000 Highlights of IBM VisualAge for COBOL for OS/2
Many applications were coded with 2-digit-year data. IBM VisualAge for COBOL for OS/2 provides intrinsic functions not available in our earlier COBOL compilers. Calendar functions include:
o CURRENT-DATE o DATE-OF-INTEGER o DAY-OF-INTEGER o INTEGER-OF-DATE o INTEGER-OF-DAY o WHEN-COMPILED EXAMPLE OF OBTAINING THE 4-DIGIT YEAR WITH THE COBOL INTRINSIC FUNCTIONS: o DATE-OF-INTEGER gives YYYYMMDD o DAY-OF-INTEGER gives YYYYDDD
IBM VisualAge for COBOL, Professional for OS/2 contains tools helping you identify code that is not Year2000 compliant, analyze the impact of changing that code, then make the change, and recompile your program. Refer to "Redeveloper Tools" on page 8-79 for details about this support as well as support for converting your old level COBOL code to ANSI 85 standard source and for structuring unstructured COBOL programs.
Features of IBM VisualAge for COBOL for OS/2
IBM VisualAge for COBOL for OS/2 provides the COBOL programmer with 32-bit Direct-to-SOM-based, object-oriented support on the OS/2 operating system. In addition, a COBOL application development environment is provided that is designed specifically to handle client/server, mission-critical, line-of-business applications through visual development. IBM VisualAge for COBOL for OS/2 also gives the COBOL programmer a set of high-productivity, OS/2-based power tools for the development of applications targeting OS/2 execution systems. IBM VisualAge for COBOL for OS/2 is now available in two separate editions:
o IBM VisualAge for COBOL, Standard for OS/2 includes the compiler,
run-time, visual builder, debug tool, LPEX editor, performance analyzer,
and assistant tools (code, data, and transaction).
o IBM VisualAge for COBOL, Professional for OS/2 includes all of the
Standard features plus the Redeveloper tools.
Printed and softcopy books are available with both editions along with tutorials and online help.
REMOTE EDIT/COMPILE/DEBUG: The remote edit/compile/debug function lets you work with your host (MVS or OS/390) applications from your OS/2 workstation. This function provides a seamless workstation development environment for the development of host programs. Files are directly loaded from the host to the workstation without the need for a workstation naming convention and mapping. Remote edit/compile/debug is integrated with workstation components, such as LPEX and WorkFrame. Remote debugging features the use of a graphical user interface when interacting with the host debug tool. Communications to the host is provided through the Advanced Program-to-Program Communication (APPC) protocol.
ODBC SUPPORT: VisualAge for COBOL for OS/2 supports native imbedded SQL statements for Oracle and Sybase. It also includes Open Database Connectivity (ODBC) support that lets you access data from a variety of databases and file systems that support the ODBC interface. The Windows for 95 and Windows for NT support also includes ODBC support.
IBM COBOL SUPPORT FOR WINDOWS 95 AND WINDOWS NT: IBM COBOL support for Windows 95 and Windows NT provides you with a 32-bit direct-to-SOM-based, object-oriented compiler and run time for the Windows 95 and Windows NT operating systems. This Windows support also includes a set of high-productivity, Windows-based tools (WorkFrame, the LPEX editor, a debug tool, and Performance Analyzer) for the development of applications targeting Windows 95 and Windows NT execution systems. LPEX, the debug tool, and the Performance Analyzer contain the same functions as the OS/2-based tools.
STL FILE SYSTEM: For COBOL I/O support, the STL (STandard Language) file system is supplied for local files. The STL file system enables the processing of files created on other systems. The Windows for 95 and Windows for NT support also includes the STL file system.
MQSERIES: IBM's award-winning MQSeries is now supported by VisualAge for COBOL for OS/2. MQSeries enables business applications to exchange information across different operating-system platforms in a way that is straightforward and easy to implement.
MQSeries simplifies the task of connecting your application across unlike environments. Programs communicate using the MQSeries programming interface, which is easy to use and shields programmers from the complexity of different operating systems and the underlying networks. You focus on the business logic, while MQSeries manages your connections to the computer.
LOCAL AND REMOTE DATA ACCESS: IBM VisualAge for COBOL for OS/2 provides local and remote data access including:
o IBM SMARTDATA UTILITIES (SDU) THAT PROVIDE:
- Record-oriented file access through standard COBOL I/O statements to:
- Local OS/2 VSAM files
- Remote MVS VSAM, SAM, PDS, and PDSE files
- Remote OS/400 record files
- Remote CICS managed VSAM files on MVS using CICS/DDM
- A full set of data conversion API's for converting single-, double-,
and mixed-byte character strings, numerics and complex structured
records.
- A full set of SMARTsort API's for sorting, copying, and merging
record and byte files located locally or remotely.
o Direct access to data managed by BTRIEVE.
o Support for local and remote DB2 data access using DB2 for OS/2.
o Support for local and remote CICS data access using CICS for OS/2 Version
3 (this is part of IBM Transaction Server for OS/2 Warp Version 4) or
CICS Client for OS/2 Version 2.
VISUAL GUI DESIGNER: The visual GUI designer lets you build complex CUA-compliant screens. The visual interface (GUI work screen) that creates the GUI code, is an easy-to-use, intuitive tool for creating graphical interfaces, eliminating the need for in-depth GUI development knowledge. You can create applications by selecting controls from the control palette and moving them onto the design editor, thereby providing an integrated "what you see is what you get" (WYSIWYG) user interface. Either during or after this brief development process, you can build the application by coding in COBOL logic with COBOL-sensitive edit/compile/debug tools.
WORKFRAME/2: IBM WorkFrame/2 provides seamless integration of all the components included in the IBM VisualAge for COBOL for OS/2 product. WorkFrame/2 is a highly configurable, project-oriented application development environment for use on OS/2 and takes full advantage of the features offered by OS/2. When used as the integration medium for application development tools, the fully configurable WorkFrame/2 increases the effectiveness of these tools as agents for enhancing user productivity. WorkFrame/2 organizes the programmer's workplace by grouping files into logical units or projects. As an organizer, WorkFrame/2:
o Adapts to your project organization environment instead of the project
organization having to fit into the WorkFrame defined environment.
o Sets up projects to consist of source and object files spanning multiple
directories, and one target directory, (e.g., .EXE or .DLL).
o Associates each project with multiple actions, including compiling,
debugging, making, linking, browsing, profiling/analyzing, and
preprocessing.
o Allows multiple developers to work concurrently on a single project by
plugging in their own source control system.
NOTE: WorkFrame is also included in the Windows 95 and Windows NT support.
CONTEXT SENSITIVE EDITOR: The LPEX Editor is a language-sensitive, color editor that supports COBOL. You can use the LPEX Editor to create and edit many types of text files, including program source and documentation. By automatically parsing COBOL source code, LPEX distinguishes between language constructs. For instance, language keywords, comments, string literals, and numbers are displayed using distinctive fonts and colors. You can quickly find items you are looking for in your source code. Using LPEX, you can:
o Be made aware of some syntax errors when the source code is created.
o Use multiple windows to display several documents or to display more than
one view of the same document.
o Dynamically configure LPEX to be a multiple-window or single-window tool.
o Select a block of text and move or copy it between documents.
o Cut and paste to a shell or another application.
o Undo previous changes to a document.
You can customize and extend virtually every aspect of this programmable editor. You can extend LPEX through dynamic link libraries--there is no proprietary extension language to learn. With the LPEX application programming interface (API), you can write powerful extensions to the editor using C and C++. In addition, LPEX provides a rich command language that you can use to create or modify editor functions. You can:
o Define your own fonts and colors.
o Modify the editor action key layout.
o Add menus to perform frequently used commands (menu definitions can be
applied on a filename extension basis).
o Write your own editor commands.
NOTE: LPEX is also included in the Windows 95 and Windows NT support.
INTERACTIVE DEBUG TOOL FOR OS/2 (IDBUG): The Debug Tool supplied with IBM VisualAge for COBOL for OS/2 provides source-level debugging built around a set of core functions that let you quickly and efficiently control execution and analyze data. You can:
o Display and change variables o Display and change storage o Display and change the processor registers o Display the call stack o Add and delete simple and complex breakpoints o Control the execution of multiple threads o View source code as a listing, disassembly, or mixed.
You can debug CICS for OS/2 Version 3 transactions built with IBM VisualAge for COBOL for OS/2 interactively. (CICS for OS/2 Version 3 is part of the IBM Transaction Server for OS/2 Warp Version 4.)
For PM application programming support, synchronous and asynchronous modes give you two ways to debug PM applications. You can manage the application windows concurrently with the Debug Tool windows.
NOTE: A debug tool is also included in the Windows 95 and Windows NT support.
PERFORMANCE TUNING: (Windows version supplied with Windows 95/NT support) Execution trace analysis and performance tuning is provided through the IBM Performance Analyzer. It helps you tune and understand your programs by monitoring program execution and generating a function-by-function trace of the run. This trace can be examined subsequently by utility programs that graphically display the execution trace. Not only does the analyzer trace procedures in the .EXE file, but it traces the entry points to system calls and application DLLs.
NOTE: The Performance Analyzer is also included in the Windows 95 and Windows NT support.
DATA ASSISTANT AND TRANSACTION ASSISTANT: Data Assistant simplifies the process of constructing syntactically correct, embedded SQL statements. It gives you a graphical view of your relational database (both local and remote), lets you map COBOL data structures to the database and generate SQL statements into your source file. Transaction Assistant enables non-CICS COBOL applications to access CICS transactions.
OPTIMIZATION (OPTIMIZE COMPILER OPTION): When activated, the COBOL optimizer generates a more efficient program that helps reduce program run time and amount of main storage used.
DB2 CO-PROCESSOR SUPPORT: By using the DB2 co-processor, the DB2 pre-processing step has been eliminated which results in better optimization of EXEC SQL statements. The DB2 support is fully integrated with the compiler.
REDEVELOPER TOOLS: Use the Redeveloper tools, which are part of VisualAge for COBOL, Professional for OS/2, to re-engineer existing programs to produce better understood and documented applications. The tools aid in understanding, maintenance, and reuse of existing COBOL code inventory, along with, editing, compiling, and debugging new and existing applications. Three Redeveloper tools are included:
o APPLICATION UNDERSTANDING: understand application structure and
relationship of resources; populate facility for scanning JCL; and
analysis facility for determining shared resources.
o PROGRAM UNDERSTANDING: understand complex COBOL applications; analyze and
extract information about an entire application; and OS/2 graphical user
interface to view application physical design.
o PROGRAM CONVERSION AND STRUCTURING: automate conversion of old source
levels to new ANSI 85 source standard; structure code to make it easier
to understand, debug, modify and reuse; generate conversion, analysis,
and structuring reports.
IBM VisualAge for COBOL for OS/2 works with TeamConnection to store COBOL source files, build COBOL applications, and provide version control and change management for applications in production.
IBM COBOL Set for AIX
IBM COBOL Set for AIX provides the COBOL programmer with Direct-to-SOM-based, object-oriented support on the AIX operating system. IBM COBOL Set for AIX provides a COBOL application development environment that is designed specifically to create client/server, mission-critical, line-of-business applications. IBM COBOL Set for AIX also gives the COBOL programmer a set of high-productivity, AIX-based tools for the development of applications targeting AIX execution systems.
IBM COBOL Set for AIX includes local and remote data access, a context-sensitive editor (LPEX), Program Builder, Program Debug Tool, Common Desktop Integration of these tools, and online help.
Year2000 Highlights of IBM COBOL Set for AIX
Many applications were coded with 2-digit-year data. IBM COBOL Set for AIX provides intrinsic functions not available in our earlier COBOL compilers. Calendar functions include:
o CURRENT-DATE o DATE-OF-INTEGER o DAY-OF-INTEGER o INTEGER-OF-DATE o INTEGER-OF-DAY o WHEN-COMPILED EXAMPLE OF OBTAINING THE 4-DIGIT YEAR WITH THE COBOL INTRINSIC FUNCTIONS: o DATE-OF-INTEGER gives YYYYMMDD o DAY-OF-INTEGER gives YYYYDDD
Features of IBM COBOL Set for AIX
ODBC SUPPORT: The Open Database Connectivity (ODBC) support lets you use the ODBC interface.
STL FILE SYSTEM: For COBOL I/O support, the STL (STandard Language) file system is supplied for local files. The STL file system enables the processing of files created on other systems.
LOCAL AND REMOTE DATA ACCESS: IBM COBOL Set for AIX provides local and remote data access including:
o IBM SMARTDATA UTILITIES (SDU) THAT PROVIDES:
- Record-oriented file access through standard COBOL I/O statements to:
- Local AIX VSAM files
- Remote MVS VSAM, SAM, PDS, and PDSE files
- Remote OS/400 files
- Remote CICS managed VSAM files on MVS using CICS/DDM
- Data managed by IBM ENCINA for AIX Shared File System
o Support for local and remote DB2 data access using DB2 for AIX.
o Support for local and remote CICS data access using CICS for AIX or CICS
Client for AIX.
CONTEXT SENSITIVE EDITOR: The LPEX Editor is a language-sensitive, color editor that supports COBOL. You can use the LPEX Editor to create and edit many types of text files, including program source and documentation. By automatically parsing COBOL source code, LPEX distinguishes between language constructs. For instance, language keywords, comments, string literals, and numbers are displayed using distinctive fonts and colors. You can quickly find items you are looking for in your source code. Using LPEX, you can:
o Be made aware of some syntax errors when the source code is created.
o Use multiple windows to display several documents or to display more than one view of the same document.
o Dynamically configure LPEX to be a multiple-window or single-window tool.
o Select a block of text and move or copy it between documents.
o Cut and paste to a shell or another application.
o Undo previous changes to a document.
You can customize and extend virtually every aspect of this programmable editor. You can extend LPEX through dynamic link libraries--there is no proprietary extension language to learn. With the LPEX application programming interface (API), you can write powerful extensions to the editor using C and C++. In addition, LPEX provides a rich command language that you can use to create or modify editor functions. You can:
o Define your own fonts and colors.
o Modify the editor action key layout.
o Add menus to perform frequently used commands (menu definitions can be applied on a filename extension basis).
o Write your own editor commands.
PROGRAM BUILDER: The Program Builder manages the repetitive tasks of compiling, linking, and correcting errors in program source code. The Program Builder:
o Provides a graphical user interface to simplify the process of setting and saving compile and linker options.
o Lists build errors in a window. Selecting a compile error in the list will position you at the error in the source code in the LPEX Editor.
o Creates a makefile that is used by the AIX make command to construct and maintain programs and libraries. The Program Builder also determines build dependencies by scanning the source code files for dependency information.
COMMON DESKTOP ENVIRONMENT (CDE): End-user productivity is enhanced on AIX Version 4 with a new user interface for the AIX Desktop which is based on the Common Desktop Environment. This new graphical user interface is included on both the AIX for Clients and the AIX for Servers packages.
The Common Desktop Environment (CDE) integration for COBOL Set for AIX consists of a COBOL application folder which is integrated within the CDE Application Manager. The COBOL Set for AIX application folder contains icons representing the COBOL tools and applications. The COBOL application folder will contain icons for the LPEX editor, the Program Builder, the Program Debug Tool, and COBOL online documentation.
CDE Integration of the COBOL tools you invoke the tools in a simple and consistent manner. The CDE desktop recognizes different types of files using a data-type database. A data type identifies the files of a particular format and associates them with the appropriate applications. These associations mean that you don't have to remember command line invocations of tools. In most cases when you double-click on a file, the CDE desktop automatically launches the correct application that understands that file's data.
PROGRAM DEBUG TOOL: The COBOL Set for AIX Debug Tool helps you detect and diagnose errors in code developed using the COBOL Set for AIX compiler. This intuitive graphical user interface lets you control execution of the program, examine and modify data (variables, storage, and registers), and perform many other useful functions. Additionally, you can debug C functions that your applications may be using.
The Debug Tool provides source-level debugging and is built around a set of core functions lets you quickly and efficiently control execution and analyze data. With these core functions, you can:
o Display and change variables o Display and change storage o Display and change the processor registers o Display the call stack o Add and delete simple and complex breakpoints o Control the execution of multiple threads o View source code as listing, disassembly, or mixed.
OPTIMIZATION (OPTIMIZE COMPILER OPTION): When activated, the COBOL optimizer generates a more efficient program that helps reduce program run time and amount of main storage used.
DB2 CO-PROCESSOR SUPPORT: By using the DB2 co-processor, the DB2 pre-processing step has been eliminated which results in better optimization of EXEC SQL statements. The DB2 support is fully integrated with the compiler.
For application code written in PL/I for the workstation or developed for the MVS, VM, VSE, or AS/400 platforms, IBM has developed PL/I compilers for the workstation. These products target the workstation and host application development environments.
IBM's PL/I workstation products are:
o IBM PL/I FOR OS/2 o IBM PL/I SET FOR AIX o IBM PL/I SET FOR WINDOWS
Features
These PL/I compilers, IBM PL/I for OS/2, IBM PL/I for Windows, and IBM PL/I set for AIX, are available today and provide full Year2000 support. They provide a built-in function which supports 4-digit-year data.
Companies need productive application development environments. A language compiler is only a portion of what application programmers need today to develop and maintain code. Tools to:
o generate statistics o modularize, migrate, or restructure code o search class libraries.
IBM PL/I for OS/2 provides the PL/I programmer with 32-bit support on the OS/2 operating system. In addition, a PL/I application development environment is provided that is designed especially to handle mission critical, line-of-business applications through visual programming and construction-from-components technologies. PL/I for OS/2 is offered in a Professional Edition.
IBM PL/I FOR OS/2 PROFESSIONAL EDITION: IBM PL/I for OS/2 Professional Edition includes a full 32-bit compiler, run-time library, and a graphical, interactive debugging facility that supports new PL/I application development on stand-alone PCs or small LANs, and function that enhances compatibility with the mainframe compiler. Developers can build and test host-based VSAM, DB2 (R), CICS, and IMS applications, or they can take advantage of PL/I for OS/2 (in combination with DB2/2, CICS OS/2, and IMS Client Server/2) to create client/server applications that integrate with existing mainframe programs.
IBM PL/I for OS/2 Toolkit
IBM PL/I for OS/2 Toolkit helps you streamline the programming process, offering a development environment for PL/I for OS/2 presentation manager (PM) applications. The Toolkit is a collection of tools designed to complement the Professional Edition of PL/I for OS/2. The Toolkit includes: a visual prototyping tool and code generator that can help you develop graphical user interfaces, a programming aid designed to help you convert C header files to PL/I header files, and the OS/2 Developer's Toolkit.
IBM PL/I for Windows
IBM PL/I for Windows provides a PL/I application development environment for OS/2 and Windows 95/NT workstations including a complier, language-sensitive editor, debugger, and performance tuner.
IBM PL/I Set for AIX
IBM PL/I Set for AIX provides a PL/I application development environment designed to allow you to create mission critical, line-of-business applications that can run on host systems, workstations, or client/server systems with access to DB2(R), CICS, VSAM/SAM, and other data systems. IBM PL/I Set for AIX provides the PL/I programmer with an optimizing compiler and a set of high-productivity, AIX-based tools integrated with the AIX Common Desktop Environment, for the development of applications.
PL/I COMPILER: IBM PL/I Set for AIX provides an optimizing compiler that contains a rich implementation of the PL/I language as well as support to improve compatibility with mainframe PL/I and enhancements that can allow new AIX-based applications to take advantage of features of the AIX platform.
The PL/I compiler also includes powerful, integrated preprocessors. You can select from one or more of the preprocessors as required for use in your program. The preprocessors included are:
o the macro facility
o the preprocessor that allows you to incorporate external source files
o the SQL preprocessor that translates embedded SQL statements into PL/I
statements, providing support for local and remote DB2 data access when
used with DB2 for AIX
o the CICS preprocessor that translates embedded CICS statements into PL/I
statements, providing support for local and remote CICS data access when
used with CICS for AIX or CICS Client for AIX
A choice of linkages and parameter-passing mechanisms is also provided to facilitate interlanguage communications (ILC) between your PL/I routines and C/C++, Fortran, Pascal, and COBOL routines on AIX.
PL/I Set for AIX supports a single-byte character set (SBCS) and a double-byte character set (DBCS).
COMMON DESKTOP ENVIRONMENT: IBM PL/I Set for AIX utilizes the new graphical user interface (GUI), based on the Common Desktop Environment (CDE), in IBM AIX Version 4.1. The CDE integration consists of a PL/I application folder which is integrated within the CDE Application Manager. The PL/I Set for AIX application folder contains icons representing the PL/I tools and applications. CDE Integration of the PL/I tools will allow the user to invoke the tools in a simple and consistent manner. The CDE desktop recognizes different types of files using a data type database. A data type identifies the files of a particular format and associates them with the appropriate applications. These associations mean that users don't have to remember command line invocations of tools. In most cases when a user double-clicks on a file, the CDE desktop will automatically launch the correct application that understands that file's data.
The PL/I application folder contains:
o Program Builder o Debug Tool o PL/I online documentation
PROGRAM BUILDER: The Program Builder manages the repetitive tasks of compiling, linking, and correcting errors in program source code. The Program Builder is designed to:
o Provide a graphical user interface to simplify the process of setting and
saving compile and linker options.
o Lists build errors in a window. Selecting a compile error in the list
will position you at the error in the source code.
o Creates a makefile that is used by the AIX make command to construct and
maintain programs and libraries. The Program Builder also determines
build dependencies by scanning the source code files for dependency
information.
DEBUG TOOL: The debug tool helps you detect and diagnose errors in code developed using the PL/I Set for AIX compiler. The intuitive graphical user interface allows you to control execution of the program, examine and modify data (variables, storage, and registers), and perform many other useful functions.
The debug tool provides machine-level and source-level debugging. It is built around a set of core functions designed to let developers quickly and efficiently control execution, and analyze data. With these core functions, developers can:
o Display and change variables o Display and change storage o Display and change the processor registers o Display the call stack o Add and delete simple and complex breakpoints o Control the execution of multiple threads o View source code as listing, disassembly or mixed
CICS for AIX Version 2.1 transactions built with IBM PL/I Set for AIX can be debugged interactively.
LOCAL AND REMOTE DATA ACCESS: IBM PL/I Set for AIX provides the ability to write applications that support local and remote access to data including:
o The IBM SMARTdata UTILITIES (SdU) which are designed to provide record
oriented file access through standard PL/I I/O statements to
- local AIX VSAM files
- remote MVS VSAM, SAM, PDS, and PDSE files
- remote OS/400 files
- remote CICS managed VSAM files on MVS through CICS/DDM
o Support for local and remote DB2 data access using DB2 for AIX
o Support for local and remote CICS data access using CICS for AIX or CICS
Client for AIX.
http://www.ibm.com/year2000
for a list of Solution Developer tools, applications, and services offered by Solution Developers who have represented to IBM that they provide products that are Year2000 ready. These products might be useful to assist your Year2000 analysis, re-engineering, and development when reformatting your year-date notation.