A Checklist for Migrating Big Iron Cobol Applications
Total Page:16
File Type:pdf, Size:1020Kb
• Cognizant 20-20 Insights A Checklist for Migrating Big Iron Cobol Applications Migrating common business oriented language (Cobol) applications from HP NonStop Tandem systems to IBM z/OS mainframes requires detailed analysis of program structuring, variable declaration and keywords and a methodical conversion approach. Executive Summary • Environment division. CIOs facing the rising challenges of higher total • Data division. cost of operations (TCO) of HP NonStop Tandem • Procedure division. systems need to find alternatives.1 The bulk of applications created for these HP systems use Also included is a case study that offers insights the Cobol programming language. IBM z/OS into compilation issues found when recompiling mainframes provide an alternative with stability an HP Tandem COBOL program on the IBM z/ and reliability similar to the HP NonStop OS mainframe COBOL Enterprise compiler. The Tandem systems. However, migrating Cobol paper concludes by assessing various conversion applications written for HP Tandem to IBM approaches and tools. mainframes is fraught with complexity and is often time-consuming. Not covered is the use of Screen COBOL (SCOBOL) language to find differences. The SCO- This white paper delves into recent versions BOL language on HP Tandem is similar to Cobol of Cobol on both systems and provides a and is used to generate graphical user-based comprehensive listing of code differences and interfaces. In addition, we do not tackle embed- similarities. The aim is to provide all the relevant ded SQL programming. information CIOs and application developers need when considering migrating from HP Program Organization and Format Tandem to the IBM z/OS mainframe. Figure 1 (on next page) illustrates the difference between the HP Tandem and IBM Cobol reference The differences and similarities covered include: format. • Program organization and format. • Identification division. cognizant 20-20 insights | june 2013 Organization of the Two Reference Formats Tandem Reference Format IBM Reference Format Margin: CA BR1 234567 8910 11 12 13 … 71 72 Sequence Area Area A Area B Indicator Area Column: 12345678910…nxxn<= 132 Area A Area B Indicator Area Line Figure 1 The differences can be summarized as shown in Configuration Section Figure 2. This optional section can be used to describe the computer environment on which the program is Identification Division compiled and executed. Figure 4 (on next page) Identification division must be the first division compares the paragraph of the configuration in each Cobol source program. It names the pro- section. gram, the date of compilation and other docu- mentary information (see Figure 3, on next page). Input-Output Section Figure 5 (on page 4) compares the paragraph of Environment Division the input-output section. Environment division is optional. It contains two sections, namely CONFIGURATION and The function of the FILE-CONTROL paragraph is INPUT-OUTPUT. described in detail below. Summary of Differences in the Two Formats HP Tandem COBOL IBM z/OS Enterprise COBOL Number of columns where code lines are Number of columns where code lines are accepted is 72. accepted is 132. There is no area known as “Sequence Number The first six columns are taken as “Sequence Number Area” Area.” which is used to label a source statement line. The indicator area begins at column 1. It can be The indicator area begins at column 7. It can be empty or empty or it can contain a single character that it can contain a single character that describes the type of describes the type of information on the line. information on the line. ? Compiler directive * Ordinary comment * Ordinary comment / Comment for top of next page / Comment for top of next page D Debugging line D Debugging line d Debugging line d Debugging line - Continuation line - Continuation line Space Text line Space Text line There is no distinction made between Area A Specific items must begin in Area A. and Area B. • Division headers • Section headers • Paragraph headers or paragraph names • Level indicators (FD and SD) or level-numbers (01 and 77) • DECLARATIVES and END DECLARATIVES Specific items must begin in Area B. • Entries, sentences, statements and clauses • Continuation lines Figure 2 cognizant 20-20 insights 2 Identification Divisions: Defined and Compared PARAGRAPH HP Tandem COBOL IBM z/OS Enterprise COBOL PROGRAM-ID Present. Provides an optional clause of The paragraph specifies the name by which RECURSIVE to recursively enter a the program is known and assigns selected program while previous invocation program attributes to that program. is still active. AUTHOR Present and similar in both versions. Name of the author of the program. INSTALLATION Name of the company or location. DATE-WRITTEN Date the program was written. DATE-COMPILED Date the program was compiled. SECURITY Level of confidentiality of the program. Figure 3 The Paragraph uses the SELECT clause to connect Figure 6 (on page 5) summarizes the File-Entry an operating system file name to Cobol file name. clause for both HP Tandem COBOL and IBM z/OS The various files possible along with the detailed Enterprise COBOL. As seen, the requirement is clause such as ASSIGN, ORGANIZATION, ACCESS the same in both versions; wherever differences MODE, RECORD KEY, etc. are described. are present on Enterprise COBOL, they have been marked with a dark gray background. The ASSIGN clause associates the name of a file in a program with the actual external name The SORT-MERGE file is not mentioned here of the data file. The #DYNAMIC used in Tandem as the handling for them is the same in both COBOL cannot be used in Enterprise COBOL; versions of Cobol dialect. instead an alphanumeric literal must be men- tioned. During the execution of the program, a Data Division job control language (JCL) assignment by the use The Data division is the place where all variables of data dictionary (DD) and data source name to be used in the program are defined at various (DSN) commands takes care of assigning the levels, namely from 01-49, 66, 77 and 88. The external name of the file. The PASSWORD clause level has similar meaning in both the HP Tandem is present only in Enterprise COBOL which COBOL and IBM z/OS Enterprise COBOL. controls access to files. Configuration Section Paragraphs: Defined and Compared PARAGRAPH HP Tandem COBOL IBM z/OS Enterprise COBOL SOURCE-COMPUTER The syntax is similar in both the versions of Cobol. The paragraph describes the computer on which the source text is to be compiled. OBJECT-COMPUTER An additional clause of “CHARACTER- The syntax is similar to HP The paragraph specifies the SET” is present which enables it to Tandem COBOL with the system for which the object specify the national character set absence of “CHARACTER- program is designated. defining the ALPHABETIC data class. SET” clause. SPECIAL-NAMES An additional “SYSTEM-NAME” “SYSTEM-NAME” clause is The paragraph assigns user- clause having values of CONSOLE, absent. defined names to certain MYTERM, CHANNEL-1 through More options available to aid system-name parameters. CHANNEL-2 is available. in object-oriented program development. Figure 4 cognizant 20-20 insights 3 The Data division is optional. It contains four can be found in the respective COBOL manuals optional sections on HP Tandem COBOL. (mentioned in the reference section). • FILE. • WORKING-STORAGE. Declarative Section • EXTENDED-STORAGE. Declaratives provide one or more special-purpose • LINKAGE. sections that are executed when an exceptional condition occurs on a program file. Each declara- The EXTENDED-STORAGE section is specific to HP tive section starts with a USE statement that Tandem COBOL, wherein variables will exceed the identifies the section's function. The series of 64KB boundary. This section is completely absent procedures that follow specify the actions that in IBM z/OS Enterprise COBOL which has a section are to be taken when an exception occurs. Each named LOCAL-STORAGE which is not a replace- declarative section ends with another section- ment of the EXTENDED-STORAGE. Figure 7 name followed by a USE statement or with the (on page 6) describes more of the Cobol sections. keywords END DECLARATIVES. The data-types of NATIVE-2, NATIVE-4 and The USE statement has three formats in which NATIVE-8 available on HP Tandem COBOL are not the EXCEPTION/ERROR and DEBUGGING declara- available on IBM z/OS Enterprise COBOL. These tives are similar in both HP Tandem COBOL and data types will be replaced by corresponding IBM z/OS Enterprise COBOL. The LABEL declara- signed numeric data types on IBM z/OS Enter- tive is present only in Enterprise COBOL. prise COBOL. In addition, there are options for double byte character set (DBCS) type literals Statements which are specific to IBM z/OS Enterprise COBOL. There are many statements present in HP Tandem COBOL but not on IBM z/OS Enterprise COBOL, Procedure Division and vice versa. They are divided into imperative Procedure division is the place where Cobol verbs and conditional types. and statements carry out the business logic determined for the program. This section details • Imperative statements: This either specifies the verbs and word names only; a detailed syntax an unconditional action to be taken by the Input-Output Section Paragraphs: Defined and Compared PARAGRAPH HP Tandem COBOL IBM z/OS Enterprise COBOL FILE-CONTROL The Paragraph is present in both versions and is described in detail A file-control entry connects an in the text on pages 2 and 3. operating system file name to a Cobol file name, specifies the file’s organization and keys and provides additional information needed for input and output. I-O-CONTROL The Paragraph is similar in both versions. The one difference is that The optional I-O-CONTROL Enterprise COBOL contains APPLY WRITE-ONLY Clause.