Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
About Us: Strongback Consulting
• IBM Advanced Business Partner
– Rational, WebSphere, Lotus, Information Management SVP certified
– Strongly focused on Enterprise Modernization, Agile Transformations, and DevOps
– 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
www.strongback.us
Your Instructor
• Kenny Smith
– Principal Consultant @ Strongback Consulting
– Developed courses for multiple Rational IDE’s
– Past speaker at IBM’s RSDC, Innovate, and
InterConnect, and N. FL Rational User Group
– Major projects: Multiple RDz rollouts, several large
systems modernizations, many custom development
gigs
– Languages: Java, COBOL, VB, HTML, XML, SQL,
JavaScript, Perl, Python, JACL
– http://about.me/smithkenny
www.strongback.us
3
What is Java?
• Platform neutral programming language
• Concurrent, class-based, and object oriented
• Most similar to C/C++ syntax
• Compiled into bytecode, which is run by a Java Virtual Machine
– Write once, run anywhere
www.strongback.us
4
Why Java on System z?
Abundance of Java and Java skills
zAAP Processors - cost effective
workload management
Combining of traditional batch with
modern frameworks
Access to MVS using the JZOS API
www.strongback.us
5
Abundance of Java
• #1 Programming language – Tiobe– September 2015
– C ranks #2 (frequently trades places with Java)
– COBOL ranks #20
– Assembler ranks #11
• Ubiquity of architectural frameworks
– Unit testing, relational object mapping, security, dependency injection, etc.
www.strongback.us
6
Java Frameworks
Don't reinvent
the wheel, just
realign it.
Anthony J.
D'Angelo, The College
Blue Book
www.strongback.us
7
zAAP Processors – Cost Effective Solution
• A specialty z processor engine
• Attractively priced execution environment for web apps
• Simplifies and reduces server infrastructures
• Maximizes the value of your mainframe investments
• Lowers the overall cost of computing for WebSphere Application Server and
other Java
• JIT on the z has greatly increased performance on the z.
www.strongback.us
8
Where does Java run?
• The JVM runs in Unix System Services (USS)
• Source code can be compiled anywhere
• Class and jar files written to USS directories for running in the JVM
• Workloads on Java are qualified to run on zAAP processor
www.strongback.us
9
z/OS UNIX with Open Systems Interfaces
z/OS
API
(C Functions)
www.strongback.us
Language Environment
(LE)
Interactive Shell
(commands)
HFS
zFS
zFS
WLM
UNIX
System
Services
SMF
10
z/OS Unix Files
• Found in Remote Systems View
• z/OS Unix Files section
– Home = your home folder in OMVS
• Typically /u/username
– Root = / (zFS system root folder)
– Filters = everything else
• You specify the settings for the filter
• z/OS Unix shells
– Open one or more Unix shells
– Each shell separate from each other
www.strongback.us
How do I Write Java?
www.strongback.us
12
RAD And Java
• Like RDz, built on Eclipse
• Can “shell share” with RDz, providing more features than either alone
– CICS Web Service Development
– Can also shell share with Data Studio
• Highly effective editors, wizards, and visualization tools
• Includes Java code review tools (Software Analyzer)
• Designed to handle Java EE development
– Wizards for web development (JSF, JSP, Struts, etc.)
– Database development (SQL editors, JPA wizards)
– WebSphere Application Server environment
www.strongback.us
13
RDz Enterprise Tools: Unit Testing
JUnit: A unit test framework for Java
• Built into RAD / Eclipse
• Tests either pass or fail
www.strongback.us
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.
www.strongback.us
15
Rational Developer for the Enterprise 9.5
Rational Developer for the Enterprise
Rational
Application
Developer for
WebSphere
Software 9.0
Rational
Developer for
System z 9.5
Rational
Business
Developer 9.5
Rational Developer
for i 9.5
Rational
Developer for
AIX and Linux
9.5
Rational
Application
Developer
Rational
Developer for
System z
Rational Business
Developer
RPG and COBOL Tools
C/C++ Edition
RPG and COBOL +
Modernization Tools, Java
Edition
AIX COBOL
Edition
RPG and COBOL +
Modernization Tools, EGL
Edition
Rational Business Developer
www.strongback.us
Comparing Language Features
Java
COBOL
• Portable – write once run
anywhere
• Syntax specific to compiler (IBM
vs Microfocus, etc.)
• Object Oriented
• Procedural
• Connect to CICS via web services
• Call CICS directly
• No binding of DB2 required
• Must bind DB2
• Not column sensitive (> 80 chars)
• Column sensitive
• Case Sensitive
• Not case sensitive
• Strongly typed
• Considered non-typed
• Can be multi-threaded
• Single threaded
www.strongback.us
Unique Java Language Features
• Object oriented: Polymorphism, Inheritance, Composition, Encapsulation
• Garbage Collection: automated memory management
• Secure
• Interpreted: compiled to bytecode, and bytecode executed by JVM
• Objects and Classes
• Case Sensitive!
– i.e.
www.strongback.us
Customer != customer
18
www.strongback.us
19
Organizing Code: Packages vs PDS
Java: Packages
www.strongback.us
COBOL: PDS’s
20
Instantiating Variables
Java
public class YieldInfo(){
COBOL
01 yield-info.
BigDecimal startBalance;
03 start-balance
pic 9(9)v9(2)
comp.
BigDecimal yield;
03 yield
pic 9(9)v9(2)
comp.
BigDecimal interest;
03 interest
pic
comp.
int days;
03 days
pic 9(9)
comp.
int years;
03 years
pic 9(2)
comp.
v9(7)
}
www.strongback.us
21
Example Conversion
• COBOL Copybook
www.strongback.us
• Java Class
Java Primitive Data Types
Data Type
Size (in bits for numeric)
Default Value (for fields)
byte
8
0
short
16
0
int
32
0
long
64
0L
float
32 floating point
0.0f
double
64 floating point
0.0d
char
16 (Unicode)
'\u0000'
boolean
1
false
Anything else is considered an Object!
www.strongback.us
23
Other Common Data Types
• Integer – object wrapper for int
• Long – object wrapper for long
• Short – object wrapper for short
• String – object wrapper for char
• BigDecimal - complex object that handles currency
– NEVER EVER EVER use floating point arithmetic for currency!!!
www.strongback.us
24
Typical Java Class Structure
• Package (1)
• Import statements (3)
• Class declaration (5)
• Class variables (6-8)
• Constructors (10, 13)
• Methods (20, 28)
www.strongback.us
25
General Syntax
class
variable
calls the Team
default
constructor
class
name
Statements
end in
semicolon
instance
variable
name
Code blocks are
surrounded by braces
www.strongback.us
26
www.strongback.us
27
Accessing Data, and Systems
AIX
z/OS
MQ
DB2
JDBC
Java (Batch)
Web Service
CICS
www.strongback.us
Windows
MSSQL
28
Accessing DB2 Data
• Accessing z/OS DB2 Data is no different than Java on distributed
• JPA Wizards – Java Persistence Architecture
– Makes CRUD operations a breeze!
– Hardly any SQL has to be written
• JDBC – Java Database Connectivity
– Old school SQL method
• Other open source frameworks
– iBatis, Hibernate, Spring JDBC Templates, etc.
www.strongback.us
29
JZOS Java API for developers
• API = Application Programming Interface
• 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.
www.strongback.us
30
Calling JZOS Batch
MVS
JZOS JCL
Programmer
writes and
submits the JCL
Unix System Services
MC
PDS
JZOS PROC
JZOS API
Java class
JES
JVMLDMxx
www.strongback.us
Java Runtime
JZOS JCL Skeleton
Job Card
Location of the JVM
Proc
Execute the generic
proc with vars
Location of the
output
Java shell
environment setup
www.strongback.us
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
www.strongback.us
Approaches to Java Batch
WebSphere Batch
z/OS Batch Container
JZOS JVM Launcher
• JCL launches batch
program
• Programmer may still
need to code
functions not
provided by Launcher
• Example is z/OS
Batch Container
• Batch Container
provides useful
functions
• Programmer may
still need to code
functions not
provided by
Container
• Example is IBM
WebSphere Compute
Grid
• Provides batch
programming
function as services
of the platform
• Allows programmer
to focus on the
business logic and
not develop "custom
middleware" function
Robust
www.strongback.us
34
Tools for Modern Java Batch
(aka ComputeGrid)
Workbench:
Has Capability? (Y, N, Partial)
RAD
WDT
Eclipse
Y
N
N
• Brings compute and data intensive batch processing to WAS, sharing the
same business logic used by online systems.
• Framework and tools make writing, running and managing batch
applications a snap.
• Java EE based packaging and deployment.
Batch workspace project
xJCL
App
• Projects, wizards and editors streamline the
development of xJCL and batch classes.
• Deploy and submit to WAS, with job progress
integrated into the IDE’s console.
www.strongback.us
Scheduler
WAS
Container
WAS
35
Where Can I Learn More?
• Strongback Consulting’s Course Offerings:
– RDz COBOL, RDz Java (JZOS), RAD, HATS
• Our blog http://blog.strongbackconsulting.com
• All our JZOS specific links: https://delicious.com/strongback/search/jzos
• Rational software links: https://delicious.com/strongback/search/rational
• Java generic links: https://delicious.com/strongback/search/java
*** Delicious.com is a bookmark sharing site. It may be blocked by your IT department, but
allows us to share more links than we have room to list here
www.strongback.us
36
www.strongback.us
37
Subscribe to us at
http://feeds.feedburner.com/StrongbackConsulting
Discover us at:
http://www.strongback.us
Socialize with us on Facebook & LinkedIn
http://www.facebook.com/StrongbackConsulting
http://www.linkedin.com/company/290754
Watch Us at Youtube http://www.youtube.com/user/strongbackconsulting
https://vimeo.com/user7519232
Call us at: 386-232-8746
www.strongback.us
www.strongback.us
39
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
www.strongback.us
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
www.strongback.us
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)
www.strongback.us