A Checklist For Migrating Big Iron Cobol Applications
A Checklist For Migrating Big Iron Cobol Applications
A Checklist For Migrating Big Iron Cobol Applications
Also included is a case study that offers insights into compilation issues found when recompiling an HP Tandem COBOL program on the IBM z/ OS mainframe COBOL Enterprise compiler. The paper concludes by assessing various conversion approaches and tools. Not covered is the use of Screen COBOL (SCOBOL) language to find differences. The SCOBOL language on HP Tandem is similar to Cobol and is used to generate graphical user-based interfaces. In addition, we do not tackle embedded SQL programming.
n<= 132
Configuration Section This optional section can be used to describe the computer environment on which the program is compiled and executed. Figure 4 (on next page) compares the paragraph of the configuration section. Input-Output Section Figure 5 (on page 4) compares the paragraph of the input-output section. The function of the FILE-CONTROL paragraph is described in detail below.
Identification Division
Identification division must be the first division in each Cobol source program. It names the program, the date of compilation and other documentary information (see Figure 3, on next page).
Environment Division
Environment division is optional. It contains two sections, namely CONFIGURATION and INPUT-OUTPUT.
The Paragraph uses the SELECT clause to connect an operating system file name to Cobol file name. The various files possible along with the detailed clause such as ASSIGN, ORGANIZATION, ACCESS MODE, RECORD KEY, etc. are described. The ASSIGN clause associates the name of a file in a program with the actual external name of the data file. The #DYNAMIC used in Tandem COBOL cannot be used in Enterprise COBOL; instead an alphanumeric literal must be mentioned. During the execution of the program, a job control language (JCL) assignment by the use of data dictionary (DD) and data source name (DSN) commands takes care of assigning the external name of the file. The PASSWORD clause is present only in Enterprise COBOL which controls access to files.
Figure 6 (on page 5) summarizes the File-Entry clause for both HP Tandem COBOL and IBM z/OS Enterprise COBOL. As seen, the requirement is the same in both versions; wherever differences are present on Enterprise COBOL, they have been marked with a dark gray background. The SORT-MERGE file is not mentioned here as the handling for them is the same in both versions of Cobol dialect.
Data Division
The Data division is the place where all variables to be used in the program are defined at various levels, namely from 01-49, 66, 77 and 88. The level has similar meaning in both the HP Tandem COBOL and IBM z/OS Enterprise COBOL.
An additional clause of CHARACTERSET is present which enables it to specify the national character set defining the ALPHABETIC data class. An additional SYSTEM-NAME clause having values of CONSOLE, MYTERM, CHANNEL-1 through CHANNEL-2 is available.
The syntax is similar to HP Tandem COBOL with the absence of CHARACTERSET clause. SYSTEM-NAME clause is absent. More options available to aid in object-oriented program development.
Figure 4
The Data division is optional. It contains four optional sections on HP Tandem COBOL. FILE. WORKING-STORAGE. EXTENDED-STORAGE. LINKAGE. The EXTENDED-STORAGE section is specific to HP Tandem COBOL, wherein variables will exceed the 64KB boundary. This section is completely absent in IBM z/OS Enterprise COBOL which has a section named LOCAL-STORAGE which is not a replacement of the EXTENDED-STORAGE. Figure 7 (on page 6) describes more of the Cobol sections. The data-types of NATIVE-2, NATIVE-4 and NATIVE-8 available on HP Tandem COBOL are not available on IBM z/OS Enterprise COBOL. These data types will be replaced by corresponding signed numeric data types on IBM z/OS Enterprise COBOL. In addition, there are options for double byte character set (DBCS) type literals which are specific to IBM z/OS Enterprise COBOL.
can be found in the respective COBOL manuals (mentioned in the reference section). Declarative Section Declaratives provide one or more special-purpose sections that are executed when an exceptional condition occurs on a program file. Each declarative section starts with a USE statement that identifies the section's function. The series of procedures that follow specify the actions that are to be taken when an exception occurs. Each declarative section ends with another sectionname followed by a USE statement or with the keywords END DECLARATIVES. The USE statement has three formats in which the EXCEPTION/ERROR and DEBUGGING declaratives are similar in both HP Tandem COBOL and IBM z/OS Enterprise COBOL. The LABEL declarative is present only in Enterprise COBOL. Statements There are many statements present in HP Tandem COBOL but not on IBM z/OS Enterprise COBOL, and vice versa. They are divided into imperative and conditional types.
Procedure Division
Procedure division is the place where Cobol verbs and statements carry out the business logic determined for the program. This section details the verbs and word names only; a detailed syntax
The Paragraph is similar in both versions. The one difference is that Enterprise COBOL contains APPLY WRITE-ONLY Clause.
The Paragraph is specific to HP Tandem COBOL by which the interprocess message (IPM) communication known as $RECEIVE is enabled. The reading of $RECEIVE is not mandatory for the batch category of programs whereas its mandatory for the online category of programs that deal with user interaction.
The Paragraph is absent as the $RECEIVE concept is not available. An alternative to the online category of programs is possible by use of customer information control system (CICS) calls and IBMs message queue (MQ) mechanism.
Figure 5
program or is a conditional statement terminated by its explicit scope terminator. The following statements are available in both HP Tandem COBOL and Enterprise COBOL:
The statements present only on HP Tandem COBOL are shown in Figure 8 (on page 7). The statements present only in Enterprise COBOL:
> > > > > > > > > > > > > > > > >
ACCEPT ADD ALTER CALL CANCEL CLOSE COMPUTE CONTINUE COPY DELETE DISPLAY DIVIDE ENTER EVALUATE EXIT GOTO IF
> > > > > > > > > > > > > > > >
> >
INITIALIZE INSPECT MERGE MOVE MULTIPLY OPEN PERFORM READ RELEASE REPLACE RETURN REWRITE SEARCH SET SORT START STOP STRING
Conditional statements: The conditional statement specifies that the truth value of a condition is to be determined and that the subsequent action of the object program is dependent on this truth value. All the conditional statements present on HP Tandem COBOL are present on Enterprise COBOL. The additional ones on Enterprise COBOL are noted below.
File-Entry Clauses
CLAUSE SELECT ASSIGN RESERVE ORGANIZATION (Default SEQUENTIAL) PADDING CHARACTER RECORD DELIMITER ACCESS MODE SEQUEN- QSAM/ TIAL VSAM Required Required Optional Optional LINE SELINE SEQUENTIAL QUENTIAL Required Required Optional Optional - Line Sequential NA Not applicable NA Sequential NA RELATIVE VSAM Required Required Optional Required Relative NA NA Sequential Random Dynamic NA Optional if access mode is sequential. Required for Random and Dynamic access modes. Optional Optional Optional NA INDEXED Required Required Optional Required Indexed NA NA Sequential Random Dynamic Required NA VSAM
NA NA
NA NA
NA
NA NA Optional
Note: QSAM = Queue Sequenced Access Method, VSAM = Virtual Sequenced Access Method
Figure 6
XML GENERATE ... ON EXCEPTION XML GENERATE ... NOT ON EXCEPTION XML PARSE ... ON EXCEPTION XML PARSE ... NOT ON EXCEPTION INVOKE ... ON EXCEPTION INVOKE ... NOT ON EXCEPTION
Figurative Constants Figurative constants are reserved words that name and refer to specific constant values. The constants NULL and NULLS are available only in Enterprise COBOL and not in Tandem COBOL. All other constants are the same in both versions. Common Phrases The following phrases common to arithmetic and data manipulation statements are used similarly in both HP Tandem COBOL and Enterprise COBOL:
Reserved Words A reserved word is a character string with a predefined meaning in a Cobol source unit. In addition to the similar keywords, there are some keywords that are specific to HP Tandem COBOL and Enterprise COBOL which are mentioned in Figure 9 (on page 8). It needs to be checked in programs for conversion planning.
WORKING-STORAGE The various variables used to perform the business functionality in the program are declared and, if required, defined as well.
EXTENDED-STORAGE The section is required in case the variable size is too big to fit in the WORKINGSTORAGE section. LINKAGE The section is used in case the program is going to call and pass on parameters to other modules. LOCAL STORAGE The section is used to create recursive programs.
Not present.
The section is used to create recursive programs. The data-variables declared in this section are initialized on each invocation of the recursion, thereby insulating different instances. A program not containing this section cant be recursive and an attempt leads to run-time system error.
Figure 7
Intrinsic Functions An intrinsic function is a function that a program can use without needing to declare or code it explicitly in the program. It returns a value that is computed at the time of reference during the execution of the object program. The following intrinsic functions are available both in Enterprise COBOL and in Tandem COBOL. The functions themselves are explained in detail in their respective manuals listed under the reference:
Availability Statistics and Performance HP NonStop Tandems availability statistics and performance (ASAP) product monitors the HP Tandem operating system and application resources. The related calls can be coded in programs to gain insights into critical applications running on HP NonStop Tandem systems. This investigation enables users to plan for the infrastructure growth as required. Tivoli software can be used to measure current response times of programs running on IBM z/OS for good and bad transactions, the use of resources, amount of MQ messages and DB2 calls. Based on further investigations, a product similar to ASAP Application Performance Analyzer2 exists on the IBM platform. Transaction Management Facility The HP NonStop Tandem transaction management facility (TMF) product furnishes transaction protection, database consistency and data-
> > > > > > > > > > > > > > > > > > >
ACOS ANNUITY ASIN ATAN CHAR COS CURRENT-DATE DATE-OF-INTEGER DAY-OF-INTEGER FACTORIAL INTEGER INTEGER-OF-DATE INTEGER-OF-DAY INTEGER-PART LENGTH WHEN-COMPILED LOG LOG10 LOWER-CASE > MAX > MEAN > MEDIAN
> > > > > > > > > > > > > > > > > > > >
MIDRANGE MIN MOD NUMVAL NUMVAL-C ORD ORD-MAX ORD-MIN PRESENT-VALUE RANDOM RANGE REM REVERSE SIN SQRT STANDARDDEVIATION SUM TAN UPPER-CASE VARIANCE
The statements are used to LOCK and UNLOCK the accessibility of a file during the program execution.
The option to LOCK/UNLOCK a file exists by use of JCL statements. But the locking is applicable throughout the execution of the program and not on an as-needed basis, which is available on HP Tandem COBOL. The statement is not available. The CALL statement is used to perform the mixed-language programming.
The statement is used to perform mixed-language programming wherein sources in languages other than Cobol are called within Cobol programs.
Figure 8
base recovery critical in high-volume transaction processing. It sustains high performance for online transaction processing (OLTP) applications, as well as online query processing (OLQP) activities, batch processing applications and decision-support systems.
of a DB2 thread which encapsulates all the transactions till a COMMIT statement is used to finalize the transaction onto the database. The similar action is available on the HP Tandem COBOL by the use of TMF-based calls of BEGINTRANSACTION, ENDTRANSACTION and ABORTTRANSACTION.
Database consistency: On the IBM z/OS Enterprise COBOL, an invocation of a program unit containing DB2 leads to a starting
data file are processed only once when a process failure is identified. This is possible in both HP Tandem COBOL and IBM z/OS Enterprise COBOL by use of appropriate programming. Compiler Directives The compiler directive is the word that directs the compiler to perform a certain action when the program is being compiled to create the final runnable object. Both Cobol versions provide the option to enable this action in different manners. The directive ?SOURCE is heavily used in HP Tandem COBOL to source-in different modules or a data dictionary. An alternative for ?SOURCE is achieved by entering BASIS on the IBM z/OS Enterprise COBOL. The directives ?LIST ?NOLIST ?PAGE have similar meanings on both HP Tandem COBOL and IBM z/OS Enterprise COBOL. The processing accomplished by directives of ?CONSULT and ?SEARCH is possible on IBM z/OS Enterprise COBOL by use of JCL scripting statement of STEPLIB which enables a program to use information from a library of load modules. The directives listed below have no alternative on IBM z/OS Enterprise COBOL: HEADING, SAVE, INSPECT, SYMBOLS, ICODE, HEAP, SAVEABEND, ANSI, TANDEM, IF, ENDIF, IFNOT, SETOG PORT, NONSTOP, SECTION, NOBLANK
The suggested option is to create the specifications of the business logic which need to be migrated to IBM and then do the development of the necessary logic on IBM z/OS from scratch by use of CICS and Cobol by using MQ as the message tunnel between the user GUI and COBOL program. The rationale behind the suggested option:
Application with batch programs only: This approach works with systems heavily driven by the use of Cobol programs that provide the business logic in batch mode and where the concept of IPM is rarely used. The suggested option is to create the conversion specifications known as language conversion program (LCP) and use the CCCA tool for automated conversion. A certain minimum level of manual conversion may still be required.
> A lot of similarities exist which can be leveraged to have an automated conversion of batch programs. > An automated approach will enable enterprises to reduce the development cost.
Conclusion
Based on the investigations using a sample HP Tandem COBOL program converted into Enterprise COBOL by the use of Cobol and CICS/VS Command Level Conversion Aid (CCCA) tool, the following conclusions were reached:
Application with a combination of both types of programs: The conversion approach depends on the ratio of online to batch programs present in the application. The more online programs present in the application, the more the option suggested for online-only programs should be used. The same rationale also applies when the application is laden with batch programs and fewer online programs are present.
Application with online programs only: Such an application is heavily driven by use of SCOBOL requestor programs interacting with a Cobol server which provides the business logic.
Quick Take
Cobol Compilation at a Global Banking Major
At a Netherlands-based financial institution with worldwide operations, an exercise to check the feasibility of migrating Cobol applications from HP to IBM was performed to select a future IT platform for building current account and payment engine applications. Business Situation To identify the modifications required for ensuring correct compilation of HP Tandem COBOL on the IBM z/OS system. Challenges and Actions Taken Creating a sample Cobol program on the HP Tandem system using many of the Cobol functions, statements, etc. Ensuring correct compilation on the HP Tandem system and then aligning the code correctly for compilation using the IBM z/OS Enterprise COBOL compiler. Compile the code on the IBM z/OS system and identify the errors received and actions to overcome them.
Benefits
The following is a comprehensive table indicating the actions to be taken on treating the possible compilation errors that can occur on compiling a HP Tandem Cobol program on an IBM z/OS system. HP Tandem COBOL Code Snippet SELECT FILE1 ASSIGN TO #DYNAMIC ENTER "COBOLASSIGN" USING Errors Received Non-COBOL character(s) were found starting with "#" in column 44. The characters were discarded. "DYNAMIC" was found in the "ASSIGN" clause. The clause was discarded. Replacement in Enterprise COBOL The #DYNAMIC is not used in Enterprise COBOL; instead, an alphanumeric literal must be mentioned. During the execution of the program, a JCL assignment by use of DD and DSN commands takes care of assigning the external name of the file. The ENTER "COBOLASSIGN" statement is not required.
?NOLIST
A character other than The compiler directives must not "*", "D", "/" or "-" was start with ?. found in column 7. A blank was assumed. "NOLIST" should not begin in area "A". It was processed as if found in area "B". "NOLIST" was invalid. Scanning was resumed at the next area "A" item, level-number or the start of the next clause. "NATIVE-2" was invalid. Scan- Replace the NATIVE-2 with picture ning was resumed at the next clause PIC S9(4). area "A" item, level-number, or the start of the next clause.
02 Y NATIVE-2
10
SELECT FILE5 ASSIGN TO FILE5 ORGANIZATION IS SEQUENTIAL ACCESS MODE IS SEQUENTIAL FILE STATUS IS FST-FILE5. FD FILE5. 01 FILE5-REC. 03 FILE5-ID. 05 FIELD-5 PIC X(06). 05 TEST-9 PIC X(35). 05 TEST-10 PIC X(80). SELECT FILE1 ASSIGN TO FILE1 ORGANIZATION IS RELATIVE ACCESS MODE IS RANDOM RELATIVE KEY IS KEY-FILE1 FILE STATUS IS FST-FILE1. 01 KEY-FILE1 PIC S9(6) COMP. MOVE FUNCTION ACOS (-1) TO MF-A
The RECORDING MODE clause is mandatory option for Sequential/ QSAM files.
"RELATIVE KEY" "KEYFILE1" was not defined as an unsigned integer data item. The key was discarded.
Numeric function "NUMERIC FUNCTION ACOS" was not allowed in this context. The statement was discarded.
For Numeric and Integer Intrinsic functions, MOVE is not allowed. A COMPUTE statement must be mentioned. The subordinate data items present in the group data items must be of the same name.
MOVE CORRESPONDING No "CORRESPONDING" W-ADD-GR-1 TO W-ADD-GR-2 operands were found. ADD CORRESPONDING The statement had no effect. W-ADD-GR-1 TO W-ADD-GR-2 01 W-ADD-GR-1. 03 W-GR1 PIC 9(02). 03 W-GR2 PIC 9(02). 01 W-ADD-GR-2. 03 W-GR3 PIC 9(02). 03 W-GR4 PIC 9(02). OPEN INPUT FILE1 SHARED "SHARED" was not defined as a file-name. The statement was discarded. "GENERIC" was invalid. Skipped to the next verb, period or procedure-name definition.
The options of SHARED/PROTECTED/ EXCLUSIVE are not available in Enterprise COBOL. It needs to be taken care by use of JCL statements. The options of GENERIC, EXACT, APPROX mode to position a key to read a record are not available.
Further Steps
A more complicated program containing all the elements possible in an HP Tandem COBOL Program to be compiled on both the systems to find ways to overcome more compiler errors on the IBM z/OS system.
11
Footnotes
1
Ian Bramley, Declining HP Integrity NonStop Far Outclassed by IBM System z10 Mainframe, Enterprise e-Infrastructure Analysis, September 2009, ftp://public.dhe.ibm.com/common/ssi/rep_ wh/n/ZSL03066USEN/ZSL03066USEN.PDF. Product information, IBM site, http://www-03.ibm.com/software/products/fr/fr/apa/.
References
12
About Cognizant
Cognizant (NASDAQ: CTSH) is a leading provider of information technology, consulting, and business process outsourcing services, dedicated to helping the worlds leading companies build stronger businesses. Headquartered in Teaneck, New Jersey (U.S.), Cognizant combines a passion for client satisfaction, technology innovation, deep industry and business process expertise, and a global, collaborative workforce that embodies the future of work. With over 50 delivery centers worldwide and approximately 162,700 employees as of March 31, 2013, Cognizant is a member of the NASDAQ-100, the S&P 500, the Forbes Global 2000, and the Fortune 500 and is ranked among the top performing and fastest growing companies in the world. Visit us online at www.cognizant.com for more information.
World Headquarters
500 Frank W. Burr Blvd. Teaneck, NJ 07666 USA Phone: +1 201 801 0233 Fax: +1 201 801 0243 Toll Free: +1 888 937 3277 Email: [email protected]
European Headquarters
1 Kingdom Street Paddington Central London W2 6BD Phone: +44 (0) 207 297 7600 Fax: +44 (0) 207 121 0102 Email: [email protected]
Copyright 2013, Cognizant. All rights reserved. No part of this document may be reproduced, stored in a retrieval system, transmitted in any form or by any
means, electronic, mechanical, photocopying, recording, or otherwise, without the express written permission from Cognizant. The information contained herein is subject to change without notice. All other trademarks mentioned herein are the property of their respective owners.