25
Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine and the method of access is different too. 1. Install a VPN : OpenVPN Gui for Windows V2.1B7, You can download it directly from the internet http://openvpn.se/files/install_packages/openvpn-2.1_beta7-gui- 1.0.3-install.exe If you are using a MAC download Mac_OpenVPN.DMG : http://cid-c7f3c195a6258847.skydrive.live.com/browse.aspx/Public 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 to 2.1rc12 (from 2.0.9). This fixes a defect which prevented Tunnelblick from connecting to the student mainframe contest server A readme file that describes how to install / get started. 2. Unzip & install your security certificate: When you receive your new userid & password you will also receive a zip file named : rus_user_x.zip. Download the zip and explode the file, then run the install.bat Note : You must have Administrator access to your Windows environment. This is because Openvpn needs to add routes on your machine during the connection. If you don't have admin access, please take a look to the following article : http://openvpn.se/files/howto/openvpn- howto_run_openvpn_as_nonadmin.html Additionally, you must be sure that your firewall is accepting outgoing connections to the following IP Addresses/ports for the Openvpn connection :

Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

Part 3: Real World Challenge. Final Test.

IntroductionAs mentioned at the end of Part2, Part3 runs on a different z/OS machine and the method of access is different too.

1.Install a VPN :

OpenVPN Gui for Windows V2.1B7, You can download it directly from the internet

http://openvpn.se/files/install_packages/openvpn-2.1_beta7-gui-1.0.3-install.exe

If you are using a MAC download Mac_OpenVPN.DMG :

http://cid-c7f3c195a6258847.skydrive.live.com/browse.aspx/Public

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 to 2.1rc12 (from 2.0.9). This fixes a defect which prevented Tunnelblick from connecting to the student mainframe contest serverA readme file that describes how to install / get started.

2.Unzip & install your security certificate:

When you receive your new userid & password you will also receive a zip file named : rus_user_x.zip. Download the zip and explode the file, then run the install.batNote : You must have Administrator access to your Windows environment. This is because Openvpn needs to add routes on your machine during the connection. If you don't have admin access, please take a look to the following article :

http://openvpn.se/files/howto/openvpn-howto_run_openvpn_as_nonadmin.html

Additionally, you must be sure that your firewall is accepting outgoingconnections to the following IP Addresses/ports for the Openvpn connection :

Page 2: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

Subnet : 129.35.161.0/24Ports : 1194 and 1195Protocols : TCP and UDP

MAC users : To learn how to setup and install your security certificated on Mac OS X please refer to the readme file included on the disk image that you downloaded above.

3.Configure your emulator to connect to the new system.

The IP address is : 10.3.20.6 port 23.

If you are using the emulator for Windows, the trial license may have expired, use the following key to reactivate :

Marist College Student License844E6D2164

4. Logon to TSO and start the contest.

If you experience any system problems, please feel free to MSN [email protected]. Please note I will not be able to help you complete the tasks.

Useful tipIf your userid hangs the following procedure can be just to cancel yourself.

Put the following command in a file for example cancelme.txt on your PC :

/*$VS,'C U=ZCONxxx'

Where xxx is the number of your userid.

Then start an FTP session to 10.3.20.6 and login.

Enter FTP cmd : quote site filetype=jesEnter FTP cmd : put cancelme.txt

This will send the above command via the JES internal reader into the system.

Page 3: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

Part3 task overview

All the details regarding to the tasks can also be found on the mainframe in a pds call ZOS.CONTEST.D2008

Your answers should be stored in members of a dataset called ZCONxxx.ZOS.CONTEST.D2008.ANSWERS. Where the member names are TASK1 etc.

We do not expect all students to be able to complete all of the tasks. Points will be awarded based on the difficulty of the tasks, the MQ & CICS tasks is considered the most difficult. The tasks can be attempted in any order, they are not dependant on each other.

Task1 Using DB2 & SQL Task2 Dump readingTask3 CICS & MQ real world challengeTask4 Create a webpage to display your completed crossword Task1 Using DB2 & SQL

Introduction

In this task you will be using the IBM DB2 database management system to create a simple database, insert some data, and then perform a number of queries against this data. Music Store Database

The database you will be building is designed to store product, customer and sales data for an online music stores product catalog. For the purposes of this task it has been highly simplified, to hold details of the following entities:

Artists, Albums, Tracks, Customers and Sales Setting up the SPUFI application

From the z/OS Primary Option Menu select option P (IBM Products) and then on the next panel option D (DB2). On the DB2 Information Management Software panel, make sure that the parameters in red are set to DSNB

D -DB2 Interactive Functions ( DSNB )

Page 4: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

Now choose option D on this panel followed by option 1 SPUFI on the next panel to enter the DB2 SPUFI utility. Ensure that the next screen has the following information set, where ### is the final three digits of your user ID (ie 015 for ZCON015):

================================================================================ Enter the input data set name: (Can be sequential or partitioned) 1 DATA SET NAME ... ===> 'ZCON###.SPUFI.IN(SPUFI)' 2 VOLUME SERIAL ... ===> (Enter if not cataloged) 3 DATA SET PASSWORD ===> (Enter if password protected) Enter the output data set name: (Must be a sequential data set) 4 DATA SET NAME ... ===> 'ZCON###.SPUFI.OUT' Specify processing options: 5 CHANGE DEFAULTS ===> YES (Y/N - Display SPUFI defaults panel?) 6 EDIT INPUT ...... ===> YES (Y/N - Enter SQL statements?) 7 EXECUTE ......... ===> YES (Y/N - Execute SQL statements?) 8 AUTOCOMMIT ...... ===> YES (Y/N - Commit after successful run?) 9 BROWSE OUTPUT ... ===> YES (Y/N - Browse output data set?)

For remote SQL processing: 10 CONNECT LOCATION ===>

================================================================================Once you get to the SQL editor you should see your input dataset which contains the words --ENTER YOUR SQL IN HERE. Underneath this you can enter the SQL for this task (remember to either delete or comment out by adding -- to the start of each line, any SQL from previous steps). To execute the SQL you have entered use the F3 key exit the editor and then use the ZOS enter key to run it. Check the output for errors before continuing to the next step. Successful completion will result Successful completion of each line of SQL will result in an SQLCODE 0:

e.g. ---------+---------+---------+---------+---------+--------- DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0 ---------+---------+---------+---------+---------+---------

Also check for a successful COMMIT at the end of all the SQL you have executed in that step:

e.g. ---------+---------+---------+---------+---------+---------+ DSNE617I COMMIT PERFORMED, SQLCODE IS 0

Page 5: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

Building the Database 1) Using the following SQL create a new Database: CREATE DATABASE MCDB### BUFFERPOOL BP0 CCSID EBCDIC; Where ### is the final three digits of your user ID. 2) Using the following SQL create a Tablespace: CREATE TABLESPACE MCTS### IN MCDB### BUFFERPOOL BP0;

Page 6: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

3) Using the following SQL create the ARTIST table. Each row in this table describes a recording artist or group. CREATE TABLE ZCON###.ARTIST (ARTISTID INTEGER NOT NULL, ARTISTNAME VARCHAR(30) , PRIMARY KEY(ARTISTID) ) IN MCDB###.MCTS###; 4) Also create an index on the primary key column of this table. CREATE UNIQUE INDEX ZCON###.ARTISTIX ON ZCON###.ARTIST(ARTISTID);

5) Using the following SQL create the ALBUM table. Each row in this table describes an album that the company currently has in its product catalog. NOTE: For simplification we will assume that an ALBUM can be associated with only one artist. CREATE TABLE ZCON###.ALBUM (ALBUMID INTEGER NOT NULL, ALBUMTITLE VARCHAR(30) , ARTISTID INTEGER , RELEASEYEAR CHAR(4) , LABEL VARCHAR(20) , PRIMARY KEY(ALBUMID) , FOREIGN KEY (ARTISTID) REFERENCES ARTIST(ARTISTID) ON DELETE NO ACTION) IN MCDB###.MCTS###; 6) Create a unique index on the primary key column in the ALBUM table.

Page 7: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

7) Now create and run your own SQL using SPUFI to build the TRACK table containing the columns detailed below. Each row in this table describes an individual track / song. NOTE: For simplification we will assume that an individual TRACK can only be associated with one album. In this case if a track was to appear for example on a compilation or 'greatest hits' album then it would have multiple entries in the TRACK table. ----------------------------------------------------------------- Column Name Data Type (Length) Allow Null Key ----------------------------------------------------------------- TRACKID INTEGER NO PRIMARY TRACKTITLE VARCHAR(30) NO ALBUMID INTEGER YES FOREIGN TRACKSEQUENCE INTEGER YES TRACKLENGTH INTEGER YES LYRICS VARCHAR(3000) YES

8) Create a unique index on the primary key column in the TRACK table.

9) Create and run your own SQL using SPUFI to build the CUSTOMER table containing the columns detailed below. Each row in this table describes a customer who has made a purchase through the company website. ----------------------------------------------------------------- Column Name Data Type (Length) Allow Null Key ----------------------------------------------------------------- CUSTOMERID INTEGER NO PRIMARY FORENAME VARCHAR(30) NO SURNAME VARCHAR(30) NO STREET VARCHAR(30) NO TOWN VARCHAR(30) YES COUNTY VARCHAR(20) YES POSTCODE VARCHAR(8) NO

10) Create a unique index on the primary key column in the CUSTOMER table.

Page 8: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

Up to now you have been using the SPUFI utility to enter and execute SQL commands against DB2. This is however not the only way to do this, there are a number of alternatives. To build the next table you are going to execute the SQL using a batch job. This can be useful if you have a large amount of SQL to run, have some common SQL that you want to run frequently, or maybe even to be executed automatically using some of the other applications available on the mainframe.

11) Execute the following JCL to build the SALE table and index: //CREASALE JOB 'DB2',NOTIFY=&SYSUID,CLASS=A,MSGCLASS=H, // MSGLEVEL=(1,1),REGION=4M //JOBLIB DD DISP=SHR,DSN=DB2.V8R1.SDSNLOAD //GRANT EXEC PGM=IKJEFT01,DYNAMNBR=20 //SYSTSPRT DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SYSUDUMP DD SYSOUT=* //SYSTSIN DD * DSN SYSTEM(DSNB) RUN PROGRAM(DSNTIAD) PLAN(DSNTIA81) - LIBRARY('DB2.V8R1.DSNB.RUNLIB.LOAD') END //SYSIN DD * CREATE TABLE ZCON###.SALE (SALEID INTEGER NOT NULL, CUSTOMERID INTEGER NOT NULL, DATE TIMESTAMP NOT NULL, AMOUNT DECIMAL(8,2) , PAID CHAR(1) , DISPATCHED CHAR(1) , PRIMARY KEY(SALEID) , FOREIGN KEY (CUSTOMERID) REFERENCES CUSTOMER(CUSTOMERID) ON DELETE NO ACTION) IN MCDB###.MCTS###; CREATE UNIQUE INDEX ZCON###.SALEIX ON ZCON###.SALE(SALEID); The rows in this table describe the sales that the company has madeincluding the customer, date, amount and status of this sale. Note that there are not details of the items actually sold in this table, as these will be stored in the SALEITEM table, which resolves the many-to-many relationship between sales and albums. Ensure each step of the job runs with a return code of 0, which will indicate that the table has been created successfully. e.g.

DSNT400I SQLCODE = 000, SUCCESSFUL EXECUTION

Page 9: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

12) Now create and submit your own JCL job like the one above to create the SALEITEM table containing the columns detailed below, and create and index on the primary key columns. Each row in this table describes each individual album sale -------------------------------------------------------------------- Column Name Data Type (Length) Allow Null Key -------------------------------------------------------------------- SALEID INTEGER NO PRIMARY, FOREIGN ALBUMID INTEGER NO PRIMARY, FOREIGN QUANTITY INTEGER NO

You have now finished building the database. The next step is to populate it with data. Inserting Data 13) Using SPUFI execute the following SQL statement to insert some data into the ARTIST table: INSERT INTO ZCON###.ARTIST VALUES (1,'Avril Lavigne');

14) Continue populating the ARTIST table with the following data: ------------------------------------- ARTISTID ARTISTNAME ------------------------------------- 2 James Blunt 3 Metallica 4 Rhianna 5 Coldplay 6 Madonna 7 Iron Maiden 8 Christina Aguilera Rather than manually insert every row of data, we can also use a utility program provided with DB2 to LOAD data into the database from a file. This is much quicker than individual inserts. The load jobs can be found in the ZOS.CONTEST.D2008.DB2.JCLCopy these jobs to your own dataset and tailor accordingly. Run them in the order detailed in the next step.

Page 10: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine
Page 11: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

15) Load data into the ARTIST table by running the LOADARTI job. Remember to change any occurrences of ZCON### to your userid. 16) Load data into the ALBUM table by running the LOADALB job. Remember to change any occurrences of ZCON### to your userid. 17) Load data into the TRACK table by running the LOADTRAC job. Remember to change any occurrences of ZCON### to your userid. 18) Load data into the CUSTOMER table by running the LOADCUST job. Remember to change any occurrences of ZCON### to your userid. 19) Load data into the SALE table by running the LOADSALE job. Remember to change any occurrences of ZCON### to your userid. 20) Load data into the SALEITEM table by running the LOADSAIT job. Remember to change any occurrences of ZCON### to your userid.

Troubleshooting

If you experience any errors when building the database tables or running the load jobs you may need to do some recovery work to allow you to continue.

If you have any problems with the construction of the database and its tables, you may need to use the DROP command, to drop the necessary database objects and allow you to start again. You will find a job called DROPDB in the ZOS.CONTEST.D2008.DB2.JCL dataset which will drop the entire database and all data / tables you have created so far. If you only wish to drop a specific table then you can modify this job to do so.

If you have errors when running the load jobs (most probably due to incorrectly defined tables) you may find one or more tables enters 'CHECK PENDING' status. If you want to try to resolve this without dropping and recreating everything then you may wish to use the CHECK DATA utility which scans table data for referential integrity.

Page 12: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

There is a sample job called CHKDAT in the ZOS.CONTEST.D2008.DB2.JCL dataset to run this utility.

For more information on CHECK DATA consult the DB2 manuals at:

http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/dsnugk12/2.6

Querying the Database

Now you have built your database and populated with data your task is to answer some questions by performing queries against the data. The SQL command SELECT is used to query data in the database. e.g.) SELECT * FROM ZCON###.CUSTOMER ORDER BY SURNAME; Would produce a list of all the data in the CUSTOMER table ordered by the customers surname. e .g.) SELECT ALBUMTITLE FROM ZCON###.ALBUM WHERE LABEL='EMI'; Would produce a list of the title of all the albums released on the EMI label. You may need to research the syntax required to build the SELECT statements needed to answer the questions in this section. Examples of using SELECT can be found in the DB2 manuals at: http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/dsnsqj10/4.4.9 You can submit your queries either using SPUFI or by submitting batch jobs.

Page 13: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

TASK QUESTIONS Perform queries to answer the following questions. Your answer should include both the output from the query and the actual SQL code you ran to generate it. Remember that the results of the queries will be dependent on you having completed the rest of the exercise successfully and accurately. 1. Produce a list of the names of all albums in the database by the band 'Metallica' ordered by album title. 2. List the names and full addresses of all the customers who have made a purchase from the store in the last 6 months. 3. Produce a list of the name and track length for all the tracks by artist 'Avril Lavigne' grouped by album title.

4. Produce a list of the top 5 selling albums, showing the album name and the quantity of albums sold. 5. Produce a list of the track title, track length and lyrics of all tracks which have never been purchased. In this final question, the results will also reveal 2 further clues for the crossword which have been hidden in the resulting data.

Page 14: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

Task2 Dump reading

Introduction :

When a product has a problem, in general it will output the address spaces being used by the product, in what is known as a dump. A dump can be triggered in several ways. For instance, if while the product was running it ran into some unexpected behaviour, program exception or bad return codes a dump would generally be triggered by the product. In some cases the user can request the product takes a dump when certain criteria is met. This criteria can be set in a SLIP trap via an MVS console command. Once the SLIP trap criteria is met, then a dump called a SLIPDUMP is taken.

The service team are first responsible for diagnosing the problem, which generally involves recreating the problem in house. This is then followed by creating a fix for the problem, including updating documentation and then packaging the fix for the user to install.

When a product has a problem, in general it will output the address spaces being used by the program, in what is known as a dump. In some cases the user can request the program takes a dump when certain criteria is met.

To diagnose a problem, after listening to the user and making their own observations, the next step is to look over any documentation they have sent in. In this situation documentation does not refer to manuals but to product trace, messages related to the product (for example, those written to the console), and most importantly the dump.

In this task you will analyse a dump from IBM's CICS Transaction Server Product.

Set Up Dump for Analysis (Using Interactive Problem Control System IPCS)

Go to the ISPF primary option menu.Select option 13 z/OS user applications then option 8 IPCS for dump reading (an IPCS work dataset will be created the first time you use IPCS) This will take you to the IPCS primary option menu. Select 0 for defaults.

Page 15: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

Change the scope to be BOTH and set the source to be DSNAME('ZOS.CONTEST.PART3.DUMP.TASK'). Hit Enter and you will see the message "BOTH updated" in the top right hand corner.

Then go back to the primary option menu.

Note : This dump was produced on another system running a different level of z/OS so you will see the following :

BLS18223I Dump written by z/OS 01.08.00 SLIP - level differs from IPCS levelBLS21001I IPCS for z/OS 01.07.00 BLS18222I z/Architecture mode system BLS18160D May summary dump data be used by dump access? Enter Y to use.

Enter Y to continue Instructions and Questions

Here is a list of IPCS commands. Some commands can be entered on the option/ command line from any of the IPCS panels, other commands need to be entered under the IPCS command panel.

IPCS SELECT ALLCBFORMAT RTCTLIST DUMPTIMESTAMPSTATUS REGISTERSLIST SLIPTRAPIPCS STATUS WORKSHEETIPCS STATUS SYSTEMIPCS LIST TITLEIPCS VERBX MTRACE

For the following ten questions, please provide the following:a) the answer to the questionb) the command(s) from the list above used to find the answer

1. What program is producing this dump?2. What is the dump title?3. From MTRACE, At what time is control being given to CICS?4. What is the ASID of FSPENCE in this dump?5. What is the Primary ASID and what is its jobname?

Page 16: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

6. What is the PSW at the time of error?7. How many CPUs are active?8. What was the SLIP trap that caused this dump to be taken?9. What time(GMT) did the dump get taken?10. What is the name of the original dump?

So now that you have found out some preliminary information about the dump, let's look at why it happened.

As mentioned before, this is a CICS Transaction Server dump. So from now on you can use the provided CICS Transaction Server dump formatter, DFHPD650, which is shipped as part of the product. This is invoked by going to the command panel from the IPCS primary options menu.

On the command line you are presented with, typeVERBX DFHPD650 '<option>'

In general it is easier if only one option is formatted out at one time. The options that you will be using and their descriptions follow.

Kernel (KE)Each transaction running in CICS is allocated to a a set of kernel control blocks, identified by its kernel number. KE domain can cross reference the transaction number with a kernel number. Each kernel task is allocated stack storage as required as CICS service modules are invoked. Where possible the routines that have been invoked are also displayed. Kernel domain manages the CICS TCBs and recovery, such as program check abends.

Trace (TR)Each domain will trace the entry and exit functions calls, if tracing is active. Exception tracing ensures diagnostic information is traced for unusual conditions. Detailed tracing for a particular domain can be activated. Tracing is normally captured at an individual task level, using the transaction number.

Here is an extract from an abbreviated trace table. Unfortunately the abbreviated trace table does not provide a column header. The columns in order from left to right are: Transaction number or task number (e.g. 00033)TCB (e.g QR)Domain (e.g KE)Trace ID Number (e.g. 0102)

Page 17: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

Module Name (e.g. KETI - this converts to DFHKETI)Entry, Exit or exception status (e.g. Exit)Routine Name (e.g. INQ_LOCAL_DATETIME_DECIMAL)Parameters passed (e.g. 09302008,102058,885543,MMDDYYYY)Trace table entry number (e.g =00002=)

00033 QR KE 0101 KETI ENTRY INQ_LOCAL_DATETIME_DECIMAL =000001=00033 QR KE 0102 KETI EXIT INQ_LOCAL_DATETIME_DECIMAL/OK 09302008,102058,885543,MMDDYYYY =000002=00033 QR KE 0401 KEGD ENTRY INQUIRE_KERNEL =000003=00033 QR KE 0402 KEGD EXIT INQUIRE_KERNEL/OK IYCKZCFS =000004=00033 QR TR 0202 TRSR EXIT START_AUXILIARY_TRACE/OK =000005=

Loader (LD)Loader Domain handles the loading of all CICS and application programs, and will store the addresses of these modules. Most CICS modules have a standard header which can be formatted. This header contains information such as load point, PTF level and program name.

File Control (FCP)File Control handles all requests to application data, and builds the correct request to the access method to read or update application data.

Enqueue (NQ)Enqueue manager acquires enq locks on resources such as recoverable changes to application data.

Transaction (XM)Transaction Manager handles transactions at the kernel number level. This includes tokens stored by transactions to identify some resources, generally control blocks, acquired by the transaction.

Application (AP)The Application Domain gives a view of some of the resources held by the application, including application storage holding data etc.

Dispatcher (DS)The Dispatcher manages the multitasking capabilities with CICS to dispatch CICS transactions when resources become available.

Domain (DM)Domain manager handles all the domains, mainly in initialising the

Page 18: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

domains, then later terminating the domains in a controlled fashion.

Directory (DD)Directory Manager maintains the directory to access different resources by their storage address, for example holding the addresses of the control blocks representing a specific file.

Common System Area (CSA)This is not a true domain, but formats out the Common System Area control block. This contains many addresses used by older parts of CICS that pre-date the domain structure

Most of the domains can be formatted out in two ways, abbreviated or full. To select abbreviated domain formatting select 1, for full domain formatting select 2. CSA is an exception to this rule, as only CSA needs to be specified.

So if you want to format the abbreviated kernel domain you would type the following command:VERBX DFHPD650 'KE=1'

For the following 12 questions, please provide the following:a) the answer to the questionb) the formatter option(s) from the list above used to find the answer

11. What transaction number was running when the dump was taken?12. What was the routine and module that was incomplete at dump time?13. The previous read_set call has completed successfully. What has run in between these points that could have caused the dump?(Hint: Answer should contain task number, routine name, program name)

As read based requests have lead to the dump we should check the level of service that is applied.14.What is the PTF level of DFHFCFR?15.What is the kernel number of transaction number 00040?16.List the modules this task needs to percolate back through17. For transid ID03, which DFHFCVS routine invokes module DFHNQED?

Page 19: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

Now we are going to look at the dump using browse.Using the browse option from the IPCS primary option menu, ensure the source is pointing at the correct dump as specified above and hit enter.Now you will see a command line. Type STACK 1473C700This will create a new entry on the table. Type an S in the PTR column of the new row and you will be taken to a screen that shows the dump contents.

DSNAME('ZOS.CONTEST.PART3.DUMP.TASK') POINTERS ---------------------------------------------------------------------------Command ===> SCROLL ===> PAGE ASID(X'0049') is the default address space PTR Address Address space Data type 00001 00. ASID(X'0049') AREA Remarks: 00002 1473C700. ASID(X'0049') AREA Remarks: ****************************************************** END OF POINTER STACK *******************************************************

Below is an example of the first line of the dump.The top line shows you what address space you are in and the address that you selected.The second line shows your command line.The next two lines in the example show you the dump.The first column is the address of that line. You will notice that the first line shows the address you issued the stack against.The following 4 columns show the hex interpretation of the dump followed by the EBCDIC interpretation.If you want to see what is at an address, simply type a ? in the left hand side gap of a column to jump to the address that represents.The below example shows you that the eyecatcher for this address is MODHEAD.P.650 DFHFCFR. This translates to Module header for product version 650, module name DFHFCFR.

ASID(X'0049') ADDRESS(1473C700.) STORAGE ------------------------------------------------------------------------------------------Command ===> SCROLL ===> PAGE 1473C700 01506ED4 D6C4C8C5 C1C404D7 80F6F5F0 | .&>MODHEAD.P.650 | 1473C710 C4C6C8C6 C3C6D940 F0F861F2 F861F0F8 | DFHFCFR 08/28/08 |

18. What eyecatcher do you see at address 0004E000?19. Now find the address of the load point for program STUDP006 and browse it. What is the program doing? (Hint don't look at the hex too long - look at the formatted storage)

Logic flow when invoking CICS servicesAn good example of how an application invokes a CICS Service would be a READ of a file. A stub links to each application program address

Page 20: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

and branches to the EXEC CICS Interface module DFHEIP. In the case of a READ, this will find the address of DFHEIFC and pass control to that. DFHEIFC will pass control to DFHFCFR, and this will determine the file time. In the case of a VSAM file, for example file FILEA, control is passed to DFHFCVS. This module will invoke the VSAM access methods.The address of DFHEIFC is in the CSA+x'C8' -> optional features, and optional features+x'3BC' contains the address of DFHEIFC.The address of DFHFCFR is obtained via the kernel. From the kernel find the AP domain table entry (it has a header of 'DFHAP'), then offset x'264' within that points to DFHFCFR's entry point. The address of DFHFCVS is from CSA+x'12C' which points to the FC static area. FC static area + x'1A4' contains the address of DFHFCVS.

20. Follow the above logic flow. One of the addresses to one of the modules has been cleared, which is the cause of the dump. What are the addresses of DFHEIFC, DFHFCFR and DFHFCVS in these control blocks?

A request to a particular file is represented by a control block called the VSWA. You can find the VSWA address at +x'2C' of the FRTE. The FRTE's are listed by task ownership in FCP=2. Useful addresses within the VSWA are at +x'28' which contains the address of the area containing the data, and +x'2C' which contains the address of the key required. Note these values are offsets in hex from the start of a given VSWA.

21. Using FCP=2 and browse, what is the value of the key which transaction number 00038 is attempting to access? Each key is 6 bytes long.

22. This dump also shows that another problem has happened in the system. There are two transactions deadlocked. Which transactions are they? What file are they deadlocked on? What keys are involved? (Hint: you might want to look at NQ=1 and FCP=1)

Crossword Questions

Finally its time to find the crossword clues. Please tell me what the

Page 21: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

clues are.23. Program DFHTRAP contains a clue in its code.24. A file control request being issued by transaction ID07 contains a clue as the key of the file.25. A record has been read into the application storage with the final clue.For the final clue, you will need to use the kernel formatter to find transaction ID02's task number. Then use the application program formatter to find that task number's user storage which can be browsed.

Task3 CICS & MQ real world challenge

Introduction :

In this part of the contest you will be using WebSphere MQ and CICS.These are both IBM products that are widely used in many businesses.

Websphere MQ is IBM's premier messaging product running on dozens of operating systems. It can be used to send formatted data, in the form of messages, between disparate applications via an asynchronous message delivery mechanism. CICS (Customer Information Control System) is one of IBM's most successful transaction processing environments. Many of the largest companies in the world have CICS and Webpshere MQ at the very heart of their business.

WebSphere MQ is often used as an integration point for data allowingvarious types of application environment access to the message dataas it is processed.

In this exercise you will use WebSphere MQ to allow interaction between the On-line CICS TP environment and an off-line batch application. This is a very typical customer scenario.

You will run a application under CICS that will put request messages to a request queue, and wait for reponses on the reply queue.This CICS application is the client. Under BATCH you will run anotherapplication (the server) which will retrieve the request message, lookup the response and send a message back to the client application. The request message that is sent contains the MsgId that identifies amessage (found on a data queue) that is to be returned to the clientby the server. A more typical business solution would be to have theserver look up the response data in a DB2 database, but to keep

Page 22: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

things a bit simpler we are retrieving the information from another MQmessage.

There are therefore three queues involved in this scenario:1) Request queue, put to by the client (CICS application) and got from by the server (BATCH application)2) Data queue, used by the server to find the response data to send back to the client. The first 24 bytes of message data of the request message is the message identifier (MQMD.MsgId) of the message that is to be sent back to the client.3) Reply queue, this is the queue where the client is expecting to find the response to the request. This queue is identified by the MQMD.ReplyToQueue field of the request message.

The CICS client application is already compiled (no source supplied!)but you will have to do some CICS configuration to install this application before it can be run. A skeleton server application isprovided, but you will have to complete the code and compile it beforethe client/server pair will work together successfully. Once you havecompleted this and successfully run them together, the clientapplication will have printed out some more clues for your crossword!(The data retrieved off the data queue and returned to the client isactually the crossword clue... you can't cheat though, because theclue that the data relates to is only printed out by the clientapplication, and not contained within the message data!!)

Instructions

You will need to copy the following datasets to your own libraries,you can then update your copies as appropriate.

1) ZOS.CONTEST.D2008.PART3.C - DATASET WITH C SOURCE CODE2) ZOS.CONTEST.D2008.PART3.JCL - DATASET WITH SAMPLE JCL3) ZOS.CONTEST.D2008.PART3.LIB - LIBRARY DATASET FOR COMPILING4) ZOS.CONTEST.D2008.PART3.LOAD - DATASET CONTAINING COMPILED CODE

You should copy the datasets, and content, to your own libraries,so if you are user ZCON001 you would have ZCON001.CONTEST.D2008.PART3.Cetc. CPYDATAS will help you to copy these datasets, you can edit it inZOS.CONTEST.D2008.PART3.JCL, but you won't be able to save it

Page 23: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

here.

The first thing to do is define to MQ the queues you will use, DEFQSJCL will enable you to do this.

Next you should complete the server application and compile it. in theJCL dataset there is some JCL to compile it (COMPSERV). Don't worry,there are hints in the code about what you need to complete! Once you are happy with your changes to the server application and havesuccessfully compiled it you can move on to installing the clientapplication in CICS.

Start up CICS and logon to it. The start command for your ownCICS is "S <userid>", you can then logon to the CICS by pointingyour 3270 emulator at 10.3.20.6 port 23 and then entering"logon applid(<userid>)" at the selection prompt.You will be asked for you username and password when logging on toCICS.

You will need to research how to define a new CICS program andtransaction, and install them. Information can be found in theCICS manuals at :

http://www-306.ibm.com/software/htp/cics/tserver/v31/library/

A useful one is CICS Supplied Transactions.

HINT: Have a look at the CEDA transaction and instructions.The CICS transaction you define is associated with the program youwant to execute. This is done via the CEDA transaction.

Having installed the client application in CICS, you should run theserver application first (which will just wait for requests), there isJCL to run it already provided, have a look at RUNSERV. Once the server is started you can run the CICS client transaction by just typing the name of the CICS transaction that you installed on the CICS command line. You will not see any output on the CICS screen, it will be output on the CEEOUT DD on the CICS joblog. If everything worked ok you will see the crossword clues displayed. If your server application is not processing the requests correctly and providing the correct reply message then you will see the client application time out on the get of the reply.

Some books that may help can be found at :

Page 24: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

http://www-306.ibm.com/software/integration/wmq/library/library6x.html

Of particular interest would be- WebSphere MQ Application Programming Reference

There are some questions below which you should answer in addition to finding the crossword clues.

Questions

Please provide answers to the following questions:

1)Describe how you installed the program and transaction to CICS ?

2)What is the name of the reply queue that the client was using ?

3) The server application was processing messages out of syncpoint,this means that if there was a failure after retrieving the requestmessage, and before putting the reply, the client would never get aresponse for that request message. What changes can you make to the server application to avoid this problem? Try to modify the server application to run in this mode. In addition to changing the MQGET and MQPUT options, what else did you have to remember to do ?

4) What were the crossword clues that you were provided with by theclient application?

5) When you have finished issue the CEMT PE SHUTDOWN CICS transaction. What was the result of this CICS transaction ?

Task4 Create a webpage to display your completed crossword

Start your webserver from the SDSF log by issuing /S WEBxxx where xxx is the number of your userid. Review the job log of the server to find the port number that your server is listening on. Using a browser access your server the url is in the form : http://10.3.20.6:8xxx/

The server will display the final clues you need to complete the crossword. Your task is to present the completed crossword with clues and answers. This task is very much free form, you could create the crossword anyway you choose.

Page 25: Part 3: Real World Challenge. Final Test. - IBM · Part 3: Real World Challenge. Final Test. Introduction As mentioned at the end of Part2, Part3 runs on a different z/OS machine

Your webpage must replace the default page, ensure you test your entry.

In the event of more than one student completing the crossword correctly, extra points will be awarded to the student that the judges consider to have created the best presented web page.