ebook img

Java Stand-alone Applications on z/OS Volume 1 - IBM Redbooks PDF

244 Pages·2006·5.99 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Java Stand-alone Applications on z/OS Volume 1 - IBM Redbooks

Front cover Java Stand-alone Applications on z/OS Volume 1 Setting up an environment for managing Java programs on z/OS Building, deploying, running, and debugging applications Analyzing application performance and exploiting zAAP Alex Louwe Kooijmans Paul Anderson Kenichi Yoshimura Linfeng Yu ibm.com/redbooks International Technical Support Organization Java Stand-alone Applications on z/OS Volume 1 May 2006 SG24-7177-00 Note: Before using this information and the product it supports, read the information in “Notices” on pagevii. First Edition (May 2006) This edition applies to IBM SDK for z/OS, Java 2 Technology Edition, productnumber 5655-I56. © Copyright International Business Machines Corporation 2006. All rights reserved. Note to U.S. Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .viii Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .ix The team that wrote this redbook. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x Become a published author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xi Comments welcome. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xi Chapter 1. Scenarios for running Java stand-alone applications on z/OS 1 1.1 Definition of Java stand-alone applications. . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1.1 Definition of batch applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 Legacy system modernization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.3 Reasons to use Java for stand-alone applications . . . . . . . . . . . . . . . . . . . 5 1.3.1 Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.3.2 XML processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.3.3 Reusing J2EE online program logic . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.3.4 Migrating Java applications for QoS and server consolidation. . . . . . 7 1.3.5 Availability of skill set for the future. . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.3.6 zAAP processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.4 Topologies of Java stand-alone applications . . . . . . . . . . . . . . . . . . . . . . . 9 Chapter 2. Job management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.1 The first Java program on z/OS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.2 Running a Java program as a batch job . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.2.1 Overview of Job Control Language. . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.2.2 Writing JCL for a Java batch job. . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 2.2.3 Limitations of BPXBATCH. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.2.4 BPXBATSL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.2.5 Comparison of JCLBATCH and JCLBATSL. . . . . . . . . . . . . . . . . . . 22 2.3 Developing multi-step jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.3.1 Specifying multiple steps in a JCL script. . . . . . . . . . . . . . . . . . . . . . 23 2.3.2 Conditions on a step. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 2.3.3 Conditional step execution using IF-ELSE . . . . . . . . . . . . . . . . . . . . 26 2.4 Design considerations for multi-step jobs . . . . . . . . . . . . . . . . . . . . . . . . . 27 2.4.1 What skill sets are available in the development team?. . . . . . . . . . 27 2.4.2 How much integration with legacy applications is necessary? . . . . . 27 2.4.3 How much control is required between steps?. . . . . . . . . . . . . . . . . 27 2.4.4 Return code from BPXBATCH and BPXBATSL. . . . . . . . . . . . . . . . 28 © Copyright IBM Corp. 2006. All rights reserved. iii Chapter 3. Access to MVS data sets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 3.1 The JRIO library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 3.1.1 JRIO classes and interfaces. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 3.1.2 JRIO usage examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 3.2 Working with VSAM data sets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 3.2.1 VSAM overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 3.2.2 Accessing records in a VSAM data set using the JRIO library. . . . . 42 3.3 Working with COBOL packed decimal numbers. . . . . . . . . . . . . . . . . . . . 46 3.3.1 Converting from COBOL packed decimals to Java integers. . . . . . . 48 3.3.2 Converting from Java integers to COBOL packed decimals. . . . . . . 49 3.4 JRecord bean generator and supporting APIs . . . . . . . . . . . . . . . . . . . . . 50 3.4.1 JRecord utility APIs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 3.4.2 Generating a Java bean for a record . . . . . . . . . . . . . . . . . . . . . . . . 50 3.4.3 JRecord runtime library and plug-in installation . . . . . . . . . . . . . . . . 60 Chapter 4. Tools and techniques. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 4.2 Application build and deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 4.2.1 Ant support in Eclipse. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 4.2.2 Set up Ant ftp support in Eclipse. . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 4.2.3 Build and deployment Ant script . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 4.2.4 Use the ANT buildfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 4.2.5 Further discussion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 4.3 Debugging. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 4.3.1 Remote debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 4.3.2 Preparing the Java program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 4.3.3 Creating a shell script and JCL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 4.3.4 Deploying and starting a Java application. . . . . . . . . . . . . . . . . . . . . 78 4.3.5 Work with the debugger in the Eclipse workbench. . . . . . . . . . . . . . 82 4.3.6 Local debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 4.3.7 Rational Application Developer considerations. . . . . . . . . . . . . . . . . 90 Chapter 5. Measuring performance and application profiling . . . . . . . . . 91 5.1 Performance analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 5.1.1 Tooling overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 5.1.2 Establishing a goal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 5.2 Overview of analysis strategies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 5.2.1 Statistical. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 5.2.2 Fractional . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 5.2.3 Elimination. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 5.2.4 Accurate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 5.3 Statistical analysis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 5.4 Fractional analysis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 iv Java Stand-alone Applications on z/OS Volume 1 5.4.1 TIMEUSED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 5.5 Elimination analysis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 5.6 Accurate analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 5.6.1 Installing TPTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 5.6.2 Profiling an application on z/OS . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 5.6.3 Fractional analysis with TPTP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 5.7 Code listings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 Chapter 6. Exploiting zAAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 6.1 zAAP prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 6.2 Overview of zAAP and runtime options. . . . . . . . . . . . . . . . . . . . . . . . . . 174 6.3 Exploring zAAP utilization potentials. . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 6.3.1 zAAP utilization estimate and projection tool . . . . . . . . . . . . . . . . . 175 6.3.2 Experimental results of zAAP utilization estimates. . . . . . . . . . . . . 178 6.3.3 Hardware and software configuration. . . . . . . . . . . . . . . . . . . . . . . 181 Chapter 7. Problem determination. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 7.2 Checking the z/OS environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 7.2.1 Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 7.2.2 LE settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 7.2.3 Environment variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 7.2.4 Private storage usage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 7.2.5 Service Class for the application. . . . . . . . . . . . . . . . . . . . . . . . . . . 186 7.3 Collecting data for problem determination. . . . . . . . . . . . . . . . . . . . . . . . 187 7.3.1 JVM dump control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 7.3.2 CEEDUMP, SYSTDUMP and SVCDUMP . . . . . . . . . . . . . . . . . . . 189 7.3.3 JAVADUMP and HEAPDUMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 7.3.4 Other problem determination data . . . . . . . . . . . . . . . . . . . . . . . . . 192 7.4 Dump analysis and tools. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 7.4.1 Analyzing SYSTDUMP and SVCDUMP . . . . . . . . . . . . . . . . . . . . . 194 7.4.2 Interpreting a JAVADUMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 7.4.3 HeapAnalyzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 7.4.4 Other analysis tools. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 7.5 Problem determination scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 7.5.1 Diagnose crashes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 7.5.2 Debugging hangs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 7.5.3 Debugging memory leaks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 7.5.4 Debugging performance problems . . . . . . . . . . . . . . . . . . . . . . . . . 215 Appendix A. Additional material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 Locating the Web material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 Using the Web material. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 System requirements for downloading the Web material . . . . . . . . . . . . . 218 Contents v Related publications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 IBM Redbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 Other publications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 Online resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 How to get IBM Redbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 Help from IBM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 vi Java Stand-alone Applications on z/OS Volume 1 Notices This information was developed for products and services offered in the U.S.A. IBM may not offer the products, services, or features discussed in this document in other countries. Consult your local IBM representative for information on the products and services currently available in your area. Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any IBM intellectual property right may be used instead. However, it is the user's responsibility to evaluate and verify the operation of any non-IBM product, program, or service. IBM may have patents or pending patent applications covering subject matter described in this document. The furnishing of this document does not give you any license to these patents. You can send license inquiries, in writing, to: IBM Director of Licensing, IBM Corporation, North Castle Drive Armonk, NY 10504-1785 U.S.A. The following paragraph does not apply to the United Kingdom or any other country where such provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you. This information could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time without notice. Any references in this information to non-IBM Web sites are provided for convenience only and do not in any manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of the materials for this IBM product and use of those Web sites is at your own risk. IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any obligation to you. Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products. This information contains examples of data and reports used in daily business operations. To illustrate them as completely as possible, the examples include the names of individuals, companies, brands, and products. All of these names are fictitious and any similarity to the names and addresses used by an actual business enterprise is entirely coincidental. COPYRIGHT LICENSE: This information contains sample application programs in source language, which illustrates programming techniques on various operating platforms. You may copy, modify, and distribute these sample programs in any form without payment to IBM, for the purposes of developing, using, marketing or distributing application programs conforming to the application programming interface for the operating platform for which the sample programs are written. These examples have not been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of these programs. You may copy, modify, and distribute these sample programs in any form without payment to IBM for the purposes of developing, using, marketing, or distributing application programs conforming to IBM's application programming interfaces. © Copyright IBM Corp. 2006. All rights reserved. vii Trademarks The following terms are trademarks of the International Business Machines Corporation in the United States, other countries, or both: Es erver® DB2 Connect™ Redbooks™ Eserver® DB2® RACF® Redbooks (logo) ™ Iterations® System z™ eServer™ IBM® System z9™ z/OS® IMS™ VisualAge® zSeries® Language Environment® WebSphere® z9™ MVS™ CICS® Rational® The following terms are trademarks of other companies: Enterprise JavaBeans, EJB, Java, JavaBeans, JDBC, JDK, JVM, J2EE, and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both. Excel, Microsoft, Windows, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both. UNIX is a registered trademark of The Open Group in the United States and other countries. Linux is a trademark of Linus Torvalds in the United States, other countries, or both. Other company, product, or service names may be trademarks or service marks of others. viii Java Stand-alone Applications on z/OS Volume 1

Description:
applications such as Eclipse applications, Java Applets, Java applications, JUnits, JUnit Plug-in Tests, SWT applications, and remote Java applications.
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.