Migrating Mainframe Applications to Windows Server White Paper Published: September 2006 For the latest information, please see www.microsoft.com/mainframe Abstract This paper is aimed at business professionals (CIOs and IT managers) who manage mainframe information systems and who are interested in exploring platform alternatives. This paper will provide insight and clarity into the process of mainframe modernization, with a focus on application migration. We will demonstrate how straightforward it can be to migrate applications from the mainframe to the Microsoft® Windows Server® operating system. Not every system will be this simple, but this study demonstrates the feasibility of incrementally moving workloads in addition to providing a foundation for investigating the migration of all applications. To help provide some guidelines for anticipated project benefits, we will briefly compare the resulting Windows®-based application to a mainframe application on performance, cost, and integration with current technologies. Finally, we will provide recommendations and references for additional information. Mainframe Migration Feasibility Study 1 Contents Introduction ............................................................................................................ 3 Environment ........................................................................................................... 5 Mainframe .......................................................................................................... 5 Windows Server ................................................................................................. 6 COBOL, CICS, and JCL Runtime....................................................................... 6 Application Migration Process ................................................................................ 7 The Mainframe Application ................................................................................. 7 Code Migration ................................................................................................. 10 Performance Results ........................................................................................... 12 Integration After the Migration .............................................................................. 14 Conclusion ........................................................................................................... 15 Resources ............................................................................................................ 16 Appendix A: Benchmark Data .............................................................................. 17 Appendix B: COBOL 1 Program .......................................................................... 19 Appendix C: COBOL 2 Program .......................................................................... 33 Appendix D: COBOL 3 Program .......................................................................... 35 Mainframe Migration Feasibility Study 2 Introduction In 1991, 10 gigaflops (GFLOPs) of computing power cost well over U.S. $10 million. Today, that level of computing power can be achieved by combining a few multiple-core blade servers at a cost of a few thousand dollars. In 1991, only mainframe and midrange computers used 100-gigabyte (GB) direct access storage devices (DASDs). Today, our children carry this much disk space in their coat pockets for listening to music. In 1991, networks used proprietary protocols; today, for many, the World Wide Web is available via wireless connections that use open standards. Thus, to say that the computing field has changed would be an understatement. However, how much has your mainframe system evolved since 1991? And, has it kept pace with the rest of the industry? Industry analysts recommend that if you have a mainframe under 1,000 MIPS (millions of instructions per second) you should consider migration. Moreover, each year, the reasons for mainframe migration become more compelling. Here are just a few. Finding experienced mainframe personnel is difficult and costly, and vendor support for mainframes continues to decrease. Processing costs on CMOS-based systems are higher than on Intel-based systems. The mainframe software stack is considerably more complex and outdated when compared to Windows Server®–based systems. The mainframe is the last system to be based on EBCDIC, the Extended Binary Coded Decimal Interchange Code, developed in 1963 with its roots in punch cards. Compared to TCP/IP, IBM’s systems network architecture (SNA) is disconnected in today’s world of intranet and application interoperability. All of these developments result in higher costs for companies that continue to base their applications and processes on mainframes. Although the mainframe has demonstrated worth as a robust and powerful element of computing, IT executives are now weighing alternatives. There are a number of concerns to consider when migrating from the mainframe. Primary among these are risk and cost. For example, how expensive is the conversion? Will the application perform as before? How reliable, available, and serviceable is the new platform? Will my developers be more or less productive? All of these are important questions. While the vendor ecosystem for the mainframe has waned, vendor support for Microsoft® products has become extremely robust, including support for running existing mainframe applications on Windows Server. Many tools exist that can be used to facilitate a quick and inexpensive migration to the Windows® platform. Because application migration reuses existing code, the costs can be controlled and the risk mitigated. Once on the Windows platform, these applications benefit from improved interoperability, flexibility, and decreased costs. Mainframe Migration Feasibility Study 3 To analyze these tools and practices and to develop a repeatable migration process, Information Concepts has compared and contrasted a mainframe system with a Windows-based system and this paper describes a sample migration from the mainframe to a computer running the Windows Server operating system. The system architectures are compared, the processes outlined, and the results measured. Finally, opportunities for application integration with contemporary technologies (following migration) are briefly examined. Mainframe Migration Feasibility Study 4 Environment To perform the study, Information Concepts set up two system environments: one on IBM z/OS and the other on Windows Server 2003 R2. System configurations were comparable across environments to allow the speed for a series of batch comparisons to be analyzed. Figure 1 illustrates the specifics of each environment, and a discussion of the processes follows. Figure 1. System configuration Mainframe Information Concepts established a mainframe environment for this study by using the FLEX-ES system running the z/OS operating system. FLEX-ES is a z/Architecture and System/390 compatible mainframe.1 The system was allocated 20 MIPS, with 512 MB of memory and the following IBM software installed. IBM Software Installed on the Mainframe Application z/OS DB2 CICS TS COBOL Version V1R4 V7R1 V2R2 V3R1 Virtual storage access method (VSAM) clusters were created with access method services (IDCAMS), and all files were identified using standard job control language (JCL). IDCAMS was first run to build the 250,000 record master files and then run in increments of 1,000 transactions, 5,000 transactions, 10,000 transactions, and 25,000 transactions against each master file. 1 FLEX-ES by Fundamental Software, Inc. runs as a software “plug-compatible” mainframe on Intel processors. For more information visit: www.funsoft.com. Mainframe Migration Feasibility Study 5 Windows Server Microsoft Virtual Server 2005 hosted the Windows Server 2003 Enterprise Edition operating system, with a 3 gigahertz (GHz) processor and 512 MB of RAM. The study utilized the following applications: Software Installed on the Windows Server–Based System Application SQL Server COBOL Visual Studio .NET Net Express with .NET Version 2000 V3R1 2003 4.5 Mainframes have a reputation for being highly reliable. They represent mature technology that is stable and not prone to failure. Likewise, the Windows Server operating system is designed to deliver high reliability and to support the needs of the IT professionals who manage delivery of the specified reliability service level. Although not used as part of this feasibility study, Windows Server has the following built-in reliability-related capabilities: Network load balancing. This provides failover support for IP-based applications and services that require high scalability and availability. Component load balancing. This provides dynamic load balancing of middle-tier application components. Component load balancing components balance loads over multiple nodes to enhance the availability and scalability of software applications. Server clustering. This provides failover support for applications and services that require high availability, scalability, and reliability. With clustering, organizations can link applications and data and make them available in a cluster configuration. COBOL, CICS, and JCL Runtime Micro Focus Net Express with .NET served as the integrated development environment (IDE) for recompiling and managing migrated applications on the Windows Server platform. This product offers mainframe COBOL dialect support, which allows existing mainframe applications to be reused. According to Micro Focus, Net Express with .NET “provides a complete environment for quickly building and modernizing COBOL enterprise components and business applications for Microsoft .NET, client/server platforms, and the Web.” It provides a powerful integration methodology that allows easy integration of existing and new COBOL applications with leading enterprise technologies. Key utilities of Micro Focus Net Express with .NET used in the study: Interface Mapping Toolkit Generate Client feature Micro Focus Enterprise Server Mainframe Migration Feasibility Study 6 Application Migration Process When discussing mainframe migrations, we identified four primary strategies: integration, application migration, application replacement, and evolution. The method performed in this study was an application migration: moving an entire application to the Windows Server platform. This technique involves moving, converting, recompiling, and testing the COBOL application source code and file and database data in the Windows Server environment. This process is kept simple in this feasibility study so that you can easily duplicate it at your own shop. Although the Net Express with .NET IDE and runtimes were employed for this study, vendor support for Windows is substantial and other vendor technologies exist that support COBOL runtimes. These include, but are not limited to, Fujitsu NetCOBOL and AcuCorp Extend Technologies. The mainframe code employed in this study was designed to be duplicated easily with any of these COBOL runtime products as part of your own internal proof of concept. See Appendices B, C, and D for code samples. The Mainframe Application To provide a base for comparison, the project began with the design and development of a batch COBOL application. Figures 2 and 3 show the two different development environments. The Windows-based IDE provided a significantly more productive development and testing environment over the 3270 ISPF/TSO text-based editor and mainframe-based debugger. This application employs data from the Index of Media Bureau CDBS Public Database Files available at the Federal Communications Commission Web site and is representative of moderate batch mainframe workloads. Updated daily, this data can be viewed at or downloaded from www.fcc.gov/mb/databases/cdbs. The file contains information on and the status of all television and radio station broadcast applications that are pending before the FCC. We chose this data set because it is public data that can be viewed by anyone interested in this study. Figure 2. Mainframe 3270 ISPF/TSO text-based editor. Mainframe Migration Feasibility Study Figure 3. COBOL in a Windows-based IDE. 7 The benchmark includes two steps: 1. Build master files that contain data on 250,000 broadcast applications and their associated facilities. 2. Run transactions (Add, Update, Delete) against these 250,000 records. For this test case we used the following two master files (Figure 4): Facility. A single record is contained in the Facility master file for each station (called a facility) that has filed a broadcast application. Application. A single record is contained in the Application master file for each application filed with the FCC. Original Master Files • Facility • Application Transacti on File COBOL Update Program • Add • Update • Delete Updated Master Files • Facility • Application Logs • Transaction • Error • Time Figure 4. Sample program structure. Mainframe Migration Feasibility Study 8 Both master files were created using the IBM record-oriented file system VSAM (see Appendix A for more details about this process). To accomplish this, a single COBOL program was written to perform the following two tasks (Figure 5) from each record in the file: 1. Read the facility data from the record. If the facility is not in the database, create a facility record. If the facility already exists but the data differs, update the facility record. If a delete indicator is encountered, remove the facility and any application records. 2. Read the application data from the record. If the application is not in the database, create the application record. If the application exists but the data differs, update the application record. If a delete indicator is encountered, remove the application record. The program was run on the mainframe first to build the 250,000 record master files; and then it was run in increments of 1,000, 5,000, 10,000 and 25,000 transactions against the master files. The data about a broadcast application and a series of transaction files was used to update the master file in a process normally referred to as a Master File Update. A transaction record containing a data record that encompasses each field in the master files will update the master files. Although updates primarily occur from changes to the status of an application, updates also can include changes to facility demographic data (name and address), changes to information about the broadcast application, or deletions of broadcast applications and facilities. The notable part of this process is that all the work is done in the Update and Delete modules. These modules determine whether to update the master file record from a matching transaction record or whether there is an error in the file. Mainframe Migration Feasibility Study 9 Figure 5. Sample transaction summary file Code Migration After running on the mainframe, the programs were transferred via File Transfer Protocol (FTP) to a system running Windows Server 2003. Once all files were transferred, the code was updated and recompiled and the projects were rebuilt. Some minor changes to the code were required: 1. A Micro Focus utility, instead of IDCAMS, was used to create VSAM files. 2. File definitions in the input/output section of the COBOL program were updated to point to the correct locations. 3. The function employed to time the application’s performance was altered. No other changes to this program were required for the program to run with exactly the same results it had achieved when run on the mainframe. The benchmark program was run to first build the master files and then it was run again for each transaction increment. Mainframe Migration Feasibility Study 10 Figure 6. Sample transaction log file Once again we want to reiterate that this is a simple test of feasibility. Our goal is to provide a sample application and process that you can use to validate this approach in your own shop on your own mainframe, so that you can determine your own potential savings. We understand that other factors exist, such as what to do with JCL and how to migrate job scheduling and print spooling. All these factors are important and have available solutions that need to be analyzed and addressed accordingly. However, these issues are not insurmountable. For more information, please visit: www.microsoft.com/mainframe. Mainframe Migration Feasibility Study 11 Performance Results Although the study was not designed primarily to measure performance, performance results were collected. However, time is measured differently by the two systems: The mainframe typically measures CPU time, and Windows Server typically measures elapsed time. To attempt to reconcile this difference, the benchmark process included the following steps: 1. Run the application on the mainframe with no other users. 2. Include a timer function in the program to measure elapsed time on both systems. The results are shown in figures 7 and 8. As is clear from the figures, the application ran substantially faster in the Windows Server 2003 environment. Record count Mainframe clock time Mainframe CPU time PC clock time Clock time difference 1,000 0:00:29 0:00:12 0:00:03 0:00:26 5,000 0:02:27 0:01:02 0:00:05 0:02:22 10,000 0:04:10 0:01:50 0:00:08 0:04:22 25,000 0:16:35 0:05:12 0:00:16 0:16:19 250,000 1:46:53 0:54:45 0:02:22 1:44:31 Figure 7. Recorded time difference of records processed between the mainframe and Windows Server. Clock Time by Record Processed 0:17:17 0:14:24 0:11:31 Seconds 0:08:38 Mainframe clock time 0:05:46 Windows clock time 0:02:53 0:00:00 1K 5K 10K 25K Records Processed Mainframe Migration Feasibility Study 12 Figure 8. Recorded time difference of records processed between the mainframe and Windows Server. For this study, hardware running Windows Server 2003 cost a fraction of what the mainframe hardware cost. This was not surprising given that analysts report up to a 40 percent reduction in total cost of ownership after migration. What was surprising was the performance difference. Windows Server 2003 completed the benchmark in a fraction of the time that it took the mainframe to run. We understand that this is a simple test and that if you migrated a mainframe application to Windows you would utilize a more significant Intel-based or AMD-based system. However, the results of this study demonstrate a possible significant cost savings and performance increase associated with migration. Mainframe Migration Feasibility Study 13 Integration After the Migration Conveniently, Micro Focus Net Express with .NET provides several utilities that allow for complete integration with the Windows platform and the Microsoft .NET Framework and eliminates the need for other third-party utilities. The following components were used to migrate the application from the mainframe to Windows Server: Interface Mapping Toolkit Generate Client feature Micro Focus Enterprise Server Employing solely the Net Express with .NET utilities, A COBOL Web service can be created, consumed, and exposed. In this test case, using the Interface Mapping Toolkit within Net Express with .NET, the migrated COBOL program was wrapped with a Web service and called by .NET-based applications. Figure 9. Micro Focus Interface Mapping Toolkit The Interface Mapping Toolkit first created the files required to expose the COBOL application as a Web service, including the Web Service Definition Language (WSDL) file and the appropriate mapping. During this process, the existing COBOL application was converted into a Web service to allow a new interface to be added. Once the conversion was complete, a client application was created that would construct the interface and employ the COBOL Web service. The new interface files map the data received from the client application to the expected parameters. Once the Web service was created, it was deployed to the Micro Focus Enterprise Server. Micro Focus Enterprise Server provides a scalable, managed, and high-performance transactional environment for the deployment of COBOL applications and direct COBOL Web services. For more information on Micro Focus Enterprise Server and Direct COBOL Web Services, download a white paper on the subject from: www.microfocus.com/Resources/whitepapers/index.asp. Mainframe Migration Feasibility Study 14 Conclusion This study demonstrated that the migration of a COBOL application from a mainframe to a system running Windows Server can be a simple, straightforward process. If the application had been rewritten from scratch, it would have been more difficult to ensure that the application performed correctly on the new system. But because the existing code was reused, the migration was completed with a minimum of effort and with no change to the business logic or data access code. After a COBOL application has been migrated it is much easier to support and extend to .NET-based technologies and Web services. Hiring personnel to manage and support the application also is much less difficult. And because the new system uses commodity hardware, the system can be replaced and updated as needed by in-house technicians and more supporting software products and utilities are available. With Micro Focus Net Express with .NET, COBOL applications will compile to the Microsoft intermediate language (MSIL) and run in conjunction with the Microsoft common language runtime (CLR). With this support, not only new COBOL applications but also existing COBOL applications that define many business systems can be utilized with the .NET Framework. For example, existing COBOL business logic can be reused and data access can be maintained through .NET–connected programs, and .NET Framework classes such as Windows Forms and Web Forms can be accessed from COBOL applications. Although this study was not designed specifically to compare performance, the results support the conclusion that migration to the Windows platform provides a significant boost in performance over the mainframe and at a substantially lower cost. Furthermore, the ability to interoperate with other technologies, such as the Microsoft .NET Framework and Windows SharePoint® Services, provides new opportunities. Migrated applications can connect to software and services across individual platforms and also connect to other applications and programming languages in a modern computing environment. As Windows-based technologies continue to thrive and advance, the mainframe will continue to become a costly burden to your organization. The results of this feasibility study illustrate that COBOL application migration from the mainframe is feasible and should be considered when looking at reducing the total cost of application ownership. Mainframe Migration Feasibility Study 15 Resources Information Concepts www.infoconcepts.com (703) 796-0005 Information Concepts Mainframe Migration Practice brings together expertise from the industry’s leading firms to provide customers with a provable strategy to move applications off of the mainframe onto today's affordable and supportable technology. Micro Focus International www.microfocus.com/Solutions/LiftandShift Micro Focus’s Lift and Shift solution enables customers to migrate mainframe applications by providing a mainframe compatible environment on Windows, UNIX, and Linux. Microsoft Mainframe Migration www.microsoft.com/mainframe Here you will find information about reasons for migrating as well as tools and companies that aid businesses with mainframe modernization. Introduction to the Microsoft Enterprise Platform for Mainframe Professionals www.microsoft.com/technet/itsolutions/cits/interopmigration/mainframe/msepmp.mspx This book introduces Microsoft enterprise computing capabilities and compares them to mainframe technology. It also describes how the Microsoft Windows platform can be an effective alternative to the mainframe environment. Mainframe Operations Framework (MOF) www.microsoft.com/mof The Microsoft Operations Framework (MOF) provides operational guidance that enables organizations to achieve mission-critical system reliability, availability, supportability, and manageability of Microsoft products and technologies. With MOF guidance, you will be able to assess your current IT service management maturity, prioritize your processes of greatest concern, and apply proven principles and best practices to your platform. Mainframe Migration Alliance www.mainframemigration.org www.mainframemigration.org/ShowPartner.aspx?PartnerID=207 The Mainframe Migration Alliance (MMA) is a group of companies that are working together to help customers migrate workloads off of the mainframe and onto the Microsoft platform. The Alliance represents a group of companies that have their interests aligned in making mainframe modernization easier and more efficient for customers. Mainframe Migration Feasibility Study 16 Appendix A Benchmark Data The benchmark uses the Application Status Data File from the Federal Communications Commission (FCC). This file provides updated information on all FCC broadcast applications, including new filings, changes, and amendments. At the time that the benchmark was run, the file contained 250,000 records. The application status data file is representative of many mainframe applications, in which a single transaction record is used to derive different types of data. In this benchmark, facilities (stations) may have many broadcast applications. A transaction record exists for each broadcast application but also may contain new or updated facility data as well as details about the status of the application. The benchmark is a COBOL program that divides the records into two VSAM files: 1. Facility file—contains data about a station or facility. 2. Application file—contains data about each application. Applications are linked to facilities by call sign—by Facility Call Sign in the Facility file and Application Call Sign in the Application file. The following is a brief summary of how each transaction record was processed. Updates to the Facility file: o If the facility does not exist in the Facility file, a record is added to the Facility file. o If the facility does exist in the Facility file, but the data is different from the data in the transaction record and the update date in the transaction record is greater than the last updated date in the Facility file, then the Facility file is updated. o If DELETE_IND equals 2, the facility is deleted from the Facility file and all applications for that facility are removed from the Application file. Updates to the Application file: o If the application does not exist in the Application file, a record is added to the Application file. o If the application does exist in the Application file, but the data is different from the data in the transaction record and the update date in the transaction record is greater than the last updated date in the Application file, then the record in the Application file is updated. o If the DELETE_IND equals 1, that application is deleted from the Application file. Mainframe Migration Feasibility Study 17 A series of business rules have been imposed on the processing of this data. Here is a brief summary: If the Application Status Date is missing, the date is set to the first day of the current month. A VSAM file called Lookup contains valid data values for data in the transaction record: Application Type Type Code in Lookup = APPTP Application File Prefix Type Code in Lookup = APPFP Facility State Code Type Code in Lookup = STATE Facility Market State Code = STATE Facility Country Code Type Code in Lookup Type Code in Lookup = CNTRY The following fields in the transaction record may not be blank. Facility Call Sign Application Number Application Paper File Indicator If the transaction record fails any of the validation criteria listed above, no updates will be made for that record, the record will be written to an error file, and the reason for the failure will be written to a log file. When a transaction record passes validation and is added to or updated in either VSAM file, the current date will be placed in the Last Updated Date field of the appropriate file in the format YYYY-MM-DD. When processing is complete, the following data is written to the log: Starting Date (YYYY-MM-DD) and Time (HH:MM:SS). Number of records processed in the Transaction file. Number of records written to the Error file. Number of records added to, updated, and deleted from the Application file. Number of records added to, updated, and deleted from the Facility file. Ending Date (YYYY-MM-DD) and Time (HH:MM:SS). Mainframe Migration Feasibility Study 18 Appendix B COBOL 1 Program IDENTIFICATION DIVISION. PROGRAM-ID. COB1. AUTHOR INFORMATION CONCEPTS. DATE-WRITTEN. 1/18/2006. DATE-COMPILED. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SOURCE-COMPUTER. IBM-390. OBJECT-COMPUTER. IBM-390. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT FACL-FILE ASSIGN TO FACL ORGANIZATION IS INDEXED ACCESS MODE IS RANDOM RECORD KEY IS FAC-CALLSIGN STATUS FACL-ST. SELECT APPL-FILE ASSIGN TO APPL ORGANIZATION IS INDEXED ACCESS MODE IS DYNAMIC RECORD KEY IS APP-ARN ALTERNATE RECORD KEY IS APP-CALLSIGN DUPLICATES STATUS APPL-ST. SELECT LOKP-FILE ASSIGN TO LOKP ORGANIZATION IS INDEXED ACCESS MODE IS RANDOM RECORD KEY IS LOKP-KEY STATUS LOKP-ST. SELECT TRNX-FILE ASSIGN TO TRNX. SELECT TR-ERR-FILE ASSIGN TO TRERR. SELECT TR-LOG-FILE ASSIGN TO TRLOG. SELECT TR-TIME-FILE ASSIGN TO TRTIME. DATA DIVISION. FILE SECTION. FD FACL-FILE. 01 FACL-REC. 05 FAC-CALLSIGN 05 FAC-ADDRESS1 05 FAC-ADDRESS2 05 FAC-CITY 05 FAC-STATE 05 FAC-COUNTRY 05 FAC-FREQUENCY 05 FAC-MART-CITY 05 FAC-MART-ST-CD 05 FAC-UPDATE-DATE FD APPL-FILE. 01 APPL-REC. 05 APP-ARN 05 APP-CALLSIGN 05 APP-TYPE 05 APP-FI-PREFIX 05 APP-PAP-FI-IND 05 APP-STATUS-DATE 05 APP-UPDATE-DATE 05 APP-FILLER FD LOKP-FILE. 01 LOKP-REC. 05 LOKP-KEY. 10 LOKP-TYPE 10 LOKP-CODE 05 LOKP-VALUE Mainframe Migration Feasibility Study PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC X(10). X(35). X(35). X(25). X(02). X(05). X(10). X(25). X(02). X(08). PIC PIC PIC PIC PIC PIC PIC PIC X(10). X(10). X(10). X(08). X(01). X(08). X(08). X(25). PIC X(05). PIC X(05). PIC X(62). 00001000 00002000 00003000 00004000 00005000 00006000 00007000 00008000 00009000 00010000 00011000 00012000 00013000 00014000 00015000 00016000 00017000 00018000 00019000 00020000 00021000 00022000 00023000 00024000 00025000 00026000 00027000 00028000 00029000 00030000 00031000 00032000 00033000 00034000 00035000 00036000 00037000 00038000 00039000 00040000 00041000 00042000 00043000 00044000 00045000 00046000 00047000 00048000 00049000 00050000 00051000 00052000 00053000 00054000 00055000 00056000 00057000 00058000 00059000 00060000 00061000 00062000 00063000 00064000 00065000 00066000 19 FD TRNX-FILE. 01 TRNX-REC. 05 TR-APP-ARN PIC X(10). 05 TR-APP-TYPE. 10 TR-APP-TYPE-1 PIC X(05). 10 TR-APP-TPYE-2 PIC X(05). 05 TR-APP-FI-PREFIX. 10 TR-APP-FI-PREFIX-1 PIC X(05). 10 TR-APP-FI-PREFIX-2 PIC X(03). 05 TR-APP-PAP-FI-IND PIC X(01). 88 VALID-APP-PAP-FI-IND VALUE 'Y' 'N'. 05 TR-APP-STATUS-DATE. 10 TR-APP-STATUS-YYYY PIC X(04). 88 VALID-APP-STATUS-YYYY VALUE '1950' THRU '2006'. 10 TR-APP-STATUS-MONTH PIC X(02). 88 VALID-APP-STATUS-MONTH VALUE '01' THRU '12'. 10 TR-APP-STATUS-DD PIC X(02). 88 VALID-APP-STATUS-DD VALUE '01' THRU '31'. 05 TR-CALLSIGN PIC X(10). 05 TR-FAC-ADDRESS1 PIC X(35). 05 TR-FAC-ADDRESS2 PIC X(35). 05 TR-FAC-CITY PIC X(25). 05 TR-FAC-STATE PIC X(02). 05 TR-FAC-COUNTRY PIC X(05). 05 TR-FAC-FREQUENCY PIC X(10). 05 TR-FAC-MART-CITY PIC X(25). 05 TR-FAC-MART-ST-CD PIC X(02). 05 TR-DELETE-IND PIC X(01). 88 VALID-DELETE-REC-CODE VALUE '1' '2' ' '. 88 DELETE-REC-CODE VALUE '1' '2'. 05 FILLER PIC X(02). FD TR-ERR-FILE. 01 TR-ERR-REC. 05 ER-APP-ARN 05 ER-APP-TYPE 05 ER-APP-FI-PREFIX 05 ER-APP-PAP-FI-IND 05 ER-APP-STATUS-DATE 05 ER-CALLSIGN 05 ER-FAC-ADDRESS1 05 ER-FAC-ADDRESS2 05 ER-FAC-CITY 05 ER-FAC-STATE 05 ER-FAC-COUNTRY 05 ER-FAC-FREQUENCY 05 ER-FAC-MART-CITY 05 ER-FAC-MART-ST-CD 05 ER-DELETE-IND 05 FILLER PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC FD TR-LOG-FILE. 01 TR-LOG-REC. 05 TR-LOG-LINE PIC X(100). FD TR-TIME-FILE. 01 TR-TIME-REC. 05 TT-APP-ARN 05 05 TT-ST-TIME 05 05 TT-END-TIME 05 TT-EXEC-TIME 05 TT-CUMM-TIME 05 PIC PIC PIC PIC PIC PIC PIC PIC WORKING-STORAGE SECTION. 77 LILIAN 77 FORMATTED-DATE * ******* DATE & TIME AREA Mainframe Migration Feasibility Study X(10). X(10). X(08). X(01). X(08). X(10). X(35). X(35). X(25). X(02). X(05). X(10). X(25). X(02). X(01). X(02). X(10). X(02). 9(08). X(04). 9(08). ZZZZZZZ9. ZZZZZZZ9. X(02). PIC S9(9) COMP. PIC X(80). 00067000 00068000 00069000 00070000 00071000 00072000 00073000 00074000 00075000 00076000 00077000 00078000 00079000 00080000 00081000 00082000 00083000 00084000 00085000 00086000 00087000 00088000 00089000 00090000 00091000 00092000 00093000 00094000 00095000 00096000 00097000 00098000 00099000 00100000 00101000 00102000 00103000 00104000 00105000 00106000 00107000 00108000 00109000 00110000 00111000 00112000 00113000 00114000 00115000 00116000 00117000 00118000 00119000 00120000 00121000 00122000 00123000 00124000 00125000 00126000 00127000 00128000 00129000 00130000 00131000 00132000 00133000 00134000 00135000 00136000 00137000 20 * 01 01 * 01 CHRDATE. 05 CHRDATE-LENGTH 05 CHRDATE-STRING PIC S9(4) COMP VALUE 10. PIC X(10). PICSTR. 05 PICSTR-LENGTH 05 PICSTR-STRING PIC PIC CHRTIME. 05 CHRTIME-LENGTH 05 CHRTIME-STRING PIC S9(4) COMP VALUE 10. PIC X(10). S9(4) COMP. X(80). ******* DATE & TIME AREA 01 WS-DATE-AREA. 05 YYYYMMDD PIC 9(08). 05 REDEFINES YYYYMMDD. 10 CUR-YYYY PIC 9999. 10 CUR-MONTH PIC 99. 10 CUR-DD PIC 99. * 01 WS-TIME. 05 ST-JOB-TIME PIC 9(08) 05 REDEFINES ST-JOB-TIME. 10 BEG-HH PIC 9(02). 10 BEG-MM PIC 9(02). 10 BEG-SSSS PIC 9(04). 05 END-JOB-TIME PIC 9(08) 05 REDEFINES END-JOB-TIME. 10 EOJ-HH PIC 9(02). 10 EOJ-MM PIC 9(02). 10 EOJ-SSSS PIC 9(04). 05 ST-TR-TIME PIC 9(08) 05 END-TR-TIME PIC 9(08) **** 05 WS-TR-EXEC-TIME PIC 9(08) COMP 05 WS-TR-EXEC-TIME PIC 9(03) 05 WS-CUMM-TIME PIC 9(08) COMP 01 * 01 01 VALUE 0. VALUE 0. VALUE 0. VALUE 0. VALUE 0. VALUE 0. VALUE 0. WS-APP-STATUS-DATE-AREA. 05 WS-APP-STATUS-DATE. 10 APP-YYYY PIC 9999. 10 APP-MONTH PIC 99. 10 APP-DD PIC 99. 05 WS-ALT-APP-STATUS-DATE. 10 ALT-YYYY PIC 9999. 10 ALT-MONTH PIC 99. 10 ALT-DD PIC 99. WS-SWITCHES. 05 EOF-SW PIC XXX 05 EOF-FACL-IN-APPL PIC XXX 88 NO-MORE-FACL-IN-APPL 88 MORE-FACL-IN-APPL 05 FACL-REC-FOUND PIC XXX 88 FACL-FOUND 88 FACL-NOT-FOUND 05 APPL-REC-FOUND PIC XXX 88 APPL-FOUND 88 APPL-NOT-FOUND 05 LOKP-REC-FOUND PIC XXX 88 LOKP-FOUND 88 LOKP-NOT-FOUND 05 TR-GOOD-REC-IND PIC XXX 88 TR-GOOD-REC 88 TR-ERROR-REC WS-FILE-STATUS. 05 APPL-ST 05 FACL-ST 05 LOKP-ST 05 TRANS-ID Mainframe Migration Feasibility Study PIC PIC PIC PIC VALUE SPACES. VALUE SPACES. VALUE 'YES'. VALUE 'NO'. VALUE SPACES. VALUE 'YES'. VALUE 'NO'. VALUE SPACES. VALUE 'YES'. VALUE 'NO'. VALUE SPACES. VALUE 'YES'. VALUE 'NO'. VALUE SPACES. VALUE 'YES'. VALUE 'NO'. 99 VALUE 0. 99 VALUE 0. 99 VALUE 0. X(3) VALUE SPACES. 00138000 00139000 00140000 00141000 00142000 00143000 00144000 00145000 00146000 00147000 00148000 00149000 00150000 00151000 00152000 00153000 00154000 00155000 00156000 00157000 00158000 00159000 00160000 00161000 00162000 00163000 00164000 00165000 00166000 00167000 00168000 00169000 00170000 00171000 00172000 00173000 00174000 00175000 00176000 00177000 00178000 00179000 00180000 00181000 00182000 00183000 00184000 00185000 00186000 00187000 00188000 00189000 00190000 00191000 00192000 00193000 00194000 00195000 00196000 00197000 00198000 00199000 00200000 00201000 00202000 00203000 00204000 00205000 00206000 00207000 00208000 21 01 01 01 WS-REC-COUNTS. 05 WS-TR-READ 05 WS-TR-GOOD 05 WS-TR-ERROR 05 WS-APPL-ADD 05 WS-APPL-UPDATE 05 WS-APPL-DELETE 05 WS-FACL-ADD 05 WS-FACL-UPDATE 05 WS-FACL-DELETE 05 WS-APPL-UPDT-SKIP 05 WS-FACL-UPDT-SKIP PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC WS-LOG-LINE. 05 WS-LOG-AMOUNT 05 WS-LOG-MESSAGE 05 PIC ZZ,ZZZ,ZZ9. PIC X(50). PIC X(40) VALUE SPACES. WS-BEG-LOG-LINE. 05 05 WS-BEG-JOB-DATE. 10 WS-BEG-JOB-YYYY 10 10 WS-BEG-JOB-MONTH 10 10 WS-BEG-JOB-DD PIC PIC PIC PIC PIC PIC VALUE WS-BEG-JOB-TIME. 10 WS-BEG-JOB-HH 10 10 WS-BEG-JOB-MM 10 10 WS-BEG-JOB-SSSS PIC PIC PIC PIC PIC PIC 05 01 WS-END-LOG-LINE. 05 05 WS-END-JOB-DATE. 10 WS-END-JOB-YYYY 10 10 WS-END-JOB-MONTH 10 10 WS-END-JOB-DD PIC PIC PIC PIC PIC PIC VALUE WS-END-JOB-TIME. 10 WS-END-JOB-HH 10 10 WS-END-JOB-MM 10 10 WS-END-JOB-SSSS 05 01 WS-LOG-ERR-LINE. 05 WS-LEL-APP-ARN 05 05 WS-LEL-APP-TYPE 05 05 WS-LEL-APP-PRFX 05 05 WS-LEL-TR-COUNT 05 05 WS-LEL-TR-ER-COUNT 05 05 WS-LEL-FIELD 05 05 WS-LEL-REASON Mainframe Migration Feasibility Study VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE +0. +0. +0. +0. +0. +0. +0. +0. +0. +0. +0. 9999. X VALUE '-'. 99. X VALUE '-'. 99. X(11) ', AND TIME '. 99. X 99. X 9999. X(06) VALUE ':'. VALUE ':'. VALUE SPACES. PIC X(13) VALUE ' ENDING DATE '. 05 05 COMP COMP COMP COMP COMP COMP COMP COMP COMP COMP COMP PIC X(13) VALUE ' START DATE '. 05 05 S9(7) S9(7) S9(7) S9(7) S9(7) S9(7) S9(7) S9(7) S9(7) S9(7) S9(7) PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC 9999. X VALUE '-'. 99. X VALUE '-'. 99. X(11) ', AND TIME '. 99. X 99. X 9999. X(06) VALUE ':'. VALUE ':'. VALUE SPACES. X(10). X(02). X(05). X(02). X(05). X(01). ZZ,ZZZ,ZZ9. X(01). ZZ,ZZZ,ZZ9. X(02). X(20). X(02). X(30). 00209000 00210000 00211000 00212000 00213000 00214000 00215000 00216000 00217000 00218000 00219000 00220000 00221000 00222000 00223000 00224000 00225000 00226000 00227000 00228000 00229000 00230000 00231000 00232000 00233000 00234000 00235000 00236000 00237000 00238000 00239000 00240000 00241000 00242000 00243000 00244000 00245000 00246000 00247000 00248000 00249000 00250000 00251000 00252000 00253000 00254000 00255000 00256000 00257000 00258000 00259000 00260000 00261000 00262000 00263000 00264000 00265000 00266000 00267000 00268000 00269000 00270000 00271000 00272000 00273000 00274000 00275000 00276000 00277000 00278000 00279000 22 01 WS-ER-REASONS. 05 WS-ER-INV-FORMAT 05 05 01 01 01 PIC X(30) VALUE 'INVALID FORMAT'. WS-ER-MIS-REQ-FLD PIC X(30) VALUE 'REQUIRED FIELD IS MISSING.'. WS-ER-NOT-IN-LOOKUP PIC X(30) VALUE 'DOES NOT MATCH LOOKUP VALUE'. TR-LOG-HEADER. 05 05 05 05 05 05 05 05 05 05 05 05 05 PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC X(10) X(02) X(05) X(02) X(05) X(01) x(10) X(01) x(10) X(02) X(20) X(02) X(30) VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE 'APP ARN '. SPACES. spaces. SPACES. spaces. SPACES. 'Input Rec#'. SPACES. 'Error Rec#'. SPACES. 'Field with Error'. SPACES. 'Reason for Error'. TR-TIME-HEADER-1. 05 05 05 05 05 05 05 05 05 05 PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC X(10) X(02) X(08) X(04) X(08) X(04) X(04) X(04) X(04) X(02) VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE 'APP ARN '. SPACES. 'REC ST '. SPACES. 'REC END '. SPACES. 'TIME'. SPACES. 'JOB '. SPACES. TR-TIME-HEADER-2. 05 05 05 05 05 05 05 05 05 05 PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC X(10) X(02) X(08) X(04) X(08) X(04) X(04) X(04) X(04) X(02) VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE SPACES. SPACES. 'HHMMSSth'. SPACES. 'HHMMSSth'. SPACES. 'SSth'. SPACES. 'SSth'. SPACES. PROCEDURE DIVISION. 0000-MAIN. PERFORM 1000-OPEN-FILES THRU 1000-OPEN-FILES-EXIT. PERFORM 2000-PROCESS THRU 2000-PROCESS-EXIT. PERFORM 9000-CLOSE-PARA THRU 9000-CLOSE-PARA-EXIT. GOBACK. 0000-MAIN-EXTT. EXIT. * 1000-OPEN-FILES. OPEN I-O FACL-FILE. DISPLAY 'FA OPEN STATUS ' FACL-ST. OPEN I-O APPL-FILE. DISPLAY 'AP OPEN STATUS ' APPL-ST. OPEN INPUT LOKP-FILE. DISPLAY 'LK OPEN STATUS ' LOKP-ST. OPEN INPUT TRNX-FILE. OPEN OUTPUT TR-ERR-FILE TR-LOG-FILE Mainframe Migration Feasibility Study 00280000 00281000 00282000 00283000 00284000 00285000 00286000 00287000 00288000 00289000 00290000 00291000 00292000 00293000 00294000 00295000 00296000 00297000 00298000 00299000 00300000 00301000 00302000 00303000 00304000 00305000 00306000 00307000 00308000 00309000 00310000 00311000 00312000 00313000 00314000 00315000 00316000 00317000 00318000 00319000 00320000 00321000 00322000 00323000 00324000 00325000 00326000 00327000 00328000 00329000 00330000 00331000 00332000 00333000 00334000 00335000 00336000 00337000 00338000 00339000 00340000 00341000 00342000 00343000 00344000 00345000 00346000 00347000 00348000 00349000 00350000 23 TR-TIME-FILE. 1000-OPEN-FILES-EXIT. EXIT. 2000-PROCESS. PERFORM 8000-INIT-RT THRU 8000-INIT-RT-EXIT. PERFORM 3000-READ-TRNX THRU 3000-READ-TRNX-EXIT UNTIL EOF-SW = 'YES' PERFORM 8500-SUMMARY-RT THRU 8500-SUMMARY-RT-EXIT. 2000-PROCESS-EXIT. EXIT. 3000-READ-TRNX. ACCEPT ST-TR-TIME FROM TIME. * DISPLAY 'ST OF TRANS PROC, TIME ' ST-TR-TIME. READ TRNX-FILE AT END MOVE 'YES' TO EOF-SW GO TO 3000-READ-TRNX-EXIT. MOVE 'YES' TO TR-GOOD-REC-IND. ADD +1 TO WS-TR-READ. PERFORM 4500-DATA-VALADITION THRU 4500-DATA-VALADITION-EXIT. IF TR-GOOD-REC IF DELETE-REC-CODE PERFORM 4400-PROCESS-DELETE THRU 4400-PROCESS-DELETE-EXIT ELSE PERFORM 4100-READ-FACL THRU 4100-READ-FACL-EXIT PERFORM 4200-READ-APPL THRU 4200-READ-APPL-EXIT END-IF END-IF. IF TR-GOOD-REC ADD +1 TO WS-TR-GOOD. PERFORM 8100-TR-END-TIME THRU 8100-TR-END-TIME-EXIT. 3000-READ-TRNX-EXIT. EXIT. * 4100-READ-FACL. MOVE TR-CALLSIGN TO FAC-CALLSIGN. MOVE SPACES TO FACL-REC-FOUND. READ FACL-FILE KEY IS FAC-CALLSIGN INVALID KEY MOVE 'NO' TO FACL-REC-FOUND PERFORM 5100-PROCESS-FACL THRU 5100-PROCESS-FACL-EXIT GO TO 4100-READ-FACL-EXIT. * DISPLAY 'VALID KEY STATUS ' FACL-ST. MOVE 'YES' TO FACL-REC-FOUND. *tmp IF WS-APP-STATUS-DATE > FAC-UPDATE-DATE PERFORM 5100-PROCESS-FACL THRU 5100-PROCESS-FACL-EXIT. *tmp ELSE * DISPLAY 'FACL UPDATE SKIP - DATE ' *tmp ADD +1 TO WS-FACL-UPDT-SKIP. 4100-READ-FACL-EXIT. EXIT. * 4200-READ-APPL. MOVE TR-APP-ARN TO APP-ARN. MOVE SPACES TO APPL-REC-FOUND. READ APPL-FILE KEY IS APP-ARN INVALID KEY Mainframe Migration Feasibility Study 00351000 00352000 00353000 00354000 00355000 00356000 00357000 00358000 00359000 00360000 00361000 00362000 00363000 00364000 00365000 00366000 00367000 00368000 00369000 00370000 00371000 00372000 00373000 00374000 00375000 00376000 00377000 00378000 00379000 00380000 00381000 00382000 00383000 00384000 00385000 00386000 00387000 00388000 00389000 00390000 00391000 00392000 00393000 00394000 00395000 00396000 00397000 00398000 00399000 00400000 00401000 00402000 00403000 00404000 00405000 00406000 00407000 00408000 00409000 00410000 00411000 00412000 00413000 00414000 00415000 00416000 00417000 00418000 00419000 00420000 00421000 24 MOVE 'NO' TO APPL-REC-FOUND PERFORM 5200-PROCESS-APPL THRU 5200-PROCESS-APPL-EXIT GO TO 4200-READ-APPL-EXIT. **** DISPLAY 'VALID KEY STATUS ' APPL-ST. MOVE 'YES' TO APPL-REC-FOUND. *tmp IF WS-APP-STATUS-DATE > APP-UPDATE-DATE PERFORM 5200-PROCESS-APPL THRU 5200-PROCESS-APPL-EXIT. *tmp ELSE * DISPLAY 'APPL UPDATE SKIP - DATE ' *tmp ADD +1 TO WS-APPL-UPDT-SKIP. 4200-READ-APPL-EXIT. EXIT. * 4400-PROCESS-DELETE. EVALUATE TR-DELETE-IND WHEN '1' PERFORM 6700-READ-APPL THRU 6700-READ-APPL-EXIT IF APPL-FOUND DELETE APPL-FILE ADD +1 TO WS-APPL-DELETE END-IF WHEN '2' PERFORM 6700-READ-APPL THRU 6700-READ-APPL-EXIT IF APPL-FOUND DELETE APPL-FILE ADD +1 TO WS-APPL-DELETE END-IF PERFORM 6600-READ-FACL THRU 6600-READ-FACL-EXIT IF FACL-FOUND DELETE FACL-FILE ADD +1 TO WS-FACL-DELETE PERFORM 6800-READ-APPL-SEC THRU 6800-READ-APPL-SEC-EXIT IF APPL-FOUND MOVE SPACES TO EOF-FACL-IN-APPL PERFORM 5400-FACL-IN-APPL THRU 5400-FACL-IN-APPL-EXIT UNTIL NO-MORE-FACL-IN-APPL END-IF END-IF WHEN OTHER DISPLAY 'INVALID TRANSACTION - WHEN DELETE' MOVE 'NO' TO TR-GOOD-REC-IND END-EVALUATE. 4400-PROCESS-DELETE-EXIT. EXIT. 4500-DATA-VALADITION. IF TR-APP-ARN EQUAL SPACES MOVE SPACES TO MOVE 'APP ARN' TO MOVE WS-ER-MIS-REQ-FLD TO PERFORM 7100-LOG-ERR THRU 7100-LOG-ERR-EXIT END-IF. IF TR-CALLSIGN EQUAL SPACES MOVE SPACES TO MOVE 'CALLSIGN' TO MOVE WS-ER-MIS-REQ-FLD TO PERFORM 7100-LOG-ERR THRU 7100-LOG-ERR-EXIT END-IF. IF NOT VALID-APP-PAP-FI-IND Mainframe Migration Feasibility Study WS-LOG-ERR-LINE WS-LEL-FIELD WS-LEL-REASON WS-LOG-ERR-LINE WS-LEL-FIELD WS-LEL-REASON 00422000 00423000 00424000 00425000 00426000 00427000 00428000 00429000 00430000 00431000 00432000 00433000 00434000 00435000 00436000 00437000 00438000 00439000 00440000 00441000 00442000 00443000 00444000 00445000 00446000 00447000 00448000 00449000 00450000 00451000 00452000 00453000 00454000 00455000 00456000 00457000 00458000 00459000 00460000 00461000 00462000 00463000 00464000 00465000 00466000 00467000 00468000 00469000 00470000 00471000 00472000 00473000 00474000 00475000 00476000 00477000 00478000 00479000 00480000 00481000 00482000 00483000 00484000 00485000 00486000 00487000 00488000 00489000 00490000 00491000 00492000 25 MOVE SPACES TO WS-LOG-ERR-LINE MOVE 'APP PAP FILE IND' TO WS-LEL-FIELD MOVE WS-ER-INV-FORMAT TO WS-LEL-REASON PERFORM 7100-LOG-ERR THRU 7100-LOG-ERR-EXIT END-IF. IF NOT VALID-DELETE-REC-CODE MOVE SPACES TO WS-LOG-ERR-LINE MOVE 'DELETE IND' TO WS-LEL-FIELD MOVE WS-ER-INV-FORMAT TO WS-LEL-REASON PERFORM 7100-LOG-ERR THRU 7100-LOG-ERR-EXIT END-IF. IF TR-FAC-ADDRESS1 EQUAL SPACES MOVE SPACES TO WS-LOG-ERR-LINE MOVE 'ADDRESS1' TO WS-LEL-FIELD MOVE WS-ER-MIS-REQ-FLD TO WS-LEL-REASON PERFORM 7100-LOG-ERR THRU 7100-LOG-ERR-EXIT END-IF. IF TR-FAC-CITY EQUAL SPACES MOVE SPACES TO WS-LOG-ERR-LINE MOVE 'CITY' TO WS-LEL-FIELD MOVE WS-ER-MIS-REQ-FLD TO WS-LEL-REASON PERFORM 7100-LOG-ERR THRU 7100-LOG-ERR-EXIT END-IF. IF TR-FAC-FREQUENCY EQUAL SPACES MOVE SPACES TO WS-LOG-ERR-LINE MOVE 'FREQUENCY' TO WS-LEL-FIELD MOVE WS-ER-MIS-REQ-FLD TO WS-LEL-REASON PERFORM 7100-LOG-ERR THRU 7100-LOG-ERR-EXIT END-IF. IF TR-APP-STATUS-DATE EQUAL SPACES MOVE WS-ALT-APP-STATUS-DATE TO WS-APP-STATUS-DATE ELSE IF (VALID-APP-STATUS-YYYY AND VALID-APP-STATUS-MONTH AND VALID-APP-STATUS-DD) MOVE TR-APP-STATUS-DATE TO WS-APP-STATUS-DATE ELSE MOVE SPACES TO WS-LOG-ERR-LINE MOVE 'APP STATUS DATE' TO WS-LEL-FIELD MOVE WS-ER-INV-FORMAT TO WS-LEL-REASON PERFORM 7100-LOG-ERR THRU 7100-LOG-ERR-EXIT END-IF END-IF. * MOVE 'APPTP' TO LOKP-TYPE. MOVE TR-APP-TYPE-1 TO LOKP-CODE. PERFORM 6500-READ-LOKP THRU 6500-READ-LOKP-EXIT. IF LOKP-NOT-FOUND MOVE SPACES TO WS-LOG-ERR-LINE MOVE LOKP-CODE TO WS-LEL-APP-TYPE MOVE 'APP TYPE' TO WS-LEL-FIELD MOVE WS-ER-NOT-IN-LOOKUP TO WS-LEL-REASON PERFORM 7100-LOG-ERR THRU 7100-LOG-ERR-EXIT END-IF. MOVE 'APPFP' TO LOKP-TYPE. MOVE TR-APP-FI-PREFIX TO LOKP-CODE. PERFORM 6500-READ-LOKP THRU 6500-READ-LOKP-EXIT. IF LOKP-NOT-FOUND MOVE SPACES TO WS-LOG-ERR-LINE MOVE LOKP-CODE TO WS-LEL-APP-PRFX Mainframe Migration Feasibility Study 00493000 00494000 00495000 00496000 00497000 00498000 00499000 00500000 00501000 00502000 00503000 00504000 00505000 00506000 00507000 00508000 00509000 00510000 00511000 00512000 00513000 00514000 00515000 00516000 00517000 00518000 00519000 00520000 00521000 00522000 00523000 00524000 00525000 00526000 00527000 00528000 00529000 00530000 00531000 00532000 00533000 00534000 00535000 00536000 00537000 00538000 00539000 00540000 00541000 00542000 00543000 00544000 00545000 00546000 00547000 00548000 00549000 00550000 00551000 00552000 00553000 00554000 00555000 00556000 00557000 00558000 00559000 00560000 00561000 00562000 00563000 26 MOVE 'APP PREFIX' TO WS-LEL-FIELD MOVE WS-ER-NOT-IN-LOOKUP TO WS-LEL-REASON PERFORM 7100-LOG-ERR THRU 7100-LOG-ERR-EXIT END-IF. MOVE 'STATE' TO LOKP-TYPE. MOVE TR-FAC-STATE TO LOKP-CODE. PERFORM 6500-READ-LOKP THRU 6500-READ-LOKP-EXIT. IF LOKP-NOT-FOUND MOVE SPACES TO WS-LOG-ERR-LINE MOVE 'STATE' TO WS-LEL-FIELD MOVE WS-ER-NOT-IN-LOOKUP TO WS-LEL-REASON PERFORM 7100-LOG-ERR THRU 7100-LOG-ERR-EXIT END-IF. MOVE 'CTRY ' TO LOKP-TYPE. MOVE TR-FAC-COUNTRY TO LOKP-CODE. PERFORM 6500-READ-LOKP THRU 6500-READ-LOKP-EXIT. IF LOKP-NOT-FOUND MOVE SPACES TO WS-LOG-ERR-LINE MOVE 'COUNTRY' TO WS-LEL-FIELD MOVE WS-ER-NOT-IN-LOOKUP TO WS-LEL-REASON PERFORM 7100-LOG-ERR THRU 7100-LOG-ERR-EXIT END-IF. * 4500-DATA-VALADITION-EXIT. EXIT. 5100-PROCESS-FACL. EVALUATE TRUE WHEN FACL-NOT-FOUND PERFORM 6100-MOVE-FACL THRU 6100-MOVE-FACL-EXIT ************** DISPLAY 'WR NEW FL - ' FAC-CALLSIGN WRITE FACL-REC ADD +1 TO WS-FACL-ADD WHEN FACL-FOUND PERFORM 6100-MOVE-FACL THRU 6100-MOVE-FACL-EXIT ************* DISPLAY 'REW CH FL - ' FAC-CALLSIGN REWRITE FACL-REC ADD +1 TO WS-FACL-UPDATE WHEN OTHER DISPLAY 'INVALID TRANSACTION - FACL' MOVE 'NO' TO TR-GOOD-REC-IND END-EVALUATE. 5100-PROCESS-FACL-EXIT. EXIT. * 5200-PROCESS-APPL. EVALUATE TRUE WHEN APPL-NOT-FOUND PERFORM 6200-MOVE-APPL THRU 6200-MOVE-APPL-EXIT ************** DISPLAY 'WR NEW AP - ' APP-ARN WRITE APPL-REC ADD +1 TO WS-APPL-ADD WHEN APPL-FOUND PERFORM 6200-MOVE-APPL THRU 6200-MOVE-APPL-EXIT ************* DISPLAY 'REW CH AP - ' APP-ARN REWRITE APPL-REC ADD +1 TO WS-APPL-UPDATE Mainframe Migration Feasibility Study 00564000 00565000 00566000 00567000 00568000 00569000 00570000 00571000 00572000 00573000 00574000 00575000 00576000 00577000 00578000 00579000 00580000 00581000 00582000 00583000 00584000 00585000 00586000 00587000 00588000 00589000 00590000 00591000 00592000 00593000 00594000 00595000 00596000 00597000 00598000 00599000 00600000 00601000 00602000 00603000 00604000 00605000 00606000 00607000 00608000 00609000 00610000 00611000 00612000 00613000 00614000 00615000 00616000 00617000 00618000 00619000 00620000 00621000 00622000 00623000 00624000 00625000 00626000 00627000 00628000 00629000 00630000 00631000 00632000 00633000 00634000 27 WHEN OTHER DISPLAY 'INVALID TRANSACTION - FACL' MOVE 'NO' TO TR-GOOD-REC-IND END-EVALUATE. 5200-PROCESS-APPL-EXIT. EXIT. 5400-FACL-IN-APPL. DELETE APPL-FILE. ADD +1 TO WS-APPL-DELETE PERFORM 6900-READ-APPL-SEC-NEXT THRU 6900-READ-APPL-SEC-NEXT-EXIT. 5400-FACL-IN-APPL-EXIT. EXIT. 6100-MOVE-FACL. MOVE TR-CALLSIGN MOVE TR-FAC-ADDRESS1 MOVE TR-FAC-ADDRESS2 MOVE TR-FAC-CITY MOVE TR-FAC-STATE MOVE TR-FAC-COUNTRY MOVE TR-FAC-FREQUENCY MOVE TR-FAC-MART-CITY MOVE TR-FAC-MART-ST-CD MOVE YYYYMMDD 6100-MOVE-FACL-EXIT. EXIT. 6200-MOVE-APPL. MOVE TR-APP-ARN MOVE TR-CALLSIGN MOVE TR-APP-TYPE MOVE TR-APP-FI-PREFIX MOVE TR-APP-PAP-FI-IND MOVE WS-APP-STATUS-DATE MOVE YYYYMMDD MOVE SPACES 6200-MOVE-APPL-EXIT. EXIT. TO TO TO TO TO TO TO TO TO TO FAC-CALLSIGN. FAC-ADDRESS1. FAC-ADDRESS2. FAC-CITY. FAC-STATE. FAC-COUNTRY. FAC-FREQUENCY. FAC-MART-CITY. FAC-MART-ST-CD. FAC-UPDATE-DATE. TO TO TO TO TO TO TO TO APP-ARN. APP-CALLSIGN. APP-TYPE. APP-FI-PREFIX. APP-PAP-FI-IND. APP-STATUS-DATE. APP-UPDATE-DATE. APP-FILLER. 6500-READ-LOKP. MOVE SPACES TO LOKP-REC-FOUND. READ LOKP-FILE KEY IS LOKP-KEY INVALID KEY MOVE 'NO' TO LOKP-REC-FOUND GO TO 6500-READ-LOKP-EXIT. MOVE 'YES' TO LOKP-REC-FOUND. 6500-READ-LOKP-EXIT. EXIT. * 6600-READ-FACL. MOVE TR-CALLSIGN TO FAC-CALLSIGN. MOVE SPACES TO FACL-REC-FOUND. READ FACL-FILE KEY IS FAC-CALLSIGN INVALID KEY MOVE 'NO' TO FACL-REC-FOUND GO TO 6600-READ-FACL-EXIT. MOVE 'YES' TO FACL-REC-FOUND. 6600-READ-FACL-EXIT. EXIT. * 6700-READ-APPL. MOVE TR-APP-ARN TO APP-ARN. MOVE SPACES TO APPL-REC-FOUND. READ APPL-FILE KEY IS APP-ARN INVALID KEY MOVE 'NO' TO APPL-REC-FOUND Mainframe Migration Feasibility Study 00635000 00636000 00637000 00638000 00639000 00640000 00641000 00642000 00643000 00644000 00645000 00646000 00647000 00648000 00649000 00650000 00651000 00652000 00653000 00654000 00655000 00656000 00657000 00658000 00659000 00660000 00661000 00662000 00663000 00664000 00665000 00666000 00667000 00668000 00669000 00670000 00671000 00672000 00673000 00674000 00675000 00676000 00677000 00678000 00679000 00680000 00681000 00682000 00683000 00684000 00685000 00686000 00687000 00688000 00689000 00690000 00691000 00692000 00693000 00694000 00695000 00696000 00697000 00698000 00699000 00700000 00701000 00702000 00703000 00704000 00705000 28 GO TO 6700-READ-APPL-EXIT. **** DISPLAY 'VALID KEY STATUS ' APPL-ST. MOVE 'YES' TO APPL-REC-FOUND. 6700-READ-APPL-EXIT. EXIT. * 6800-READ-APPL-SEC. MOVE TR-CALLSIGN TO APP-CALLSIGN. MOVE SPACES TO APPL-REC-FOUND. READ APPL-FILE KEY IS APP-CALLSIGN INVALID KEY ******* DISPLAY '6800-READ STATUS-N ' APPL-ST MOVE 'NO' TO APPL-REC-FOUND GO TO 6800-READ-APPL-SEC-EXIT. MOVE 'YES' TO APPL-REC-FOUND. **** DISPLAY '6800-READ STATUS-Y ' APPL-ST ' ' APP-CALLSIGN. 6800-READ-APPL-SEC-EXIT. EXIT. * 6900-READ-APPL-SEC-NEXT. **** DISPLAY '6900-READ FOR APP ' APP-CALLSIGN. READ APPL-FILE NEXT RECORD AT END MOVE 'YES' TO EOF-FACL-IN-APPL GO TO 6900-READ-APPL-SEC-NEXT-EXIT. IF TR-CALLSIGN EQUAL APP-CALLSIGN GO TO 6900-READ-APPL-SEC-NEXT-EXIT ELSE MOVE 'YES' TO EOF-FACL-IN-APPL. 6900-READ-APPL-SEC-NEXT-EXIT. EXIT. * 7100-LOG-ERR. IF TR-GOOD-REC ADD +1 TO WS-TR-ERROR MOVE 'NO' TO TR-GOOD-REC-IND MOVE TRNX-REC TO TR-ERR-REC WRITE TR-ERR-REC END-IF. MOVE TR-APP-ARN TO WS-LEL-APP-ARN. MOVE WS-TR-READ TO WS-LEL-TR-COUNT. MOVE WS-TR-ERROR TO WS-LEL-TR-ER-COUNT. MOVE WS-LOG-ERR-LINE TO TR-LOG-LINE. WRITE TR-LOG-REC. 7100-LOG-ERR-EXIT. EXIT. * 8000-INIT-RT. MOVE FUNCTION CURRENT-DATE(1:8) TO YYYYMMDD. DISPLAY 'YYYYMMDD ' YYYYMMDD. MOVE CUR-YYYY TO WS-BEG-JOB-YYYY. MOVE CUR-MONTH TO WS-BEG-JOB-MONTH MOVE CUR-DD TO WS-BEG-JOB-DD. ACCEPT ST-JOB-TIME FROM TIME. DISPLAY 'START JOB TIME=' ST-JOB-TIME. MOVE BEG-HH TO WS-BEG-JOB-HH. MOVE BEG-MM TO WS-BEG-JOB-MM. MOVE BEG-SSSS TO WS-BEG-JOB-SSSS. MOVE YYYYMMDD TO WS-ALT-APP-STATUS-DATE. MOVE 01 TO ALT-DD. MOVE TR-LOG-HEADER TO TR-LOG-REC. WRITE TR-LOG-REC. MOVE TR-TIME-HEADER-1 TO TR-TIME-REC. WRITE TR-TIME-REC. Mainframe Migration Feasibility Study 00706000 00707000 00708000 00709000 00710000 00711000 00712000 00713000 00714000 00715000 00716000 00717000 00718000 00719000 00720000 00721000 00722000 00723000 00724000 00725000 00726000 00727000 00728000 00729000 00730000 00731000 00732000 00733000 00734000 00735000 00736000 00737000 00738000 00739000 00740000 00741000 00742000 00743000 00744000 00745000 00746000 00747000 00748000 00749000 00750000 00751000 00752000 00753000 00754000 00755000 00756000 00757000 00758000 00759000 00760000 00761000 00762000 00763000 00764000 00765000 00766000 00767000 00768000 00769000 00770000 00771000 00772000 00773000 00774000 00775000 00776000 29 MOVE TR-TIME-HEADER-2 TO TR-TIME-REC. WRITE TR-TIME-REC. * ACCEPT CHRDATE-STRING FROM DATE. * DISPLAY 'CHRDATE-STRING ' CHRDATE-STRING. * * MOVE "YYMMDD" TO PICSTR-STRING. * MOVE 6 TO PICSTR-LENGTH. * CALL "CEEDAYS" USING CHRDATE , PICSTR , LILIAN , OMITTED. * * MOVE " WWWWWWWWWZ, MMMMMMMMMZ DD, YYYY " TO PICSTR-STRING. * MOVE 50 TO PICSTR-LENGTH. * CALL "CEEDATE" USING LILIAN , PICSTR , FORMATTED-DATE , * OMITTED. * * DISPLAY "******************************". * DISPLAY FORMATTED-DATE. * DISPLAY CHRTIME-STRING. * DISPLAY "******************************". 8000-INIT-RT-EXIT. EXIT. 8100-TR-END-TIME. ACCEPT END-TR-TIME FROM TIME. SUBTRACT ST-TR-TIME FROM END-TR-TIME GIVING WS-TR-EXEC-TIME ROUNDED. ADD WS-TR-EXEC-TIME TO WS-CUMM-TIME. MOVE SPACES TO TR-TIME-REC. MOVE TR-APP-ARN TO TT-APP-ARN. MOVE ST-TR-TIME TO TT-ST-TIME. MOVE END-TR-TIME TO TT-END-TIME. MOVE WS-TR-EXEC-TIME TO TT-EXEC-TIME. MOVE WS-CUMM-TIME TO TT-CUMM-TIME. WRITE TR-TIME-REC. ACCEPT ST-TR-TIME FROM TIME. 8100-TR-END-TIME-EXIT. EXIT. * 8500-SUMMARY-RT. *************************************************************** *AT THE COMPLETION OF PROCESSING, THE FOLLOWING INFORMATION * WILL BE WRITTEN TO THE LOG FILE: *************************************************************** MOVE SPACES TO TR-LOG-LINE. WRITE TR-LOG-REC. MOVE 'SUMMARY LOG: ' TO TR-LOG-LINE. WRITE TR-LOG-REC. MOVE WS-TR-READ TO WS-LOG-AMOUNT. MOVE ' = RECORDS READ FROM TRANSACTION FILE TO WS-LOG-MESSAGE. MOVE WS-LOG-LINE TO TR-LOG-LINE. WRITE TR-LOG-REC. MOVE WS-TR-GOOD TO WS-LOG-AMOUNT. MOVE ' = RECORDS PROCESSED GOOD TO WS-LOG-MESSAGE. MOVE WS-LOG-LINE TO TR-LOG-LINE. WRITE TR-LOG-REC. MOVE WS-TR-ERROR TO WS-LOG-AMOUNT. MOVE ' = RECORDS WRITTEN TO THE ERROR FILE TO WS-LOG-MESSAGE. MOVE WS-LOG-LINE TO TR-LOG-LINE. WRITE TR-LOG-REC. MOVE WS-LOG-LINE TO TR-ERR-REC. WRITE TR-ERR-REC. * Mainframe Migration Feasibility Study ' ' ' 00777000 00778000 00779000 00780000 00781000 00782000 00783000 00784000 00785000 00786000 00787000 00788000 00789000 00790000 00791000 00792000 00793000 00794000 00795000 00796000 00797000 00798000 00799000 00800000 00801000 00802000 00803000 00804000 00805000 00806000 00807000 00808000 00809000 00810000 00811000 00812000 00813000 00814000 00815000 00816000 00817000 00818000 00819000 00820000 00821000 00822000 00823000 00824000 00825000 00826000 00827000 00828000 00829000 00830000 00831000 00832000 00833000 00834000 00835000 00836000 00837000 00838000 00839000 00840000 00841000 00842000 00843000 00844000 00845000 00846000 00847000 30 MOVE WS-APPL-ADD TO WS-LOG-AMOUNT. MOVE ' = RECORDS ADDED TO THE APPLICATION FILE TO WS-LOG-MESSAGE. MOVE WS-LOG-LINE TO TR-LOG-LINE. WRITE TR-LOG-REC. MOVE WS-APPL-UPDATE TO WS-LOG-AMOUNT. MOVE ' = RECORDS UPDATED TO THE APPLICATION FILE TO WS-LOG-MESSAGE. MOVE WS-LOG-LINE TO TR-LOG-LINE. WRITE TR-LOG-REC. ' ' MOVE WS-APPL-UPDT-SKIP TO WS-LOG-AMOUNT. MOVE ' = RECORDS SKIP UPDATE TO APPLICATION FILE - DATE ' TO WS-LOG-MESSAGE. MOVE WS-LOG-LINE TO TR-LOG-LINE. WRITE TR-LOG-REC. MOVE WS-APPL-DELETE TO WS-LOG-AMOUNT. MOVE ' = RECORDS DELETED FROM THE APPLICATION FILE TO WS-LOG-MESSAGE. MOVE WS-LOG-LINE TO TR-LOG-LINE. WRITE TR-LOG-REC. MOVE WS-FACL-ADD TO WS-LOG-AMOUNT. MOVE ' = RECORDS ADDED TO THE FACILITY FILE TO WS-LOG-MESSAGE. MOVE WS-LOG-LINE TO TR-LOG-LINE. WRITE TR-LOG-REC. MOVE WS-FACL-UPDATE TO WS-LOG-AMOUNT. MOVE ' = RECORDS UPDATED TO THE FACILITY FILE TO WS-LOG-MESSAGE. MOVE WS-LOG-LINE TO TR-LOG-LINE. WRITE TR-LOG-REC. MOVE WS-FACL-UPDT-SKIP TO WS-LOG-AMOUNT. MOVE ' = RECORDS SKIP UPDATE TO THE FACILITY - DATE TO WS-LOG-MESSAGE. MOVE WS-LOG-LINE TO TR-LOG-LINE. WRITE TR-LOG-REC. MOVE WS-FACL-DELETE TO WS-LOG-AMOUNT. MOVE ' = RECORDS DELETED FROM THE FACILITY FILE TO WS-LOG-MESSAGE. MOVE WS-LOG-LINE TO TR-LOG-LINE. WRITE TR-LOG-REC. MOVE SPACES TO WS-LOG-LINE. MOVE WS-LOG-LINE TO TR-LOG-LINE. WRITE TR-LOG-REC. MOVE WS-BEG-LOG-LINE TO WS-LOG-LINE. MOVE WS-LOG-LINE TO TR-LOG-LINE. WRITE TR-LOG-REC. MOVE FUNCTION CURRENT-DATE(1:8) TO YYYYMMDD. DISPLAY 'YYYYMMDD ' YYYYMMDD. MOVE CUR-YYYY TO WS-END-JOB-YYYY. MOVE CUR-MONTH TO WS-END-JOB-MONTH MOVE CUR-DD TO WS-END-JOB-DD. ACCEPT END-JOB-TIME FROM TIME. DISPLAY 'END JOB TIME' END-JOB-TIME. MOVE EOJ-HH TO WS-END-JOB-HH. MOVE EOJ-MM TO WS-END-JOB-MM. MOVE EOJ-SSSS TO WS-END-JOB-SSSS. MOVE WS-END-LOG-LINE TO WS-LOG-LINE. MOVE WS-LOG-LINE TO TR-LOG-LINE. WRITE TR-LOG-REC. Mainframe Migration Feasibility Study ' ' ' ' ' 00848000 00849000 00850000 00851000 00852000 00853000 00854000 00855000 00856000 00857000 00858000 00859000 00860000 00861000 00862000 00863000 00864000 00865000 00866000 00867000 00868000 00869000 00870000 00871000 00872000 00873000 00874000 00875000 00876000 00877000 00878000 00879000 00880000 00881000 00882000 00883000 00884000 00885000 00886000 00887000 00888000 00889000 00890000 00891000 00892000 00893000 00894000 00895000 00896000 00897000 00898000 00899000 00900000 00901000 00902000 00903000 00904000 00905000 00906000 00907000 00908000 00909000 00910000 00911000 00912000 00913000 00914000 00915000 00916000 00917000 00918000 31 8500-SUMMARY-RT-EXIT. EXIT. 9000-CLOSE-PARA. CLOSE FACL-FILE APPL-FILE LOKP-FILE TRNX-FILE TR-ERR-FILE TR-LOG-FILE TR-TIME-FILE. 9000-CLOSE-PARA-EXIT. EXIT. Mainframe Migration Feasibility Study 00919000 00920000 00921000 00922000 00923000 00924000 00925000 00926000 00927000 00928000 00929000 00930000 00931000 00932000 32 Appendix C COBOL 2 Program IDENTIFICATION DIVISION. PROGRAM-ID. COB2. AUTHOR. INFORMATION CONCEPTS DATE-WRITTEN. 1/18/2006. DATE-COMPILED. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SOURCE-COMPUTER. IBM-390. OBJECT-COMPUTER. IBM-390. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TR-LOG-FILE ASSIGN TO TRLOG. SELECT LOG-OUTPUT ASSIGN TO REPLOG. DATA DIVISION. FILE SECTION. FD TR-LOG-FILE. 01 TR-LOG-REC. 05 TR-LOG-LINE. 10 10 TR-LOG-TYPE 10 PIC X(70). PIC X(10). PIC X(20). FD LOG-OUTPUT. 01 LOG-REC. 05 LOG-LINE PIC X(100). WORKING-STORAGE SECTION. * 01 WS-SWITCHES. 05 EOF-SW 01 01 PIC XXX VALUE SPACES. TR-TIME-HEADER-1. 05 05 05 05 05 05 05 05 05 05 PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC X(10) X(02) X(08) X(04) X(08) X(04) X(04) X(04) X(04) X(02) VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE 'APP ARN '. SPACES. 'REC ST '. SPACES. 'REC END '. SPACES. 'TIME'. SPACES. 'JOB '. SPACES. TR-TIME-HEADER-2. 05 05 05 05 05 05 05 05 05 05 PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC X(10) X(02) X(08) X(04) X(08) X(04) X(04) X(04) X(04) X(02) VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE SPACES. SPACES. 'HHMMSSth'. SPACES. 'HHMMSSth'. SPACES. 'SSth'. SPACES. 'SSth'. SPACES. PROCEDURE DIVISION. 0000-MAIN. PERFORM 1000-OPEN-FILES THRU 1000-OPEN-FILES-EXIT. PERFORM 2000-PROCESS THRU 2000-PROCESS-EXIT. PERFORM 9000-CLOSE-PARA THRU 9000-CLOSE-PARA-EXIT. GOBACK. Mainframe Migration Feasibility Study 00001000 00002000 00003000 00004000 00005000 00006000 00007000 00008000 00009000 00010000 00011000 00012000 00013000 00014000 00015000 00016000 00017000 00018000 00019000 00020000 00021000 00022000 00023000 00024000 00025000 00026000 00027000 00028000 00029000 00030000 00031000 00032000 00033000 00034000 00035000 00036000 00037000 00038000 00039000 00040000 00041000 00042000 00043000 00044000 00045000 00046000 00047000 00048000 00049000 00050000 00051000 00052000 00053000 00054000 00055000 00056000 00057000 00058000 00059000 00060000 00061000 00062000 00063000 00064000 00065000 00066000 33 0000-MAIN-EXTT. EXIT. * 1000-OPEN-FILES. OPEN INPUT TR-LOG-FILE. OPEN OUTPUT LOG-OUTPUT. 1000-OPEN-FILES-EXIT. EXIT. 2000-PROCESS. PERFORM 3000-READ THRU 3000-READ-EXIT UNTIL EOF-SW = 'YES'. 2000-PROCESS-EXIT. EXIT. 3000-READ. READ TR-LOG-FILE AT END MOVE 'YES' TO EOF-SW GO TO 3000-READ-EXIT. IF TR-LOG-TYPE = SPACES MOVE TR-LOG-REC TO LOG-REC WRITE LOG-REC. 3000-READ-EXIT. EXIT. * 9000-CLOSE-PARA. CLOSE TR-LOG-FILE LOG-OUTPUT. 9000-CLOSE-PARA-EXIT. EXIT. Mainframe Migration Feasibility Study 00067000 00068000 00069000 00070000 00071000 00072000 00073000 00074000 00075000 00076000 00077000 00078000 00079000 00080000 00081000 00082000 00083000 00084000 00085000 00086000 00087000 00088000 00089000 00090000 00091000 00092000 00093000 00094000 00095000 00096000 00097000 00098000 00099000 34 Appendix D COBOL 3 Program IDENTIFICATION DIVISION. PROGRAM-ID. COB3. AUTHOR. SAYES N GANPAT - SNG/IC. DATE-WRITTEN. 1/18/2006. DATE-COMPILED. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SOURCE-COMPUTER. IBM-390. OBJECT-COMPUTER. IBM-390. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT FACL-FILE ASSIGN TO "FACL.DAT" ORGANIZATION IS INDEXED ACCESS MODE IS RANDOM RECORD KEY IS FAC-CALLSIGN STATUS FACL-ST. SELECT APPL-FILE ASSIGN TO "APPL.DAT" ORGANIZATION IS INDEXED ACCESS MODE IS DYNAMIC RECORD KEY IS APP-ARN ALTERNATE RECORD KEY IS APP-CALLSIGN DUPLICATES STATUS APPL-ST. * SELECT PRT-OUTPUT ASSIGN TO PRTOUT. DATA DIVISION. FILE SECTION. FD FACL-FILE. 01 FACL-REC. 05 FAC-CALLSIGN 05 FAC-ADDRESS1 05 FAC-ADDRESS2 05 FAC-CITY 05 FAC-STATE 05 FAC-COUNTRY 05 FAC-FREQUENCY 05 FAC-MART-CITY 05 FAC-MART-ST-CD 05 FAC-UPDATE-DATE 05 FILLER PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC PIC X(10). X(35). X(35). X(25). X(02). X(05). X(10). X(25). X(02). X(08). X(06). FD APPL-FILE. 01 APPL-REC. 05 APP-ARN PIC X(10). 05 APP-CALLSIGN PIC X(10). 05 APP-TYPE PIC X(10). 05 APP-FI-PREFIX PIC X(08). 05 APP-PAP-FI-IND PIC X(01). 05 APP-STATUS-DATE PIC X(08). 05 APP-UPDATE-DATE PIC X(08). 05 FILLER PIC X(25). *FD PRT-OUTPUT. *01 PRT-REC OCCURS 25 TIMES. * 05 PRT-LINE PIC X(80). WORKING-STORAGE SECTION. 01 WS-SWITCHES. 05 EOF-SW PIC XXX 05 EOF-FACL-IN-APPL PIC XXX 88 NO-MORE-FACL-IN-APPL 88 MORE-FACL-IN-APPL 05 FACL-REC-FOUND PIC XXX 88 FACL-FOUND 88 FACL-NOT-FOUND 05 APPL-REC-FOUND PIC XXX 88 APPL-FOUND Mainframe Migration Feasibility Study VALUE SPACES. VALUE SPACES. VALUE 'YES'. VALUE 'NO'. VALUE SPACES. VALUE 'YES'. VALUE 'NO'. VALUE SPACES. VALUE 'YES'. 00001000 00002000 00003000 00004000 00005000 00006000 00007000 00008000 00009000 00010000 00011000 00012000 00013000 00014000 00015000 00016000 00017000 00018000 00019000 00020000 00021000 00022000 00023000 00024000 00025000 00026000 00027000 00028000 00029000 00030000 00031000 00032000 00033000 00034000 00035000 00036000 00037000 00038000 00039000 00040000 00041000 00042000 00043000 00044000 00045000 00046000 00047000 00048000 00049000 00050000 00051000 00052000 00053000 00054000 00055000 00056000 00057000 00058000 00059000 00060000 00061000 00062000 00063000 00064000 00065000 00066000 35 88 01 APPL-NOT-FOUND WS-FILE-STATUS. 05 APPL-ST 05 FACL-ST 05 PARM-CALLSIGN 01 SUB 01 ls-file-status 01 ls-call-status 01 01 01 01 VALUE 'NO'. PIC 99 VALUE 0. PIC 99 VALUE 0. PIC X(10) VALUE SPACES. PIC 9(2) VALUE 0 COMP. pic xx. pic x(2) comp-5. PRT-FACL-L1. 05 05 05 PRT-CALLSIGN 05 PRT-FACL-L2. 05 05 05 PRT-MARKET 05 PRT-FACL-L3. 05 05 05 PRT-FREQUENCY 05 PRT-APPL-HD. 05 05 05 05 05 05 05 05 05 PIC PIC PIC PIC X(05) VALUE SPACES. X(11) VALUE 'Call Sign: '. X(10). X(54) VALUE SPACES. PIC PIC PIC PIC X(05) VALUE SPACES. X(08) VALUE 'Market: '. X(30). X(37) VALUE SPACES. PIC PIC PIC PIC X(05) VALUE SPACES. X(11) VALUE 'Frequency: '. X(10). X(05) VALUE SPACES. PIC PIC PIC PIC PIC PIC PIC PIC PIC X(05) X(18) X(05) X(04) X(11) X(14) X(05) X(12) X(06) VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE VALUE SPACES. 'APPLICATION NUMBER'. SPACES. 'TYPE'. SPACES. 'FILE INDICATOR'. SPACES. 'STATUS DATE'. SPACES. 01 PRT-APPL-LINE. 05 PIC X(09) VALUE SPACES. 05 PRT-APP-ARN PIC X(10). 05 PIC X(09) VALUE SPACES. 05 PRT-APP-TYPE PIC X(10). 05 PIC X(05) VALUE SPACES. 05 PRT-APP-PAP-FI-IND PIC X(01). 05 PIC X(18) VALUE SPACES. 05 PRT-APP-STATUS-DATE PIC XXXX/XX/XX. 05 PIC X(08) VALUE SPACES. 01 PRT-BLANK-LINE. 05 linkage section. 01 lnk-function-inp. 05 lnk-function 88 read-record 88 add-record 88 delete-record 88 next-record 05 lnk-facl PIC X(80) VALUE SPACES. pic x. value "1". value "2". value "3". value "4". pic x(10). 01 lnk-file-status pic xx. copy "CPFACL" replacing ==(prefix)== by ==lnk-b==. Procedure division using lnk-function-inp lnk-b-details lnk-file-status. 0000-MAIN. * call "CBL_TOUPPER" using lnk-b-text-details * by value length lnk-b-text-details * returning ls-call-status Mainframe Migration Feasibility Study 00067000 00068000 00069000 00070000 00071000 00072000 00073000 00074000 00075000 00076000 00077000 00078000 00079000 00080000 00081000 00082000 00083000 00084000 00085000 00086000 00087000 00088000 00089000 00090000 00091000 00092000 00093000 00094000 00095000 00096000 00097000 00098000 00099000 00100000 00101000 00102000 00103000 00104000 00105000 00106000 00107000 00108000 00109000 00110000 00111000 00112000 00113000 00114000 00115000 00116000 00117000 00118000 00119000 00120000 00121000 00122000 00123000 00124000 00125000 00126000 00127000 00128000 00129000 00130000 00131000 00132000 00133000 00134000 00135000 00136000 00137000 36 evaluate true when read-record PERFORM 1000-ACCEPT-PARM THRU 1000-ACCEPT-PARM-EXIT PERFORM 2000-OPEN-FILES THRU 2000-OPEN-FILES-EXIT PERFORM 3000-PROCESS THRU 3000-PROCESS-EXIT PERFORM 9000-CLOSE-PARA THRU 9000-CLOSE-PARA-EXIT end-evaluate exit program stop run. 0000-MAIN-EXTT. EXIT. 1000-ACCEPT-PARM. MOVE SPACES TO LNK-B-DETAILS. MOVE SPACES TO LNK-FILE-STATUS. move lnk-facl to PARM-CALLSIGN. * ACCEPT PARM-CALLSIGN FROM CONSOLE. * DISPLAY 'PARM CALLSIGN = ' PARM-CALLSIGN. 1000-ACCEPT-PARM-EXIT. EXIT. 2000-OPEN-FILES. OPEN INPUT FACL-FILE. IF FACL-ST not = 0 MOVE 'FO' TO LNK-FILE-STATUS GO TO 2000-OPEN-FILES-EXIT. * DISPLAY 'FA OPEN STATUS ' FACL-ST. OPEN INPUT APPL-FILE. IF APPL-ST not = 0 MOVE 'AO' TO LNK-FILE-STATUS GO TO 2000-OPEN-FILES-EXIT. * DISPLAY 'AP OPEN STATUS ' APPL-ST. * OPEN OUTPUT PRT-OUTPUT. 2000-OPEN-FILES-EXIT. EXIT. 3000-PROCESS. PERFORM 6600-READ-FACL THRU 6600-READ-FACL-EXIT IF FACL-FOUND PERFORM 5200-PRT-FACL THRU 5200-PRT-FACL-EXIT PERFORM 6800-READ-APPL-SEC THRU 6800-READ-APPL-SEC-EXIT IF APPL-FOUND MOVE SPACES TO EOF-FACL-IN-APPL PERFORM 4000-FACL-IN-APPL THRU 4000-FACL-IN-APPL-EXIT UNTIL NO-MORE-FACL-IN-APPL OR SUB > 95 END-IF END-IF. 3000-PROCESS-EXIT. EXIT. * 4000-FACL-IN-APPL. PERFORM 5400-PRT-APPL THRU 5400-PRT-APPL-EXIT PERFORM 6900-READ-APPL-SEC-NEXT THRU 6900-READ-APPL-SEC-NEXT-EXIT. 4000-FACL-IN-APPL-EXIT. EXIT. * Mainframe Migration Feasibility Study 00138000 00139000 00140000 00141000 00142000 00143000 00144000 00145000 00146000 00147000 00148000 00149000 00150000 00151000 00152000 00153000 00154000 00155000 00156000 00157000 00158000 00159000 00160000 00161000 00162000 00163000 00164000 00165000 00166000 00167000 00168000 00169000 00170000 00171000 00172000 00173000 00174000 00175000 00176000 00177000 00178000 00179000 00180000 00181000 00182000 00183000 00184000 00185000 00186000 00187000 00188000 00189000 00190000 00191000 00192000 00193000 00194000 00195000 00196000 00197000 00198000 00199000 00200000 00201000 00202000 00203000 00204000 00205000 00206000 00207000 00208000 37 5200-PRT-FACL. MOVE FAC-CALLSIGN TO PRT-CALLSIGN. MOVE PRT-FACL-L1 TO lnk-b-PRT-REC(1). * WRITE PRT-REC AFTER ADVANCING PAGE. MOVE SPACES TO PRT-MARKET. STRING FAC-MART-CITY DELIMITED BY SPACE ', ' DELIMITED BY SIZE FAC-MART-ST-CD DELIMITED BY SPACE INTO PRT-MARKET. MOVE PRT-FACL-L2 TO lnk-b-PRT-REC(2). * WRITE PRT-REC. MOVE FAC-FREQUENCY TO PRT-FREQUENCY. MOVE PRT-FACL-L3 TO lnk-b-PRT-REC(3). * WRITE PRT-REC. MOVE PRT-BLANK-LINE TO lnk-b-PRT-REC(4). * WRITE PRT-REC. MOVE PRT-APPL-HD TO lnk-b-PRT-REC(5). * WRITE PRT-REC. MOVE PRT-BLANK-LINE TO lnk-b-PRT-REC(6). * WRITE PRT-REC. MOVE 7 TO SUB. 5200-PRT-FACL-EXIT. EXIT. * 5400-PRT-APPL. MOVE APP-ARN TO PRT-APP-ARN. MOVE APP-TYPE TO PRT-APP-TYPE. MOVE APP-PAP-FI-IND TO PRT-APP-PAP-FI-IND. MOVE APP-STATUS-DATE TO PRT-APP-STATUS-DATE. MOVE PRT-APPL-LINE TO lnk-b-PRT-REC(SUB). ADD 1 TO SUB. * WRITE PRT-REC. 5400-PRT-APPL-EXIT. EXIT. * 6600-READ-FACL. MOVE PARM-CALLSIGN TO FAC-CALLSIGN. MOVE SPACES TO FACL-REC-FOUND. READ FACL-FILE KEY IS FAC-CALLSIGN INVALID KEY MOVE 'NO' TO FACL-REC-FOUND MOVE 'FR' TO LNK-FILE-STATUS GO TO 6600-READ-FACL-EXIT. MOVE 'YES' TO FACL-REC-FOUND. 6600-READ-FACL-EXIT. EXIT. * 6800-READ-APPL-SEC. MOVE PARM-CALLSIGN TO APP-CALLSIGN. MOVE SPACES TO APPL-REC-FOUND. READ APPL-FILE KEY IS APP-CALLSIGN INVALID KEY ******* DISPLAY '6800-READ STATUS-N ' APPL-ST MOVE 'NO' TO APPL-REC-FOUND MOVE 'AR' TO LNK-FILE-STATUS GO TO 6800-READ-APPL-SEC-EXIT. MOVE 'YES' TO APPL-REC-FOUND. **** DISPLAY '6800-READ STATUS-Y ' APPL-ST ' ' APP-CALLSIGN. 6800-READ-APPL-SEC-EXIT. EXIT. * 6900-READ-APPL-SEC-NEXT. **** DISPLAY '6900-READ FOR APP ' APP-CALLSIGN. READ APPL-FILE NEXT RECORD AT END MOVE 'YES' TO EOF-FACL-IN-APPL Mainframe Migration Feasibility Study 00209000 00210000 00211000 00212000 00213000 00214000 00215000 00216000 00217000 00218000 00219000 00220000 00221000 00222000 00223000 00224000 00225000 00226000 00227000 00228000 00229000 00230000 00231000 00232000 00233000 00234000 00235000 00236000 00237000 00238000 00239000 00240000 00241000 00242000 00243000 00244000 00245000 00246000 00247000 00248000 00249000 00250000 00251000 00252000 00253000 00254000 00255000 00256000 00257000 00258000 00259000 00260000 00261000 00262000 00263000 00264000 00265000 00266000 00267000 00268000 00269000 00270000 00271000 00272000 00273000 00274000 00275000 00276000 00277000 00278000 00279000 38 MOVE 'AN' TO LNK-FILE-STATUS GO TO 6900-READ-APPL-SEC-NEXT-EXIT. IF PARM-CALLSIGN EQUAL APP-CALLSIGN GO TO 6900-READ-APPL-SEC-NEXT-EXIT ELSE MOVE 'YES' TO EOF-FACL-IN-APPL. 6900-READ-APPL-SEC-NEXT-EXIT. EXIT. * 9000-CLOSE-PARA. CLOSE FACL-FILE APPL-FILE. * PRT-OUTPUT. 9000-CLOSE-PARA-EXIT. EXIT. Mainframe Migration Feasibility Study 00280000 00281000 00282000 00283000 00284000 00285000 00286000 00287000 00288000 00289000 00290000 00291000 00292000 00293000 00294000 00295000 00296000 39 This is a preliminary document and may be changed substantially prior to final commercial release of the software described herein. The information contained in this document represents the current view of Microsoft Corporation on the issues discussed as of the date of publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication. This white paper is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in, or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation. Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property. © 2006 Microsoft Corporation. All rights reserved. Microsoft, SharePoint, Windows, the Windows logo, and Windows Server are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. The names of actual companies and products mentioned herein may be the trademarks of their respective owners. Mainframe Migration Feasibility Study 40