IBM Student Mainframe Challenge Part Three Time to complete about ten to twelve hours

Similar documents
IBM Student Mainframe Challenge Part Three

IBM Student Mainframe Challenge Part Two

IBM. Documentation. IBM Sterling Connect:Direct Process Language. Version 5.3

Uni Hamburg Mainframe Summit z/os The Mainframe Operating. Part 2 TSO, ISPF und Unix Shell. Introduction to the new mainframe

TSO/ISPF TIPS By:

Getting Started with Xpediter/Eclipse

Lab Overview In this lab, you will learn how to perform the following tasks with Encryption Facility for z/os:

IBM System z Fast Track

Objectives of this Lab

The Modern Mainframe. IBM Systems. Powerful, secure, dependable and easier to use. Bernice Casey System z User Experience

IBM Student Mainframe Challenge Part One

Automated Sign-on for Mainframe Administrator Guide

IBM z Systems Development and Test Environment Tools User's Guide IBM

IBM DEBUG TOOL NEWSLETTER

ISPF Users Boot Camp - Part 2 of 2

Implementing Data Masking and Data Subset with IMS Unload File Sources

=============================================== ===============================================

Web/QuickRef R1.1 User s Guide

Hands-on Lab: Setting up the z/os LDAP Server with the dsconfig utility.

IBM. User's Guide. IBM Explorer for z/os. Version 3 Release 0 SC

z/os Introduction and Workshop Unix System Services 2009 IBM Corporation 2017 IBM Corporation

CA MIA Tape Sharing for z/vm

Lesson 3 Transcript: Part 1 of 2 - Tools & Scripting

IBM System z Fast Track

The QMF Family Newsletter 1 st Quarter 2012 Edition

VI. Corente Services Client

Dino Explorer. MVS Data Collector for Mainframe Assessment

ISPF Capabilities via FTP Without TSO By Jeff Gallagher

APIs Economy for Mainframe Customers: A new approach for modernizing and reusing mainframe assets

Transporting files between MVS and MVS or between MVS and a Workstation

IBM Transaction Analysis Workbench for z/os. Lab

Service Information. English Component

Using the z/os SMB Server to Access z/os Data from Windows Hands-On Lab. Lab prepared by Jim Showalter and Karl Lavo

2010/04/19 11:38. Describing a unique product that shows the mainframe in a completely different way.

IBM. PDF file of IBM Knowledge Center topics. IBM Operations Analytics for z Systems. Version 2 Release 2

Implementing Data Masking and Data Subset with IMS Unload File Sources

What s new in Mainframe Express 3.0

Volume 3 December 2005 IBM DEBUG TOOL NEWSLETTER. V6R1 PTF Preview. New Announcement:

In mainframe environment, programs can be executed in batch and online modes. JCL is used for submitting a program for execution in batch mode.

Remote Development Development of a remote applications using Rational Developer for System z V7.5.

Setting Up OS/2 Peer-to-Peer Networking & Coexistence of Warp & NT Machines

A PROGRAM IS A SEQUENCE of instructions that a computer can execute to

IBM InfoSphere Classic Federation for z/os Version 11 Release 1. Installation Guide GC

Uni Hamburg Mainframe Summit 2010 z/os The Mainframe Operating. Part 6 z/os Concepts

NetRexx on the Big Iron

Achieving Higher Levels of Productivity with IBM ISPF Productivity Tool for z/os IBM Redbooks Solution Guide

IBM Enterprise Modernization for System z: Wrap existing COBOL programs as Web Services with IBM Rational Developer for System z

EView/390 Management for HP OpenView Operations Unix

Changing a Cell's Host Name and System Name

WA2031 WebSphere Application Server 8.0 Administration on Windows. Student Labs. Web Age Solutions Inc. Copyright 2012 Web Age Solutions Inc.

Installing Sentry-go Quick Monitors, Sentry-go Plus!, Client Tools & Enterprise Reporting

PLI Tutorial 03. Remote PL/1

Workload Management classification of requests in IBM HTTP Server for z/os Powered by Apache

Introduction to IBM Rational HATS For IBM System i (5250)

CICS Explorer Traveler s Guide

Your step-by-step instructions to getting started on ipage. Includes:

IBM Tools Base for z/os Version 1 Release 6. IMS Tools Knowledge Base User's Guide and Reference IBM SC

IBM Application Performance Analyzer for z/os Version IBM Corporation

Getting Started with Code Coverage/Eclipse

FrontPage Help Center. Topic: FrontPage Basics

Client Installation and User's Guide

Web-enable a 5250 application with the IBM WebFacing Tool

Chapter 1 An Introduction to C++, Unix, SSH and Komodo Edit

How To Set User Account Password In Windows 7 From Guest

IBM Tivoli Composite Application Manager for Applications Version 7.3. WebSphere MQ Monitoring Agent User's Guide IBM SC

1) How many unique operating systems are available on IBM Z hardware? Answer Choice A58_

COMP 3400 Mainframe Administration 1

HELPLINE. Dilwyn Jones

TPS / 3270 TCP /IP. TPS /TN3270 Client Troubleshooting Quickstart Guide. Application Level. Protocol Level. Device Driver Level

JCL for installing FTE/MFT on z/os. Colin Paice

Can IBM Debug Tool and RDz Integrated Debugger both coexist in same CICS region?

Client Installation and User's Guide

Using WebBoard at UIS

MANEWS Issue Number 21 the Mainframe Audit News

EMC ControlCenter PLANNING AND INSTALLATION GUIDE VOLUME 2 (MVS AGENTS) 6.0 P/N REV A02

GSS Administration and Troubleshooting

Version 1 Release 6. IBM Autonomics Director for Db2 for z/os User's Guide IBM SC

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG

Throttling WebSphere Liberty Batch Jobs

User Guide. Copyright 2015 Cybercom Software

SmartIS. What is SmartIS? Product Description

The main differences with other open source reporting solutions such as JasperReports or mondrian are:

Remote Destination Profile

Installing and configuring an Android device emulator. EntwicklerCamp 2012

EView/390 Management for HP BSM. Operations Manager I

Yong Peng High School System Documentation PC Section

Download, Install and Use Winzip

BEATuxedo Mainframe Adapter for SNA. Installation Guide

Sql 2008 Copy Table Structure And Database To

Linksys WRT54G v5.0 & 5.1 & 6.0

Interactive System Productivity Facility (ISPF)

ISPF at EI&O UFIT. UF Information Technology. EI&O Document ID: D0040 Last Updated: 06/28/2002

at Rocket Software Mainframe CVS z/os Unix System Services CVS client Extending the functionality of the Lisa Bates

IBM z/os Management Facility Hands-on Lab

CS Fundamentals of Programming II Fall Very Basic UNIX

Configuring IBM s WebSphere Application Server

EVALUATION ONLY. WA2097 WebSphere Application Server 8.5 Administration on Linux. Student Labs. Web Age Solutions Inc.

Creating Web Pages with SeaMonkey Composer

CA Agile Central Administrator Guide. CA Agile Central On-Premises

IBM WebSphere Java Batch Lab

Transcription:

IBM Student Mainframe Challenge Part Three Time to complete about ten to twelve hours Your manager has been so pleased with your progress so far that she has given you the opportunity to join the corporate credit card administration team. The team provides Services to corporate card customers, including allowing them to view a statement of transactions carried out by company employees using a corporate credit card. In this part you will complete and run the applications required to distribute information about corporate credit card transactions, with the ultimate goal of producing a web page that displays a statement of transactions. Background A database is already used by your bank to store information about all transactions on credit cards that have been issued. Unfortunately, for security and audit compliance reasons, your department does not have access to this database. Therefore, the web page you will produce cannot extract data from it directly and another process has been developed. The solution that has been designed is to use WebSphere MQ publish/subscribe to distribute information about a credit card transaction when it takes place. The transaction information will be received by an existing application that inserts the transaction into the database of card transactions, as well as an application that you must complete that creates a file containing the transaction information. The web page will then be generated by a CICS transaction from the information stored in this file.

Help You may find the following references useful when completing the tasks: z/os v1.11 Information Center: http://publib.boulder.ibm.com/infocenter/zos/v1r11/index.jsp CICS Transaction Server v3.2 Information Center: http://pic.dhe.ibm.com/infocenter/cicsts/v4r1/index.jsp WebSphere MQ v7 Information Center: http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp

Install a VPN If you're using Windows... Go to http://swupdate.openvpn.org/community/releases/openvpn-2.2.2-install.exe and download the OpenVPN GUI for Windows V2.2.2. Install it by running the.exe file and following the installation instructions. If you're using a Mac... Go to http://cid-c7f3c195a6258847.skydrive.live.com/browse.aspx/public and download Mac_OpenVPN.dmg. This is a Mac OS X Disk Image file. It contains: A version of Tunnelblick (an Open VPN GUI) that has been modified by upgrading the OpenVPN binary from 2.0.9 to to 2.1rc12. This fixes a defect which prevented Tunnelblick from connecting to our mainframe. A read-me file that describes how to install Tunnelblick and get started. If you're using Linux... Go to http://openvpn.net/index.php/open-source/downloads.html and download the OpenVPN 2.2.2 source, then find instructions for installation on different Linux distributions at http://openvpn.net/index.php/open-source/documentation/howto.html#install Unzip and install your security certificate When you receive your new userid and password, you will also receive a zip file containing your security certificate. If you're using Windows... Unzip the file and run install.bat OpenVPN GUI" from the Start Menu to start the connection. OpenVPN must have administrator access to your Windows environment. This is because it needs to add routes on your machine during the connection. If it does not have administrator access you will see a message informing you that the "ROUTE ADD" operation failed when trying to set up the VPN connection. The easiest way to run OpenVPN as administrator is to right click on the "OpenVPN GUI" icon and select "Run as administrator". For more information on this, please take a look at this article: http://openvpn.se/files/howto/openvpn-howto_run_openvpn_as_nonadmin.html

If you're using a Mac... The read-me file in the disk image you downloaded above should contain everything you need to know about setting up and installing your security certificate on Mac OS X If you're using Linux... Copy the *.key, *.crt and *.ovpn files you received to /etc/openvpn. Then edit the *.ovpn file to add the correct path (/etc/openvpn) to the beginning of the file name already specified for the ca and key settings. The command: openvpn --config /etc/openvpn/server.ovpn should then start it up. Additionally, you must be sure that your firewall is accepting outgoing connections to the following IP addresses/ports for the OpenVPN connection: Subnet: 129.35.161.0/24 Ports: 1194 and 1195 Protocols: TCP and UDP Configure your emulator to connect to the new system The Host IP Name is 10.3.20.6 and the IP Port is 23. Log on to TSO If you are using the emulator for Windows, the trial license may have expired. You can use the following key to reactivate it: Marist College Student License 844E6D2164 If you get disconnected and can't log back on because your userid is still in use, this procedure may help: Put the following command in a file (for example cancellogon.txt) /*$VS,'C U=ZCONxxx' (where ZCONxxx is your new userid) Then log into an FTP session at 10.3.20.6 and enter these commands: quote site filetype =jes put cancellogon.txt This will send the command in the file to JES, which schedules jobs on the mainframe. You should then be able to log onto the mainframe again.

INTRODUCTION TO WEBSPHERE MQ PUBLISH/SUBSCRIBE In Part Two you used WebSphere MQ to send a message from one application to another by putting it on a queue. This style of messaging is known as point-to-point messaging. WebSphere MQ also supports another style of messaging called publish/subscribe, which is particularly useful in situations where the sending application doesn't know anything about the receiving application, or the messages from one application are to be received by several other applications. When using publish/subscribe, the provider of information is called a publisher, and the consumer of the information is called a subscriber. Published information is sent in a message, but instead of putting the message to a queue, the publisher specifies the message's topic when it puts the message. Similarly, the subscriber specifies the topics about which it wants to receive publications, and is only sent information about those topics it subscribes to. Topics are identified by a character string called the topic string. Typically subjects are organised hierarchically using the '/' character to create sub-topics in the topic string, for example "root/level2/level3". You can find more detail on publish/subscribe messaging in the Publish/Subscribe User's Guide section of the WebSphere MQ Information Center.

GETTING STARTED Use ISPF to create two new PDSEs called <userid>.prtthree.jcl and <userid>.prtthree.c. They should be allocated in tracks (TRKS) They should have a primary quantity of 1 and secondary quantity of 1 The record format should be FB (fixed block) and the record length should be 80 The block size should be 32000 The data set name type should be LIBRARY Create another new PDSE called <userid>.prtthree.load. It should be allocated in tracks (TRKS) It should have a primary quantity of 1 and a secondary quantity of 1 The record format should be U (undefined), and the record length should be left blank The block size should be 32000 The data set name type should be LIBRARY You'll also 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.ANSWER.SHEET. Using ISPF create a copy of this data set called <userid>.answers with the same attributes as the original data set. 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 userid in the space provided above question 1.

MANAGING DATA SETS Let's take a closer look at how z/os manages data sets before starting on the main task. Each data set is allocated on a volume. This is exactly the same as files being allocated on a disk on your PC. However, that's where the similarity ends, as a typical z/os system will have access to tens or even hundreds of volumes, and data sets can be allocated on multiple volumes if necessary. Volumes are identified by their volume serial number. You may already have noticed that the Data Set List Utility in ISPF (option 3.4) displays the volume where each data set is allocated in the right hand column. You can also find information about the volume that a dataset is allocated on in the dataset information panel. With so much choice, how do you decide which volumes you should allocate your datasets on? Luckily the system can make this decision for you. New dataset allocations are directed to a suitable volume by SMS (Storage Management Subsystem) based on criteria defined by the system administrator. To simplify the management of the large numbers of data sets that may be present on a z/os system, data sets can be assigned a data, management and storage class. - The data class that is assigned to a data set controls the attributes used by the system when allocating the data set. Using a data class makes it simpler to allocate data sets and often reduces the number of parameters that need to be specified. - The management class defines attributes that control how the data set is managed one it has been allocated. This includes settings such as how long the data set should be kept before it is automatically deleted, and whether the data set should be backed up. - The storage class defines performance and availability goals for a data set, and will affect which volumes the system considers when deciding where to allocate the data set. All the SMS classes are defined in ISPF on panels that can be accessed from the ISMF Primary Option Menu, which can be found under z/os User DFSMSdfp. You should now answer questions 1, 2 and 3.

THE PUBLISHING APPLICATION Your colleague has created a unit-test application that simulates credit card transactions taking place by publishing information about the transactions. In the production system this information will be published when the transaction is authorised. The publishing unit-test application is designed to be run as a batch job. It takes as input a data set containing information about the transactions to be published. The data set containing the transactions to be published is ZOS.CONTEST3.TXNS. Each record in the input data set contains the following comma-separated values describing one transaction: topic string, transaction date, card holder, retailer name, transaction amount Lines in the input data set beginning with an asterisk ('*') are treated as comments and are ignored by the application. You'll notice that the first line in the input file that is not a comment has a different format, and the topic string is 'cctxn/control'. This is a special publication that, when received by the application that updates the database, will cause all the transactions currently stored in the database to be deleted. It is always published first to ensure that the database only contains the transactions published the last time you ran the publishing application. This will allow you to check that your application is publishing the transaction information as expected, and will also allow us to check that you have managed to publish the transactions correctly.

RUNNING THE PUBLISHING APPLICATION Your first task is to compile and run the publishing application. The jobs to build and execute the application are in members COMPPUB and EXECPUB of ZOS.CONTEST3.JCL. The application source is in ZOS.CONTEST3.C(PUBAPP) and will need to be copied into your C data set before you attempt to compile the application. Copy the application source into your C data set. Copy the jobs into your JCL data set. Substitute the place-holders in the jobs. Compile and run the publishing application It looks as though your colleague doesn't test things as thoroughly as they should! You'll have to fix the errors you found when building the application, and any errors you find when running the application. Check the output of the publishing job to make sure that it is working properly. There will be messages in the output for each transaction that is published if the application in working. Information on building WebSphere MQ programs can be found in the Application Programming Guide section of the WebSphere MQ Information Center. Fix the errors in the application. Hint: If your publishing application appears to run successfully but does not publish any messages, it may be that it is not being provided with the list of transactions to be published from the input data set. The JCL that runs the publishing application needs to have a DD named SYSIN to allow the publishing application to read from the ZOS.CONTEST3.TXNS file using the STDIN file handle. You may want to refer to the DD Statement section in the MVS JCL Reference part of the z/os v1.11 Information Center for more information about the JCL DD statement. The publishing application should now be running successfully.

Issuing WebSphere MQ commands Publish/subscribe functions such as topics are not supported by the WebSphere MQ ISPF panels, but the panels also allow you to send commands to the queue manager. The WebSphere MQ panels can be found under IBM Products - WebSphere - MQ. When you choose the command action, you will be presented with an ISPF editor screen. You can type in one or more commands using the same interface as you would when editing a data set or PDSE member. To split a command over several lines, + is used as the continuation character. Press PF3 to exit the editor and issue the command(s). The command response will then be displayed. The commands that can be issued are described in the Script (MQSC) Command Reference section of the WebSphere MQ Information Center. Answer questions 4 and 5 now that you know how to enter WebSphere MQ commands. Issuing system commands z/os system commands can be issued to control and display information about the system. The system commands are described in the System Commands book of the z/os V1R11 Information Center. The easiest way to issue system commands is from SDSF. To issue a command, enter a forward slash ('/'), followed by the command. You can enter the command from any SDSF panel, but in order to view the command response you should look in either the system log or user session log. The system log SDSF panel contains responses from all commands issued on the system, as well as messages from jobs running on the system too. The user session log just contains responses to the commands you've issued since logging on. Answer questions 6 and 7 to practise entering system commands.

DISPLAYING THE PUBLISHED TRANSACTIONS As you may recall, there is an existing application that receives all publications containing transaction information, and inserts the information received into the database of credit card transactions. If you managed to get the publishing application to work, this database update application will have inserted the details of the transactions you published into the database. In order for the application to receive all publications, an administrative subscription named CCTXNSUB has been defined that will cause all publications relating to credit card transactions to be delivered to a queue that causes the database update application to be triggered. Answer questions 8 and 9 about this subscription. Logging on to CICS You do not have the authority to query the database directly to see whether the transactions you published have been inserted into the database, but fortunately a program already exists for testing purposes that can be run within CICS in order to query the transactions that the database contains.

Before starting CICS for the first time you will need to create two other PDSEs. Create two PDSEs called <userid>.cicslib and <userid>.cics.sysin They should be allocated in tracks (TRKS) They should have a primary quantity of 1 and secondary quantity of 1 The record format should be FB (fixed block) and the record length should be 80 The block size should be 32000 The data set name type should be LIBRARY Copy the member ZOS.CONTEST3.CICS.SYSIN(SIT660) into <userid>.cics.sysin. This member contains the CICS system initialisation parameters, which you will need to modify later on. The name of your CICS region is the same as your z/os userid. The system command to start your own CICS region is S <cicsregionname>,start=initial. You can then log on to that CICS region by pointing your 3270 emulator at 10.3.20.6 port 23 and then entering logon applid(<cicsregionname>) at the selection prompt. You will be asked for your user name and password when logging on to CICS. Start up CICS and log on to it. The above command to start CICS overrides the default start option causing CICS to perform an initial start. This is required as it's the first time your CICS region will have been started. If you need to restart CICS later, don't use the START=INITIAL parameter, otherwise you'll need to reinstall all the objects that you have defined and installed in CICS! The C program to query the database, called TXNS, has already been built, but you will need to define and install the program and an associated transaction in order to be able to execute it. Call the transaction that you define TXNS, and use the ZACADEMY group when defining both the

program and transaction. The program uses a map, which is written in assembler language, in order to display information on the screen. This has also been written and assembled for you. To enable TXNS to use the map you will need to define and install a program called TXNSMAP. Use CEDA to define and install the TXNS program, an associated transaction, and the TXNSMAP program. Information on defining new programs and transactions can be found in the CICS Information Center. Have a look at the CEDA transaction in the CICS Supplied Transactions section of the CICS Transaction Server book. Running the transaction Before you can run the transaction, you will also need to define a few resources to allow CICS to access DB2. Use CEDA to define and install a DB2CONN with the following attributes. This will allow CICS to connect to DB2. Name: DB2 Group: ZACADEMY DB2Id: DSNB Define and install a DB2ENTRY called TXNSQURY in the ZACADEMY group with the following attributes. Plan: TXNS PlanExitname: leave blank Transid: TXNS Now that you have all the definitions in place, tell CICS to connect to DB2 by using the CEMT transaction as follows: CEMT SET DB2CONN CONNECTED The CEMT transaction is also described in the CICS Supplied Transactions section of the CICS Transaction Server book. Now that you have all the definitions in place, you can view the list of credit card transactions that you have published: Run the TXNS transaction and enter your z/os user id where prompted. Compare the list of published credit card transactions that is displayed with what is in ZOS.CONTEST3.TXNS to verify that the transactions were published correctly.

INTRODUCTION TO UNIX SYSTEM SERVICES The UNIX System Services (USS) element of z/os is a UNIX operating environment, implemented within the z/os operating system. The interface will be familiar to anyone who has experience of using UNIX. The z/os UNIX file system, like other UNIX systems, is a hierarchical file system. Files are members of a directory, and each directory is in turn a member of another directory at a higher level. The highest level of the hierarchy is the root directory. Your home directory in USS is /u/<userid>, where <userid> is your z/os user id. This is where you should create any files that you need to complete this task. Although you do not deal directly with data sets while using USS, the contents of the USS file system is actually stored in a number of datasets that are mounted at a certain points in the file system by the system administrator. There are two special types of datasets for this purpose - HFS (Hierarchical File System) and zfs (zseries File System). For example, the HFS file system <userid>.hfs is mounted at your home directory /u/<userid>, and contains all the data stored under your home directory. Logging on to USS There are two ways of entering USS. The first is to use Telnet to connect to the system. This is the method you must use for this task as it allows you to submit jobs from ISPF at the same time as running applications in USS in a separate window. To log on to USS using this method, use a Telnet client (such as PuTTY for Windows) to connect to 10.3.20.6 port 1023. When you log on you will see a copyright statement followed by the command prompt. To log off USS type exit.

Editing files in USS To edit files in USS when you have logged in using Telnet, you can use the vi editor. This is a commonly used editor on UNIX systems and you may already be familiar with it. However if you are not, don't worry as you'll only need to know the basics in order to complete this task. To start editing a file in vi enter vi <filename> on the command line. If the file doesn't exist already, it will be created for you. The vi editor has two modes command mode and insert mode. Command mode allows you to enter commands to manipulate the text in the file, while insert mode allows you to type text into the file. When you start vi it will be in command mode. The most common ways of getting into insert mode is to type either i (to enter text at the cursor's position) or o (to start a new line) while in command mode. Anything you type will then be inserted into the file. To return to command mode, use the Esc key. These are some useful commands that can be entered while in command mode: :q! Exit without saving :wq Save and exit :w Save (without exiting) D Delete the rest of the line after the cursor dd Delete the entire line :nn Move the cursor to line nn uu Undo last action For more information on using vi, search online for one of the many tutorials and references that are available. The other way to enter USS is to enter the TSO OMVS command in ISPF. This isn't the recommended way to enter USS for this task as you will be unable to submit jobs from ISPF at the same time as using USS, and you may encounter problems compiling programs due to storage constraints. However, if you find it difficult to edit files with vi, you may want to enter USS using this method as it allows you to edit files with the ISPF editor you have already used. To edit a file enter oedit <filename> on the OMVS command line. This will open the file in the ISPF editor. Answer question 10 now that you're familiar with USS.

SUBSCRIBING TO THE TRANSACTION INFORMATION Your colleagues have almost finished the application to subscribe to the credit card transaction publications and produce the web page, now it's up to you to put the finishing touches to it! At the moment it displays transaction details that it receives, and optionally creates a file that you'll use to generate the web page. The subscribing application is designed to run under USS, and the program source can be found in ZOS.CONTEST3.C. Building the subscribing application Before the program can be built in USS, the source code needs to be copied into your USS filesystem. To do this, log on to USS and enter the command: cp "//'ZOS.CONTEST3.C(SUBAPP)'" ~/subapp.c

You now need to build the subscribing application. The command to build USS applications can be found in the Application Programming Guide section of the WebSphere MQ Information Center. Check the JCL you used to build the publishing application if you do not remember the high level qualifiers of the WebSphere MQ data sets that will be needed to build the subscribing application. Before you can run the subscribing application, you need to add the WebSphere MQ data sets to your STEPLIB in USS. To do this, create a file called.profile in your home directory containing the following command: export STEPLIB=WMQ.V701.SCSQANLE:WMQ.V701.SCSQAUTH:$STEPLIB In order for the change to take effect immediately you will also need to issue this command from the command line. This adds the data sets to the environment variable STEPLIB which is used by z/os to locate libraries, similar to LIBPATH in UNIX. Running the subscribing application Once you have built the application and set up your STEPLIB, try running it. The syntax of the command to run the application is: subapp -q <queue manager> -u <userid> [-f <output file>] [-n <cardnumber>] You only need to specify values for the first two parameters at this stage. The name of the queue manager can be found in the job used to execute the publishing application. Note that queue manager names are case-sensitive! The userid to specify is your z/os userid. When you run the subscribing application it subscribes to receive credit card transaction publications and then tries to get any messages that are published on the topic it has subscribed to. As the publications are not retained publications (look in the Publish/Subscribe User's Guide for more information on retained publications), this application will only receive transaction publications that are published while it is subscribed to the topic. When you run the subscribing application, you'll find that it doesn't wait very long for messages to be published! You'll need to change the application so that it waits for 30 seconds for a message to arrive, so you have time to run the publishing application while the subscribing application is still running. The MQGET call can be made to do this!

Change the program source so that the MQGET call will wait for up to 30 seconds for a message to arrive. Build and run the subscribing application again. Submit the job to publish the transaction information while the subscribing application is running. Does the subscriber receive any publications? Unfortunately, it seems as though there is another error in the application! You need to correct the error in the subscribing application so that it will receive all the publications, but before you make any code changes: Answer question 11. Hint: Check the topic string for the topic that the application is subscribing to (this is displayed by the application when it is started), and compare it to the topic strings displayed in the output of the publishing application. Information on topic strings can be found in the Publish/Subscribe User's Guide. Correct the error in the subscribing application. Once the application receives all the transaction publications, you should run it again, this time specifying the -f option followed by ~/txns.csv. This will cause the subscribing application to create a file called txns.csv in your home directory containing the transaction details received. You will use this file later to create the forthcoming transactions web page. Run the application again with the option -f ~/txns.csv.

SUBSCRIBING TO PUBLICATIONS ABOUT ONLY ONE CARD NUMBER At the moment the subscribing application receives all published transactions. However, customers don't necessarily want to see all transactions, they often want to view the transactions for a particular credit card. We should change the application so that it can subscribe to transactions relating to one particular credit card number. This feature could be used to create several different web pages, each containing the details of transactions for a specific credit card. Luckily, the topic string used when publishing the transaction information is of the format cctxn/<credit card number>. Therefore it's possible for the application to subscribe to only receive publications relating to a specific credit card number. The subscribing application already has a parameter, -n, which allows the credit card number to be specified, but this parameter is currently ignored. If -n is specified, the application should only subscribe to receive publications about the specific card number. If this option is not specified, the application should continue to subscribe to all published transactions. C programming tips You will need to check whether a card was specified on the command line. The following statement can be used to achieve this: if ( 0!= strlen(cardnumber) ) { /* A card number was specified subscribe to only one credit card number */ } else { /* No card number was specified subscribe to all published transactions */ } The function to concatenate strings in C is strcat(destination, source). A copy of the source string will be appended to the end of the destination string. Change the subscribing application so that it subscribes to receive publications about only one credit card number if the -n option is specified.

GETTING STARTED WITH CICS WEB SUPPORT You're now almost ready to start creating the web page that will display the credit card statements, but first you'll need to prepare CICS to act as a web server, and display a static page to test that it has been set up correctly. You can find detailed information on CICS Web support in the Connecting CICS to the Web section of the CICS Transaction Server for z/os book in the CICS Information Center. Use CEDA to define and install a TCPIPSERVICE with the following attributes. This will allow CICS to listen for HTTP requests on a certain port.

Name: HTTPPRT3 Group: ZACADEMY PortNumber: 9nnn (where nnn is the last 3 digits of your z/os userid) Protocol: HTTP Now that you've defined the TCPIPSERVICE, try using your browser to load the following URL: http://10.3.20.6:9nnn/hello.html You probably won't get a response from the server. This is because CICS does not have TCP/IP services enabled by default. You'll need to change one of the CICS system initialisation parameters in order to activate TCP/IP services, and then restart CICS. The CICS system initialisation parameters, as you may remember, are in <userid>.cics.sysin(sit660). To shut down CICS use the CEMT transaction. Check the CICS Information Center to find the exact command you will need to issue. Hint: To find out more about how to configure CICS Web support, check the Connecting CICS to the Web section of the CICS Transaction Server for z/os V3.2 book in the CICS Information Center. The CICS Information Center is written in US English, so initialisation is spelled as initialization. This is useful to know if you're trying to search the Information Center! Change the correct CICS system initialisation parameters to activate TCP/IP services. Restart CICS. Loading the web page Now that CICS will accept TCP/IP connections, try using your browser to load the same URL. You should get a response this time, but CICS doesn't know where to load hello.html from. Answer questions 12 and 13 before continuing. As the error message suggests, you need to define and install a URIMAP which will tell CICS how it should generate this page. Use CEDA once again to define and install a URIMAP with the following attributes.

Name: HELLOURI Group: ZACADEMY Host: * Path: /hello.html TCPIPService: HTTPPRT3 MediaType: text/html HFSFile: /etc/zoscontest3/hello.html This definition tells CICS to return the contents of the file called /etc/zoscontest3/hello.html whenever the HTTPPRT3 TCPIPSERVICE receives a request with a URI ending in /hello.html. Load hello.html in your browser again when you have defined the URIMAP. It should work this time, but it won't look very pretty. /etc/zoscontest3/styles.css is a stylesheet that is used by both this page and the forthcoming transactions page to improve the formatting. Of course your browser can't find it at the moment as you haven't defined the corresponding URIMAP. Define and install a URIMAP named STYLES for the stylesheet now, keeping in mind that the media type for a cascading stylesheet is text/css. If the URIMAP for the stylesheet has been defined correctly you should notice that the typeface and position of the text is different when you next reload the page in your browser.

CREATING THE CREDIT CARD STATEMENT WEB PAGE You now have experience of most of the steps required to set up CICS to serve a web page. It's time to move on to your final task creating the web page that will display a list of forthcoming gaming transactions. The web page will be generated using the file created by the subscribing application. Although you modified the subscribing application so that it can produce files each containing transactions relating to only one credit card number, I'm afraid to say the website's design has now been changed! We need just one web page which is created dynamically, and the customer can select whether to display transactions relating to all or just one credit card. You will therefore need to have a file called txns.csv in your USS home directory containing details of all the published transactions. You may need to rerun the subscribing application without specifying the -n option in order to create this file. The web page will be created by another program that will read in the file containing the transaction information, and insert the transaction information into pre-defined HTML templates. As we develop software projects, the customer's requirements almost certainly change. We have to be able to adapt and develop what will provide the best value for the customer. You'll get used to this! The program source is in ZOS.CONTEST3.C(WEBAPP), and the JCL to build it is in ZOS.CONTEST3.JCL(COMPWEB). Copy the JCL to build the application into your own JCL data set. You may need to slightly modify the JCL before the application will build successfully. Once you have modified the JCL: Build the program. Hint: JCL allows you to specify the amount of storage (memory) that your job, or a particular step within the job, requires as a parameter on either the JOB or EXEC statement. The system will not allow your job to use more storage than the amount specified in the JCL. This prevents your program from consuming too many of the system's resources, especially in the case where a defect in the program could cause it to use much more storage than expected. Define and install it in CICS.

Once you have installed the program in CICS, you will need to define and install a URIMAP so that the transactions web page can be accessed at the following URL: http://10.3.20.6:9nnn/cctxns Define and install the appropriate URIMAP. Once again, replace nnn with the last three digits of your z/os userid. You should now be able to view the web page, but it will be full of errors! Check the CICS Information Center to find the reason for the errors, then: Answer questions 14 and 15. Hint: To find the condition that a response code from a CICS API call corresponds to, check the EIBRESP section of the following page in the CICS Information Center: CICS Transaction Server for z/os, Version 4.1 The CICS Transaction Server library: HTML Application Programming Reference Detailed reference information for the CICS API commands EXEC interface block EIB fields. Displaying the web page The program that creates the web page uses several document templates to build up the completed web page. These document templates contain most of the page's HTML code, and the web page is built by inserting text from the transactions file into the templates. It looks like you will need to define these document templates to CICS so that it knows where to find the files that contain the HTML templates. Use CEDA to define and install the required DOCTEMPLATEs. The DOCTEMPLATE named TXNSLST refers to the txns.csv file in your home directory. You'll find the template files for the page header, footer and an transaction row under /etc/zoscontest3/templates. The web page should now be displayed properly, but it looks like your colleague has not completed its development as the feature to filter the transactions that are displayed by employee doesn't work.

Copy the application source code into your C data set so that you can edit it. Complete the development of the web application so that the filtering function works. Compile your completed web application. CICS will not automatically reload the new version of the application when you've modified and rebuilt it. To tell CICS to load the latest version of the program, use CEMT like this: CEMT SET PROG(<progname>) NEWCOPY. Once you have completed the web page, review your answers to the questions and leave the data set where it is so it can be checked later. You should ensure that your publishing application completed successfully the last time you ran it as the credit card transactions in the DB2 database will be checked against the data set used by the publishing application to make sure the application worked correctly. Please also leave your subscribing application in your USS home directory so the web site can be checked for correctness and deployed! I hope you've enjoyed the IBM Student Mainframe Challenge! We'll be in touch! If you're looking for a graduate job, why not consider applying to IBM's labs? http://www.ibm.com/employment/