SlideShare une entreprise Scribd logo
1  sur  50
Télécharger pour lire hors ligne
The Caffeinated Mainframer
Kenny Smith
Principal Consultant
Strongback Consulting
kenny.smith@strongback.us
twitter: @smithkenny
Matthew Hardin
Senior Consultant
mhardin@strongback.us
1
About Us: Strongback Consulting
 IBM Advanced Business Partner
– Rational, WebSphere, Lotus, Information Management SVP certified
– Strongly focused on Enterprise Modernization and application lifecycle management
– Key Industries Served: Finance, Insurance, Healthcare, Manufacturing, Government
– Rational Design Partner for HATS and other Rational enterprise modernization technologies
Discover us at:
http://www.strongback.us
Subscribe to us at
http://blog.strongbackconsulting.com
Socialize with us on Facebook & LinkedIn
http://www.facebook.com/StrongbackConsulting
http://www.linkedin.com/company/290754
Why Java on System z?
3
 Abundance of Java and Java skills
 zAAP Processors - cost effective workload
mgmt
 Combining of traditional batch with modern
frameworks
 Access to MVS using the JZOS API
Abundance of Java
 #2 Programming language – Tiobe– February 2013
–C ranks #1 (frequently trades places with Java)
–COBOL ranks #24
–Assembler ranks #19
 Ubiquity of architectural frameworks
–Unit testing, relational object mapping, security, dependency injection, etc.
 Language learning resources are abundant
–Free tutorials available on http://www.ibm.com/developerworks
–More free tutorials at Sun’s… err … <cough> Oracle’s </cough> website
–Required course of most computer science programs
4
*http://www.langpop.com/
zAAP Processors – Cost Effective Solution
 A specialty z processor engine
 Provides an attractively priced execution environment for web-based
applications and SOA-based technologies, such as XML and Java
 Simplifies and reduces server infrastructures
 Maximizes the value of your mainframe investments
–increased system productivity by reducing the demands and capacity
requirements on general purpose processors which may then be available for
reallocation to other mainframe workloads.
 Lowers the overall cost of computing for WebSphere Application Server
and other Java technology-based applications
–hardware, software and maintenance savings.
 JIT on the z has greatly increased performance on the z.
5
WebSphere App Server for z/OS
Exploit the benefits of z/OS
 WLM
–configure down to the request level, not just app level with special tags
 SAF (RACF) - provides security definition and security
enforcement for the product
 RRS—used for global syncpoint coordination between WAS z/OS
and other participants in two-phase commit global transactions
 Cross memory communications
–JDBC type 2 uses this for comms to DB2
6
Java Batch Processing in OLTP Runtime
 Running Java batch in the same execution runtime as Java OLTP
– provides an opportunity to mix and manage the two processing types together under the same
management model.
 WebSphere Application Server allows the WAS platform to mix and manage the two
workload types.
 WebSphere Compute Grid now included in WebSphere App Server 8.5
7
Web Container EJB Container Batch Container
WebSphere Application Server
WebSphere Modern Batch
 Container managed execution of batch jobs: Provides the structure and support function
that Java batch applications require, and helps you avoid the “custom middleware trap.”
 Job control interface: An XML file that describes the Java class files that are used in a
batch step and the steps that are included in the batch job.
8
 Job checkpoint and restart
capability: Ability to create
checkpoints on the basis of record
count or time. This enables
restarting a job from a known
checkpoint.
 Common batch data stream
(BDS): Contains functions that
abstract data into easily accessible
record formats so that the batch
programming can focus on the
business functions rather than
basic code that reads and writes
the data.
WebSphere Application v8.5 Infrastructure
What’s New…
IBM Workload Deployer
IBM JVM
WebSphere Application Server
Foundation
WebSphere
eXtreme Scale
Rational
Application
Developer
Tools
Runtime
WAS Dev
Tools for
Eclipse
DataPower
XC10
WebSphere
Compute Grid
WebSphere
Virtual
Enterprise
Intelligent
Management
Pack
Pattern for
Web
Applications
WAS HV
Eclipse
Fit for
Purpose
Application
Foundation
Cloud &
Operational
Management
& Efficiency
IBM
Worklight
Studio
WebSphere Application Server V8.5
( WVE and WCG Included with
WAS ND and WAS for zOS
&
Liberty profile with all editions)
WAS HV V8.5
(Intelligent Management)
Mobile Apps
(Web, Hybrid,
Native)
IBM Worklight Server
Eclipse
IBM PureApplication System
Intelligent Routing
Health Management
Application Edition
Management
Dynamic Clustering
Batch processing
WebSphere Batch
WebSphere Virtual Enterprise
Refresher on V8.5 – Intelligent Management
Enables interruption free application rollout
Monitors the status of your applications with the
ability to sense and respond to problem areas
Dynamically provision and start/stop new
instances of app server based on workload
demands
Ensures priority is given to business critical
applications via administrator defined rules
Support that leverages your existing Java online
transaction processing (OLTP) infrastructure to
support new Java batch workloads
Batch
Modules
Better TCO through management efficiency and performance, Intelligent Management
delivers the ability to sense and respond quickly to changes
Java Frameworks
Don't reinvent
the wheel, just
realign it.
Anthony J. D'Angelo, The
College Blue Book
11
JNI = Java Native Interface
 The Java Native Interface is a programming framework that enables Java code running in a
Java Virtual Machine to call, and to be called by, native applications and libraries written in
other languages such as C, C++ and assembly.
 Get a little close to the metal with JNI
 Extend functionality of JZOS, or write functions to cover custom software
12
JZOS Java API for developers
 A framework acquired by IBM
 Now part of the IBM JVM
 Preferred method for MVS file access, data type conversion,
MVS Console, etc
 Includes a batch launcher
 Uses JNI / C to access MVS datasets, VSAM files, QSAM
files, etc.
13
Calling Java in batch
 BPXBATCH
–The “original” batch java caller.
–Best to run non-Java shell commands on Unix System Services
–The STDOUT and STDERR DD names are not allocated as MVS data
sets
 JZOS
–The modern batch caller
–Uses a specific JVM load module
JZOS Batch
 Jobs are zAAP eligible
 IDE Integration with RDz, RAD
 Can run Java based servers as started tasks
 Full integration into the Job Entry System
 Jobs run in the same address space
 Support for DD statements
 Move stdin, stdout, and stderr to an MVS Dataset
 Gives a valid return code (other than just 1)
Unix System Services
JZOS API
MVS
Calling JZOS Batch
JVMLDMxx
JZOS PROC
JZOS JCL
Java Runtime
Java class
PDS
JES
MC
Programmer
writes and
submits the
JCL
JZOS JCL Skeleton
Job Card
Location of the
JVM Proc
Execute the
generic proc with
vars
Location of the
output
Java shell
environment setup
Java Generic PROC
 A parameterized procedure makes it easier to standardize the
environment
 A sample is included in the JDK for z/OS
 Found under /usr/lpp/java/J7.0_64/mvstools/samples/jcl
–Good for most usage, customize for a given specific instance
Class API Overview:
 Access MVS Datasets
–com.ibm.jzos.Zfile – thin wrapper for JNI calls to C I/O library
–com.ibm.jzos.FileFactory - platform-portable file access
 Access HFS/zFS files
–java.io, java.nio – standard Java API
–com.ibm.jzos.FileFactory
 Access the MVS Console
–com.ibm.jzos.MvsConsole – interface to MVS console and job log
 Various z/OS native functions
–com.ibm.jzos.ZUtil
ZFile
com.ibm.jzos.Zfile
 Thin JNI wrapper for "C" library I/O routines
 Constructor: file name and a mode
–zFile = new ZFile(clusterName, "ab+,type=record");
–ZFile dd = new ZFile("//DD:MYDD", "r");
–ZFile dsn = new ZFile("//'SYS1.HELP(ACCOUNT)'",
"rt,type=record");
 File name can be a PDS, a PDS member, a DD name, or a VSAM cluster
Accessing VSAM Data
 Use Zfile for KSDS, LSDS type VSAM files
String filename = "//DD:KSDS";
String options = "ab+,type=record";
int lrecl = 80;
int keyLen = 8;
ZFile zfile = new ZFile(filename, options)
 Methods:
– write(), locate(), read(), update
Zfile: Transaction mode
 Open a transaction record dataset:
–ZFile dsn = new ZFile("//SEQ", “rb,type=record,noseek");
–Opens a transaction record for read in binary mode
–“noseek” provides optimal performance for sequential access
FileFactory
• Platform-portable BufferedReader, BufferedWriter, InputStream, or
OutputStream on a text file or a MVS dataset.
rdr = FileFactory.newBufferedReader(“//ZNDVR.PROCLIB”);
wtr = FileFactory.newBufferedWriter(“/home/proclib.txt”);
• Examples:
–/etc/profile
–//DD:INPUT
–//'SYS1.MACLIB(ABEND)'
–//MY.DATASET
Accessing ZFS/HFS Data
 Use java.io packages
–Just like accessing distributed data
 java.nio
–Improved performance in the areas of buffer management, scalable network and
file I/O, character-set support, and regular-expression matching
 Use FileFactory if you need portability
–Test locally on Windows , run in dev/prod against PDS/VSAM data
Data Type Conversion
 ByteUtil
–Use to convert bytes from packed decimal to Java long, integer, etc
 AssemblerDataTypeFactory, CobolDataTypeFactory
–Works as a Factory pattern to create convenience class objects
 Convenience classes for conversion to/from Packed Decimals:
–PackedDecimalAsBigDecimalField
–PackedDecimalAsBigIntegerField
–PackedDecimalAsIntField
–PackedDecimalAsLongField
Creating Data Object from Copybooks
 JZOS Record Generator Class
–Found in /<cics_installation_directory>/cics/jzos_recgen.jar
–com.ibm.jzos.recordgen.cobol.RecordClassGenerator
 Creates convenience classes that represent data in Copybooks
 Uses com.ibm.jzos.fields package to get/set data
 Much faster than hand coding
 less error prone
 Run from JCL Batch, or USS command line
Example Conversion
COBOL Copybook Java Class
MvsConsole Operations
 MvsConsole.wto = write to operator
– Writes to the system log file in z/OS
 MvsConsole.registerMvsCommandCallback Register call back commands
– Allows running batch jobs to receive commands from the system operator
– start (S) , stop (P) , modify (F)
Access Method Services (IDCAMS)
 IDCAMS is primarily used to manage VSAM Files
– Can also access catalog facilities
 Typically used via JCL files, but can be called using Java (via JZOS)
Getting the JZOS Jar
 Included in the IBM Java SDK for z/OS
 Download the JAR file from /usr/lpp/java/J6.0/lib/ext/ibmjzos.jar
– FTP
– …or RDz to drag/drop to your project
 Put in lib folder of your project
 Or create a user library
 Must be in classpath at least
Setup the project for usage
 User library makes it easy to reuse the JAR file for multiple projects
 During export, the jar is copied with the project artifacts
 Must have this jar for syntax check and code assist of JZOS objects!
Rational Developer for the Enterprise Tooling
32
Rational Developer for the Enterprise 9.0
Rational Developer for the Enterprise
Rational
Application
Developer for
WebSphere
Software 9.0
Rational
Application
Developer
Rational
Developer for
System z 9.0
Rational
Developer for
System z
Rational
Developer for
AIX and Linux
9.0
C/C++ Edition
AIX COBOL
Edition
Rational Developer
for i 9.0
RPG and COBOL Tools
RPG and COBOL +
Modernization Tools, Java
Edition
RPG and COBOL +
Modernization Tools, EGL
Edition
Rational Business Developer
Rational
Business
Developer 9.0
Rational Business
Developer
RDz Enterprise Tools: Software Analysis
 Allows you to run a static analysis of the resources with which you are working to detect
violations of rules and rule categories.
 Detects violations of specific programming rules and rule categories and generates a report
in the Software Analyzer Results view
 Code can be viewed in a single interface to analyze each component in a multi-language
application…. Java, Cobol and others.
35
RDz Enterprise Tools: Unit Testing
JUnit: A unit test framework for Java
 Built into RAD / Eclipse
 Tests either pass or fail
Testing in isolation: using Mockito
Mockito is a Java based mocking framework
 Only stub what you need, no need to stub everything
 Clean and simple syntax
 All required documentation can be found in the Javadoc
– EXCELLENT documentation!
– A great example of how to do Java doc right!
 Can also create partial mocks
RDz Enterprise Tools: Refactoring
38
Refactoring: make system-wide code changes without
affecting the behavior of the program.
Refactoring commands are available from the context
menus of several Java views (e.g. Package Explorer,
Outline) and editors. Many "apparently simple"
commands, such as Move and Rename, are actually
refactoring operations, since moving and renaming Java
elements often require changes in dependent files.
• Extract a class, method, constant or local variable
• Rename a method, variable or class
• Change a method signature
• Many, many other refactoring actions
Operations can be previewed for all of the changes
resulting from a refactoring action before you choose to
carry them out.
Can be performed by scripts.
Code Coverage
 Determines what is tested
 Answers the question “Have
I tested enough?”
 Enforces governance
among the developers for
unit testing
39
Code Coverage
40
You can customize acceptable coverage levels:
• Type coverage: The percentage of Java types that are
covered in a class
• Method coverage: The percentage of methods that are
covered in a class
• Line coverage: The percentage of lines of code that are
covered in the class file
• Block coverage: The percentage of blocks that are
covered in a class file. A block refers to an executable
unit.
Custom filters control what classes get instrumented in
your project (i.e. filter out POJO classes, etc)
Code Coverage statistics available in multiple views
41
• Java-based, platform-independent, open source build tool
• Similar to the make tool used in C programming.
• Platform independent,
• Build your projects on any Java platform
• Trivia: ANT is an acronym for “Another Neat Tool”
42
RDz Enterprise Tools: Automation: Using Ant
ANT View
 Similar to Outline view
 Open build files and double click
targets to run
 Different tool bar options
44
Gotchas
 JZOS calls run through the ISPF gateway
–Multi-dialog type commands cannot be used (i.e. calling REXX functions)
–Keep in mind security and custom user security exits
 Don’t try to substitute all your code with Java
–Some apps are better as COBOL, HLASM, or LE
 Use the correct JZOS jar for what you expect to run in PROD
–the API has changed slightly from release to release
–Don’t run Java 7 JZOS jar on a Java 6 JVM
45
Best Practices
 Make use of the RAD Java tooling
– Refactoring
– Unit Testing
– ANT for build automation, compilation, unit testing, packaging, and deployment
 Let JZOS API do the data type conversions
– Understand the Java BigDecimal class and how it relates to currency
 Unit testing:
– Use Mockito to mock non-JZOS calls
– Use PowerMock to mock static JZOS calls (Mockito cannot do this, but it otherwise easier to use)
 Modify the Java PROC to suit your environment
– You don’t have to use the one provided
– You can create different procs for different situations
 Use Team Concert for SCM of the entire application
– Batch JCL scripts, Java classes, web projects
– RTC can do build, promotion & deployment on ALL the artifacts at once
46
Key points to take away
 There are many programming options for Java on z/OS
 Java is cost-competitive with COBOL, HLASM, and PL/I
loads
 Java batch allows you to mix and match batch and OLTP
workloads
 Batch loads can be reworked and be more flexible for
your business needs
 The JZOS API gives the developer a full range of access
to many MVS subsystems
 Rational Developer for the Enterprise is a complete
package for Java development on system z
47
48
Resources
 Check out all our links for our presentations, including this one
–https://delicious.com/strongback/tag_bundle/Innovate2013
–“one link to rule them all”
49
About Us: Strongback Consulting
 IBM Advanced Business Partner
– Rational, WebSphere, Lotus, Information Management SVP certified
– Strongly focused on Enterprise Modernization and application lifecycle management
– Key Industries Served: Finance, Insurance, Healthcare, Manufacturing, Government
– Rational Design Partner for HATS and other Rational enterprise modernization technologies
Discover us at:
http://www.strongback.us
Subscribe to us at
http://blog.strongbackconsulting.com
Socialize with us on Facebook & LinkedIn
http://www.facebook.com/StrongbackConsulting
http://www.linkedin.com/company/290754

Contenu connexe

Plus de Strongback Consulting

IBM Collaborative Lifecycle Management Solution for DevOps v6
IBM Collaborative Lifecycle Management Solution for DevOps v6IBM Collaborative Lifecycle Management Solution for DevOps v6
IBM Collaborative Lifecycle Management Solution for DevOps v6Strongback Consulting
 
Tips for Developing and Testing IBM HATS Applications
Tips for Developing and Testing IBM HATS ApplicationsTips for Developing and Testing IBM HATS Applications
Tips for Developing and Testing IBM HATS ApplicationsStrongback Consulting
 
Patterns and Antipatterns for Adopting IBM DevOps Tools
Patterns and Antipatterns for Adopting IBM DevOps ToolsPatterns and Antipatterns for Adopting IBM DevOps Tools
Patterns and Antipatterns for Adopting IBM DevOps ToolsStrongback Consulting
 
How Arcad Skipper pack works for the IBM i
How Arcad Skipper pack works for the IBM iHow Arcad Skipper pack works for the IBM i
How Arcad Skipper pack works for the IBM iStrongback Consulting
 
Being Smart about C/C++ Development on AIX and Linux
Being Smart about C/C++ Development on AIX and Linux Being Smart about C/C++ Development on AIX and Linux
Being Smart about C/C++ Development on AIX and Linux Strongback Consulting
 
How to become a Rational Developer for IBM i Power User
How to become a Rational Developer for IBM i Power UserHow to become a Rational Developer for IBM i Power User
How to become a Rational Developer for IBM i Power UserStrongback Consulting
 
Software Archaeology with RDz and RAA
Software Archaeology with RDz and RAASoftware Archaeology with RDz and RAA
Software Archaeology with RDz and RAAStrongback Consulting
 
Teaching old dogs new tricks with Rational Developer for System i
Teaching old dogs new tricks with Rational Developer for System iTeaching old dogs new tricks with Rational Developer for System i
Teaching old dogs new tricks with Rational Developer for System iStrongback Consulting
 
IBM Innovate 2013: Making Rational HATS a Strategic Investment
IBM Innovate 2013: Making Rational HATS a Strategic InvestmentIBM Innovate 2013: Making Rational HATS a Strategic Investment
IBM Innovate 2013: Making Rational HATS a Strategic InvestmentStrongback Consulting
 
How a tactical HATS solution became a strategic asset - A Customer Story
How a tactical HATS solution became a strategic asset - A Customer StoryHow a tactical HATS solution became a strategic asset - A Customer Story
How a tactical HATS solution became a strategic asset - A Customer StoryStrongback Consulting
 
Rational collaborative-lifecycle-management-2012
Rational collaborative-lifecycle-management-2012Rational collaborative-lifecycle-management-2012
Rational collaborative-lifecycle-management-2012Strongback Consulting
 
Build Smarter User Interfaces for Legacy Applications with IBM Rational Host ...
Build Smarter User Interfaces for Legacy Applications with IBM Rational Host ...Build Smarter User Interfaces for Legacy Applications with IBM Rational Host ...
Build Smarter User Interfaces for Legacy Applications with IBM Rational Host ...Strongback Consulting
 
Collaborative Lifecycle Managmenent - an Introduction
Collaborative Lifecycle Managmenent - an IntroductionCollaborative Lifecycle Managmenent - an Introduction
Collaborative Lifecycle Managmenent - an IntroductionStrongback Consulting
 
IBM Innovate 2011- What every System i Developer Needs to Know
IBM Innovate 2011- What every System i Developer Needs to KnowIBM Innovate 2011- What every System i Developer Needs to Know
IBM Innovate 2011- What every System i Developer Needs to KnowStrongback Consulting
 
Using Dojo Javascript Framework with Rational HATS
Using Dojo Javascript Framework with Rational HATSUsing Dojo Javascript Framework with Rational HATS
Using Dojo Javascript Framework with Rational HATSStrongback Consulting
 

Plus de Strongback Consulting (20)

IBM Collaborative Lifecycle Management Solution for DevOps v6
IBM Collaborative Lifecycle Management Solution for DevOps v6IBM Collaborative Lifecycle Management Solution for DevOps v6
IBM Collaborative Lifecycle Management Solution for DevOps v6
 
Tips for Developing and Testing IBM HATS Applications
Tips for Developing and Testing IBM HATS ApplicationsTips for Developing and Testing IBM HATS Applications
Tips for Developing and Testing IBM HATS Applications
 
Patterns and Antipatterns for Adopting IBM DevOps Tools
Patterns and Antipatterns for Adopting IBM DevOps ToolsPatterns and Antipatterns for Adopting IBM DevOps Tools
Patterns and Antipatterns for Adopting IBM DevOps Tools
 
How Arcad Skipper pack works for the IBM i
How Arcad Skipper pack works for the IBM iHow Arcad Skipper pack works for the IBM i
How Arcad Skipper pack works for the IBM i
 
Being Smart about C/C++ Development on AIX and Linux
Being Smart about C/C++ Development on AIX and Linux Being Smart about C/C++ Development on AIX and Linux
Being Smart about C/C++ Development on AIX and Linux
 
How to become a Rational Developer for IBM i Power User
How to become a Rational Developer for IBM i Power UserHow to become a Rational Developer for IBM i Power User
How to become a Rational Developer for IBM i Power User
 
Software Archaeology with RDz and RAA
Software Archaeology with RDz and RAASoftware Archaeology with RDz and RAA
Software Archaeology with RDz and RAA
 
IBM Rational HATS Overview 2013
IBM Rational HATS Overview 2013IBM Rational HATS Overview 2013
IBM Rational HATS Overview 2013
 
Teaching old dogs new tricks with Rational Developer for System i
Teaching old dogs new tricks with Rational Developer for System iTeaching old dogs new tricks with Rational Developer for System i
Teaching old dogs new tricks with Rational Developer for System i
 
IBM Innovate 2013: Making Rational HATS a Strategic Investment
IBM Innovate 2013: Making Rational HATS a Strategic InvestmentIBM Innovate 2013: Making Rational HATS a Strategic Investment
IBM Innovate 2013: Making Rational HATS a Strategic Investment
 
Linux 101
Linux 101Linux 101
Linux 101
 
How a tactical HATS solution became a strategic asset - A Customer Story
How a tactical HATS solution became a strategic asset - A Customer StoryHow a tactical HATS solution became a strategic asset - A Customer Story
How a tactical HATS solution became a strategic asset - A Customer Story
 
Rational collaborative-lifecycle-management-2012
Rational collaborative-lifecycle-management-2012Rational collaborative-lifecycle-management-2012
Rational collaborative-lifecycle-management-2012
 
Build Smarter User Interfaces for Legacy Applications with IBM Rational Host ...
Build Smarter User Interfaces for Legacy Applications with IBM Rational Host ...Build Smarter User Interfaces for Legacy Applications with IBM Rational Host ...
Build Smarter User Interfaces for Legacy Applications with IBM Rational Host ...
 
Collaborative Quality Management
Collaborative Quality ManagementCollaborative Quality Management
Collaborative Quality Management
 
Rational HATS and HIS v8 Overview
Rational HATS and HIS v8 OverviewRational HATS and HIS v8 Overview
Rational HATS and HIS v8 Overview
 
Collaborative Lifecycle Managmenent - an Introduction
Collaborative Lifecycle Managmenent - an IntroductionCollaborative Lifecycle Managmenent - an Introduction
Collaborative Lifecycle Managmenent - an Introduction
 
IBM Innovate 2011- What every System i Developer Needs to Know
IBM Innovate 2011- What every System i Developer Needs to KnowIBM Innovate 2011- What every System i Developer Needs to Know
IBM Innovate 2011- What every System i Developer Needs to Know
 
Rational HATS overview 7.5.1
Rational HATS overview 7.5.1Rational HATS overview 7.5.1
Rational HATS overview 7.5.1
 
Using Dojo Javascript Framework with Rational HATS
Using Dojo Javascript Framework with Rational HATSUsing Dojo Javascript Framework with Rational HATS
Using Dojo Javascript Framework with Rational HATS
 

Dernier

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 

Dernier (20)

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 

The caffeinated mainframer

  • 1. The Caffeinated Mainframer Kenny Smith Principal Consultant Strongback Consulting kenny.smith@strongback.us twitter: @smithkenny Matthew Hardin Senior Consultant mhardin@strongback.us 1
  • 2. About Us: Strongback Consulting  IBM Advanced Business Partner – Rational, WebSphere, Lotus, Information Management SVP certified – Strongly focused on Enterprise Modernization and application lifecycle management – Key Industries Served: Finance, Insurance, Healthcare, Manufacturing, Government – Rational Design Partner for HATS and other Rational enterprise modernization technologies Discover us at: http://www.strongback.us Subscribe to us at http://blog.strongbackconsulting.com Socialize with us on Facebook & LinkedIn http://www.facebook.com/StrongbackConsulting http://www.linkedin.com/company/290754
  • 3. Why Java on System z? 3  Abundance of Java and Java skills  zAAP Processors - cost effective workload mgmt  Combining of traditional batch with modern frameworks  Access to MVS using the JZOS API
  • 4. Abundance of Java  #2 Programming language – Tiobe– February 2013 –C ranks #1 (frequently trades places with Java) –COBOL ranks #24 –Assembler ranks #19  Ubiquity of architectural frameworks –Unit testing, relational object mapping, security, dependency injection, etc.  Language learning resources are abundant –Free tutorials available on http://www.ibm.com/developerworks –More free tutorials at Sun’s… err … <cough> Oracle’s </cough> website –Required course of most computer science programs 4 *http://www.langpop.com/
  • 5. zAAP Processors – Cost Effective Solution  A specialty z processor engine  Provides an attractively priced execution environment for web-based applications and SOA-based technologies, such as XML and Java  Simplifies and reduces server infrastructures  Maximizes the value of your mainframe investments –increased system productivity by reducing the demands and capacity requirements on general purpose processors which may then be available for reallocation to other mainframe workloads.  Lowers the overall cost of computing for WebSphere Application Server and other Java technology-based applications –hardware, software and maintenance savings.  JIT on the z has greatly increased performance on the z. 5
  • 6. WebSphere App Server for z/OS Exploit the benefits of z/OS  WLM –configure down to the request level, not just app level with special tags  SAF (RACF) - provides security definition and security enforcement for the product  RRS—used for global syncpoint coordination between WAS z/OS and other participants in two-phase commit global transactions  Cross memory communications –JDBC type 2 uses this for comms to DB2 6
  • 7. Java Batch Processing in OLTP Runtime  Running Java batch in the same execution runtime as Java OLTP – provides an opportunity to mix and manage the two processing types together under the same management model.  WebSphere Application Server allows the WAS platform to mix and manage the two workload types.  WebSphere Compute Grid now included in WebSphere App Server 8.5 7 Web Container EJB Container Batch Container WebSphere Application Server
  • 8. WebSphere Modern Batch  Container managed execution of batch jobs: Provides the structure and support function that Java batch applications require, and helps you avoid the “custom middleware trap.”  Job control interface: An XML file that describes the Java class files that are used in a batch step and the steps that are included in the batch job. 8  Job checkpoint and restart capability: Ability to create checkpoints on the basis of record count or time. This enables restarting a job from a known checkpoint.  Common batch data stream (BDS): Contains functions that abstract data into easily accessible record formats so that the batch programming can focus on the business functions rather than basic code that reads and writes the data.
  • 9. WebSphere Application v8.5 Infrastructure What’s New… IBM Workload Deployer IBM JVM WebSphere Application Server Foundation WebSphere eXtreme Scale Rational Application Developer Tools Runtime WAS Dev Tools for Eclipse DataPower XC10 WebSphere Compute Grid WebSphere Virtual Enterprise Intelligent Management Pack Pattern for Web Applications WAS HV Eclipse Fit for Purpose Application Foundation Cloud & Operational Management & Efficiency IBM Worklight Studio WebSphere Application Server V8.5 ( WVE and WCG Included with WAS ND and WAS for zOS & Liberty profile with all editions) WAS HV V8.5 (Intelligent Management) Mobile Apps (Web, Hybrid, Native) IBM Worklight Server Eclipse IBM PureApplication System
  • 10. Intelligent Routing Health Management Application Edition Management Dynamic Clustering Batch processing WebSphere Batch WebSphere Virtual Enterprise Refresher on V8.5 – Intelligent Management Enables interruption free application rollout Monitors the status of your applications with the ability to sense and respond to problem areas Dynamically provision and start/stop new instances of app server based on workload demands Ensures priority is given to business critical applications via administrator defined rules Support that leverages your existing Java online transaction processing (OLTP) infrastructure to support new Java batch workloads Batch Modules Better TCO through management efficiency and performance, Intelligent Management delivers the ability to sense and respond quickly to changes
  • 11. Java Frameworks Don't reinvent the wheel, just realign it. Anthony J. D'Angelo, The College Blue Book 11
  • 12. JNI = Java Native Interface  The Java Native Interface is a programming framework that enables Java code running in a Java Virtual Machine to call, and to be called by, native applications and libraries written in other languages such as C, C++ and assembly.  Get a little close to the metal with JNI  Extend functionality of JZOS, or write functions to cover custom software 12
  • 13. JZOS Java API for developers  A framework acquired by IBM  Now part of the IBM JVM  Preferred method for MVS file access, data type conversion, MVS Console, etc  Includes a batch launcher  Uses JNI / C to access MVS datasets, VSAM files, QSAM files, etc. 13
  • 14. Calling Java in batch  BPXBATCH –The “original” batch java caller. –Best to run non-Java shell commands on Unix System Services –The STDOUT and STDERR DD names are not allocated as MVS data sets  JZOS –The modern batch caller –Uses a specific JVM load module
  • 15. JZOS Batch  Jobs are zAAP eligible  IDE Integration with RDz, RAD  Can run Java based servers as started tasks  Full integration into the Job Entry System  Jobs run in the same address space  Support for DD statements  Move stdin, stdout, and stderr to an MVS Dataset  Gives a valid return code (other than just 1)
  • 16. Unix System Services JZOS API MVS Calling JZOS Batch JVMLDMxx JZOS PROC JZOS JCL Java Runtime Java class PDS JES MC Programmer writes and submits the JCL
  • 17. JZOS JCL Skeleton Job Card Location of the JVM Proc Execute the generic proc with vars Location of the output Java shell environment setup
  • 18. Java Generic PROC  A parameterized procedure makes it easier to standardize the environment  A sample is included in the JDK for z/OS  Found under /usr/lpp/java/J7.0_64/mvstools/samples/jcl –Good for most usage, customize for a given specific instance
  • 19. Class API Overview:  Access MVS Datasets –com.ibm.jzos.Zfile – thin wrapper for JNI calls to C I/O library –com.ibm.jzos.FileFactory - platform-portable file access  Access HFS/zFS files –java.io, java.nio – standard Java API –com.ibm.jzos.FileFactory  Access the MVS Console –com.ibm.jzos.MvsConsole – interface to MVS console and job log  Various z/OS native functions –com.ibm.jzos.ZUtil
  • 20. ZFile com.ibm.jzos.Zfile  Thin JNI wrapper for "C" library I/O routines  Constructor: file name and a mode –zFile = new ZFile(clusterName, "ab+,type=record"); –ZFile dd = new ZFile("//DD:MYDD", "r"); –ZFile dsn = new ZFile("//'SYS1.HELP(ACCOUNT)'", "rt,type=record");  File name can be a PDS, a PDS member, a DD name, or a VSAM cluster
  • 21. Accessing VSAM Data  Use Zfile for KSDS, LSDS type VSAM files String filename = "//DD:KSDS"; String options = "ab+,type=record"; int lrecl = 80; int keyLen = 8; ZFile zfile = new ZFile(filename, options)  Methods: – write(), locate(), read(), update
  • 22. Zfile: Transaction mode  Open a transaction record dataset: –ZFile dsn = new ZFile("//SEQ", “rb,type=record,noseek"); –Opens a transaction record for read in binary mode –“noseek” provides optimal performance for sequential access
  • 23. FileFactory • Platform-portable BufferedReader, BufferedWriter, InputStream, or OutputStream on a text file or a MVS dataset. rdr = FileFactory.newBufferedReader(“//ZNDVR.PROCLIB”); wtr = FileFactory.newBufferedWriter(“/home/proclib.txt”); • Examples: –/etc/profile –//DD:INPUT –//'SYS1.MACLIB(ABEND)' –//MY.DATASET
  • 24. Accessing ZFS/HFS Data  Use java.io packages –Just like accessing distributed data  java.nio –Improved performance in the areas of buffer management, scalable network and file I/O, character-set support, and regular-expression matching  Use FileFactory if you need portability –Test locally on Windows , run in dev/prod against PDS/VSAM data
  • 25. Data Type Conversion  ByteUtil –Use to convert bytes from packed decimal to Java long, integer, etc  AssemblerDataTypeFactory, CobolDataTypeFactory –Works as a Factory pattern to create convenience class objects  Convenience classes for conversion to/from Packed Decimals: –PackedDecimalAsBigDecimalField –PackedDecimalAsBigIntegerField –PackedDecimalAsIntField –PackedDecimalAsLongField
  • 26. Creating Data Object from Copybooks  JZOS Record Generator Class –Found in /<cics_installation_directory>/cics/jzos_recgen.jar –com.ibm.jzos.recordgen.cobol.RecordClassGenerator  Creates convenience classes that represent data in Copybooks  Uses com.ibm.jzos.fields package to get/set data  Much faster than hand coding  less error prone  Run from JCL Batch, or USS command line
  • 28. MvsConsole Operations  MvsConsole.wto = write to operator – Writes to the system log file in z/OS  MvsConsole.registerMvsCommandCallback Register call back commands – Allows running batch jobs to receive commands from the system operator – start (S) , stop (P) , modify (F)
  • 29. Access Method Services (IDCAMS)  IDCAMS is primarily used to manage VSAM Files – Can also access catalog facilities  Typically used via JCL files, but can be called using Java (via JZOS)
  • 30. Getting the JZOS Jar  Included in the IBM Java SDK for z/OS  Download the JAR file from /usr/lpp/java/J6.0/lib/ext/ibmjzos.jar – FTP – …or RDz to drag/drop to your project  Put in lib folder of your project  Or create a user library  Must be in classpath at least
  • 31. Setup the project for usage  User library makes it easy to reuse the JAR file for multiple projects  During export, the jar is copied with the project artifacts  Must have this jar for syntax check and code assist of JZOS objects!
  • 32. Rational Developer for the Enterprise Tooling 32
  • 33. Rational Developer for the Enterprise 9.0 Rational Developer for the Enterprise Rational Application Developer for WebSphere Software 9.0 Rational Application Developer Rational Developer for System z 9.0 Rational Developer for System z Rational Developer for AIX and Linux 9.0 C/C++ Edition AIX COBOL Edition Rational Developer for i 9.0 RPG and COBOL Tools RPG and COBOL + Modernization Tools, Java Edition RPG and COBOL + Modernization Tools, EGL Edition Rational Business Developer Rational Business Developer 9.0 Rational Business Developer
  • 34.
  • 35. RDz Enterprise Tools: Software Analysis  Allows you to run a static analysis of the resources with which you are working to detect violations of rules and rule categories.  Detects violations of specific programming rules and rule categories and generates a report in the Software Analyzer Results view  Code can be viewed in a single interface to analyze each component in a multi-language application…. Java, Cobol and others. 35
  • 36. RDz Enterprise Tools: Unit Testing JUnit: A unit test framework for Java  Built into RAD / Eclipse  Tests either pass or fail
  • 37. Testing in isolation: using Mockito Mockito is a Java based mocking framework  Only stub what you need, no need to stub everything  Clean and simple syntax  All required documentation can be found in the Javadoc – EXCELLENT documentation! – A great example of how to do Java doc right!  Can also create partial mocks
  • 38. RDz Enterprise Tools: Refactoring 38 Refactoring: make system-wide code changes without affecting the behavior of the program. Refactoring commands are available from the context menus of several Java views (e.g. Package Explorer, Outline) and editors. Many "apparently simple" commands, such as Move and Rename, are actually refactoring operations, since moving and renaming Java elements often require changes in dependent files. • Extract a class, method, constant or local variable • Rename a method, variable or class • Change a method signature • Many, many other refactoring actions Operations can be previewed for all of the changes resulting from a refactoring action before you choose to carry them out. Can be performed by scripts.
  • 39. Code Coverage  Determines what is tested  Answers the question “Have I tested enough?”  Enforces governance among the developers for unit testing 39
  • 40. Code Coverage 40 You can customize acceptable coverage levels: • Type coverage: The percentage of Java types that are covered in a class • Method coverage: The percentage of methods that are covered in a class • Line coverage: The percentage of lines of code that are covered in the class file • Block coverage: The percentage of blocks that are covered in a class file. A block refers to an executable unit. Custom filters control what classes get instrumented in your project (i.e. filter out POJO classes, etc)
  • 41. Code Coverage statistics available in multiple views 41
  • 42. • Java-based, platform-independent, open source build tool • Similar to the make tool used in C programming. • Platform independent, • Build your projects on any Java platform • Trivia: ANT is an acronym for “Another Neat Tool” 42 RDz Enterprise Tools: Automation: Using Ant
  • 43. ANT View  Similar to Outline view  Open build files and double click targets to run  Different tool bar options
  • 44. 44
  • 45. Gotchas  JZOS calls run through the ISPF gateway –Multi-dialog type commands cannot be used (i.e. calling REXX functions) –Keep in mind security and custom user security exits  Don’t try to substitute all your code with Java –Some apps are better as COBOL, HLASM, or LE  Use the correct JZOS jar for what you expect to run in PROD –the API has changed slightly from release to release –Don’t run Java 7 JZOS jar on a Java 6 JVM 45
  • 46. Best Practices  Make use of the RAD Java tooling – Refactoring – Unit Testing – ANT for build automation, compilation, unit testing, packaging, and deployment  Let JZOS API do the data type conversions – Understand the Java BigDecimal class and how it relates to currency  Unit testing: – Use Mockito to mock non-JZOS calls – Use PowerMock to mock static JZOS calls (Mockito cannot do this, but it otherwise easier to use)  Modify the Java PROC to suit your environment – You don’t have to use the one provided – You can create different procs for different situations  Use Team Concert for SCM of the entire application – Batch JCL scripts, Java classes, web projects – RTC can do build, promotion & deployment on ALL the artifacts at once 46
  • 47. Key points to take away  There are many programming options for Java on z/OS  Java is cost-competitive with COBOL, HLASM, and PL/I loads  Java batch allows you to mix and match batch and OLTP workloads  Batch loads can be reworked and be more flexible for your business needs  The JZOS API gives the developer a full range of access to many MVS subsystems  Rational Developer for the Enterprise is a complete package for Java development on system z 47
  • 48. 48
  • 49. Resources  Check out all our links for our presentations, including this one –https://delicious.com/strongback/tag_bundle/Innovate2013 –“one link to rule them all” 49
  • 50. About Us: Strongback Consulting  IBM Advanced Business Partner – Rational, WebSphere, Lotus, Information Management SVP certified – Strongly focused on Enterprise Modernization and application lifecycle management – Key Industries Served: Finance, Insurance, Healthcare, Manufacturing, Government – Rational Design Partner for HATS and other Rational enterprise modernization technologies Discover us at: http://www.strongback.us Subscribe to us at http://blog.strongbackconsulting.com Socialize with us on Facebook & LinkedIn http://www.facebook.com/StrongbackConsulting http://www.linkedin.com/company/290754