MainframeChallenge2013Part2 PDF
MainframeChallenge2013Part2 PDF
Part Two
Time to complete about six to eight hours
Your colleagues have started to develop the prototype but are struggling to get it working. The aim of
this part of the challenge is to successfully complete the prototype so that you can simulate a payment
on your credit card.
We are going to use credit cards with a name instead of a 16-digit number for simplicity. Your credit
card name, and logon for the CICS system, are the same as your z/OS user id.
I'd like you to test that you can use the CICS
transaction via WebSphere MQ to simulate
a payment on your credit card. Also I have
some questions for you to answer to check your
understanding. Please send your answers to me
when you've finished the testing.
Help
You may find the following references useful when completing the tasks:
The instructions for Part 1 of the Mainframe Challenge contain many useful tips as well!
When a transaction starts processing, CICS runs a program that is associated with the transaction. That
program can transfer control to other programs in the course of the transaction, making it possible to
assemble modular applications consisting of many CICS programs.
At any time, in a CICS system, many instances of a transaction can run at the same time. It would be
inconvenient to have to queue and wait for thousands of other people when buying something online.
WebSphere MQ
WebSphere MQ is IBM's premier messaging product. It can be used to send formatted data, in the
form of messages, between disparate applications via an asynchronous message delivery mechanism.
These applications might be written in different programming languages and be running on different
hardware and operating systems. Being able to connect these applications together can save customers
a lot of time and money.
Messages are placed on queues in storage, so that programs can run independently of each other, at
different speeds and times, in different locations, and without having a logical connection between
them. WebSphere MQ allows multiple and interchangeable applications to access the same, or
different, queues, which can help customers to develop a flexible and scalable infrastructure that
includes redundancy and thus reduces the risk of failure.
Many of the largest companies in the world have CICS and WebSphere MQ at the very heart of their
business.
GETTING STARTED
Before you can start this part of the contest you'll need to obtain the questions that you need to
answer along the way.
These are available in a question and answer sheet in the sequential data set called
ZOS.CONTEST3.PART2.ANSWER.SHEET.
Using ISPF take a copy of this data set, which you can complete as you progress through
the tasks.
Ensure that the first TWO qualifiers of your data set are your user id otherwise your
answers may not be marked correctly.
You will be advised when you should be able to answer each of the questions, but please read the
comments at the top of the answer sheet carefully before proceeding.
Fill in your z/OS user id in the space provided above question 1.
CICS Primer
Now's a good time to give you some guidance on using CICS.
You start a CICS transaction by pressing the CLEAR* key to clear the screen, and entering
the transaction identifier, either by itself or followed by data, on the command line of the
screen. The command line is a single line, usually at the top of the screen.
You can type the transaction identifier by itself and follow the prompts until a complete
transaction command is built up, or you can type the complete transaction command on the
command line. If you do not enter enough information, or if the information you enter is
wrong, you are prompted to complete or correct your input.
For example, in the following transaction, CESF is the transaction identifier and the
additional data is GOODNIGHT.
CESF GOODNIGHT
This transaction is used to log off CICS.
When the transaction starts, it processes the additional data. At the completion of this
transaction, you get the following message:
STATUS: SESSION ENDED
After a transaction has completed, press the CLEAR* key to get a blank screen in readiness
for the next transaction.
To end a transaction use the PF3 key.
* The special 3270 CLEAR key is not on most keyboards. However, 3270 emulators either
provide this via a context (right-click) menu or allow you to map it to a key of your choice,
often Pause/Break by default.
You can find more information on CICS in the CICS Transaction Server v3.2 Information Center.
Using CICS
Open a second 3270 session but instead of entering TSO at the SELECTION ==> prompt enter
LOGON APPLID(CICSZ057) instead.
You should then be presented with the CICS sign-on screen:
Enter your user id and password and press enter (remember this is the Ctrl key).
The screen should clear except for the following message near the bottom:
DFHCE3549 Sign-on is complete (Language ENU).
Answer questions 1-5 in your <userid>.<userid>.ANSWERS data set, now that you have
successfully logged on to CICS.
USING JCL
If you think about how you might achieve any given task in the real world, you typically break it down
into one or more steps, where each step completes a particular part of the bigger picture and typically
requires the use of different resources.
Job Control Language (JCL) is how you describe this information to z/OS, whereby a job represents a
task.
For every job that you submit, you need to tell z/OS where to find the appropriate input, how to
process that input (that is, what program or programs to run), and what to do with the resulting
output. You use JCL to convey this information to z/OS through a set of statements known as job
control statements.
JCL's set of job control statements is quite large, enabling you to provide a great deal of information to
z/OS. Most jobs, however, can be run using a very small subset of these control statements.
Within each job, the control statements are grouped into job steps. A job step consists of all the control
statements needed to run one program.
If a job needs to run more than one program, the job would contain a different job step for each of
those programs.
1. An identifier field, which is typically two forward slashes (//). The entire line is treated as
a comment if the two slashes are followed by an asterisk (//*).
JCL statements can be coded only up to column 71. You may question why JCL has this format but it
was historically input using punch cards that had 80 columns, the last 8 of which were used for line
numbers.
For more information on JCL you can look in the JCL Reference section of the MVS book in the z/OS
Information Center.
USING SDSF
In this section, you may find yourself having to repeatedly swap between two different applications, for
example, between the answer sheet data set in the editor, and SDSF to find out the answers to the
questions. It can get frustrating to keep having to go in and out of different applications and back
again, so there is a better way to do it:
Pressing PF2 will cause the screen to "split" at your cursor, showing the two screens
separated by a horizontal dotted line. You can then press PF9 to swap between the two
screens. Press PF3 all the way back to what would be the TSO prompt to get rid of a
screen.
To maximise the available screen size, put your cursor on the very top line of the screen
before pressing PF2.
SDSF Primer
System Display and Search Facility (SDSF) provides information that you can use to monitor,
manage and control a z/OS system.
You can use SDSF to view the system log and the status of jobs that are running
in the system or have finished running, including any held output of jobs that
have not yet been purged (discarded). Use SDSF to view the output of any jobs
you submit.
You access SDSF from the ISPF primary panel with the command S.
From there, DA can be used to view the active (running) jobs in the system, including any
started tasks, which are a special type of job.
ST can be used to view the status of jobs, those that are active, those yet to be processed,
and those that have completed.
Once you are viewing a list of jobs, at the command input prompt you can filter the list of
jobs to just those that you own by entering:
OWNER UKxxxxx
To revert back to showing all jobs enter:
OWNER *
Similarly you can filter the list of jobs by their name by entering:
PREFIX ABC*
which would show only those jobs whose names begin with the letters ABC.
To remove this filter enter:
PREFIX *
You can use both the owner and the prefix filters at the same time.
These are particularly useful because they hide jobs on the system that you are either not
interested in or not authorised to look at.
Be aware that SDSF remembers the filters that you are using. If you are not seeing a job
that you expect to see, set both filters to a single asterisk (*) so that all jobs are displayed.
In the DA and ST panels you are presented with a list of jobs. Use the PF7 and PF8 keys to
page up and down.
To view more information about a particular job you can enter S in the left-hand column
(NP) and press Ctrl.
This can provide a lot of data and so alternatively you can enter a question mark (?) instead,
which will give a listing of the various sections of the output. You can then use S to select
these sections individually.
Use the PF3 key to exit the screen that you are on and return to the previous one.
Answer questions 6-8 now that you are familiar with JCL and SDSF.
Create a member in your JCL data set called PAYMENT, copying it from the member of the
same name in the data set called ZOS.CONTEST3.PART2.JCL.
Substitute the placeholders in the job as described you can use any monetary value and
description of your choice.
Submit the job by typing SUBMIT on the command line while editing it, and look at its
output using SDSF.
Fix the JCL errors, using the JCL Reference section of the MVS book in the z/OS Information
Center to help you find out what is wrong and how to fix it.
Answer question 9.
Create another PDSE named <userid>.PART2.LOAD, defining it with the same attributes as
ZOS.CONTEST3.PART2.LOAD.
Now you need to copy another set of JCL, which you can use to compile the application, to another
member in your JCL data set.
Copy the job from the member called COMPPAY in the data set ZOS.CONTEST3.PART2.JCL
Substitute the placeholders in the job as described and compile the unit test
application - you should not encounter any errors this time.
The COMPILE step should have an RC of 0.
The PLKED step should have an RC of 4.
The LKED step should have an RC of 0.
The GO step should have an RC of 1.
It looks like you might need to create (define) your reply queue.
WebSphere MQ provides ISPF panels to help you administer queue managers - these can be found on
ZEUS under IBM Products - WebSphere MQ. You should be presented with a screen as below:
The name of the queue manager (the connect name) can be found in the JCL you used to run the unittest application.
You can press the PF1 key on any panel to obtain context sensitive help (i.e. help for the field your
cursor is on).
Define your reply queue.
COMPLETING PART 2
You should now find that you are able to successfully run the unit-test application.
To complete this part of the Mainframe Challenge you must:
Use the unit-test application to record a transaction against your credit card so that
your current balance is not zero. You can record more than one transaction if you
wish, and the amounts and descriptions are your choice.