run your first cics application on a pc using txseries for ... · real business problems are solved...

16
Run your first CICS application on a PC using TXSeries for Windows Skill Level: Intermediate Wen Z Lu ([email protected]) TXSeries Product Team IBM Alex Marshall Software Engineer Student 26 Nov 2007 Learn the basics of the IBM® Customer Information Control System (CICS). With a hands-on exercise, learn how to get your first CICS application up and running on your desktop using TXSeries® V6.1 for Windows®. The tutorial shows you how to download and install a free trial version of TXSeries V6.1. Section 1. Before you start About this tutorial Learn the basic concepts and terminology to demystify the IBM Customer Information Control System (CICS). Learn to install TXSeries for Multiplatforms V6.1 on Windows, and to deploy a pre-compiled sample application written in COBOL. The tutorial skips complex setup requirements by taking advantage of the free trial download of TXSeries V6.1 and a comprehensive example. This tutorial is for newcomers to CICS, and does not require any explicit programming experience. Run your first CICS application on a PC using TXSeries for Windows © Copyright IBM Corporation 1994, 2008. All rights reserved. Page 1 of 16

Upload: dinhnga

Post on 13-Dec-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

Run your first CICS application on a PC usingTXSeries for WindowsSkill Level: Intermediate

Wen Z Lu ([email protected])TXSeries Product TeamIBM

Alex MarshallSoftware EngineerStudent

26 Nov 2007

Learn the basics of the IBM® Customer Information Control System (CICS). With ahands-on exercise, learn how to get your first CICS application up and running onyour desktop using TXSeries® V6.1 for Windows®. The tutorial shows you how todownload and install a free trial version of TXSeries V6.1.

Section 1. Before you start

About this tutorial

Learn the basic concepts and terminology to demystify the IBM CustomerInformation Control System (CICS). Learn to install TXSeries for Multiplatforms V6.1on Windows, and to deploy a pre-compiled sample application written in COBOL.The tutorial skips complex setup requirements by taking advantage of the free trialdownload of TXSeries V6.1 and a comprehensive example.

This tutorial is for newcomers to CICS, and does not require any explicitprogramming experience.

Run your first CICS application on a PC using TXSeries for Windows© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 1 of 16

Objectives

Upon completion of this tutorial, you will understand the value and basic concepts ofCICS. The hands-on experience will give you enough information to work with CICSto solve more complex business problems.

Prerequisites

It is assumed you have a general familiarity with the Microsoft® Windows operatingsystem, Web-browsers such as Internet Explorer, and Windows utilities such as thecommand line interface.

System requirements

To complete the steps in this tutorial, you need to install TXSeries for MultiplatformsV6.1, which requires one of the following operating systems:

• Windows XP Professional with Service Pack 2

• Windows Server 2003 Standard Edition with Service Pack 1

• Windows Server 2003 Enterprise Edition with Service Pack 1

This tutorial was written using Windows XP Professional with Service Pack 2. Youmust have Administrator privileges for your Microsoft Windows user account.

Section 2. What is CICS?

This section covers some basic concepts. With CICS, people are usually referring toCICS Transaction Server for z/OS, which is an industrial strength transactionprocessing system on IBM System z. CICS can also refer to the IBM CICS family,which is a rich set of transaction processing solutions, connectors, and tools. CICSsupports high levels of transaction processing needs of many businesses around theworld. Millions of transactions get processed daily as the backbone of criticalbusiness operations.

A transaction implements a self contained business task with a "once-only"guarantee, such as credit and debit accounts, or a ticket reservation. Typically atransaction has many users accessing shared data that must be kept consistent,accurate, and safe. To stay competitive, businesses also require that transactions

developerWorks® ibm.com/developerWorks

Run your first CICS application on a PC using TXSeries for WindowsPage 2 of 16 © Copyright IBM Corporation 1994, 2008. All rights reserved.

execute quickly, and around the clock.

To ensure optimum data consistency, and to avoid cases of financial loss (such asan interrupted credit/debit, leaving both accounts short), a transaction conforms tothe atomic, consistent, isolated, and durable (ACID) property. It must succeed or failas a complete unit and not in any intermediate state, guaranteeing the integrity ofdata and operations.

A transaction processing system provides a set of interfaces and services to:

• Allow applications to be written in a range of programming languages

• Exploit the architecture benefits of different operating platforms

• Handle issues of security, workload balancing, and communication withother systems and databases

• Leave the application to only implement business logic, and solve thebusiness problem

TXSeries for Multiplatforms is the transaction processing environment for managingCICS applications, or transactions on distributed platforms, such as AIX, Solaris, andWindows. TXSeries shares the same design principals and workings of CICSTransaction Server.

Deployment

To deploy any transaction, or a CICS application, you need to consider how to:

• Write the CICS program

• Store data involved in a transaction

• Present the outcome of the transaction to the end user

A three-tier architecture is commonly used in business application deployments. Thethree tiers are:

Data logicThis, in effect, is a data store where data can be retrieved, updated, andover-written to complete the transaction. An example is a bank balance after acash withdrawal from an ATM. The data logic is handled by data servers, orenterprise information systems (EIS) that TXSeries connects to, such as IMSand DB2. The exercise in this tutorial uses the Structure File System (SFS) thatis a part of TXSeries as a data store.

Business logic

ibm.com/developerWorks developerWorks®

Run your first CICS application on a PC using TXSeries for Windows© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 3 of 16

Real business problems are solved by running a program in this tier containingnecessary instructions about what to do with data. With the business logic,TXSeries acts as a business application server, processing a CICS applicationreliably and securely.

Presentation logicDeals with the user interface. This tutorial uses the CICS Universal Client.Alternatively, you can have a Web application to connect to the business logicrunning in CICS.

Section 3. Install TXSeries

To install the trial version of TXSeries:

1. Download the TXSeries for Multiplatforms V6.1.

2. Save the setup file in a directory. Extract the files into a temporary folder,such as Desktop for easy access.

3. Install TXSeries by launching the setup file namedTXSeriesV61-windows.exe.

1. Read the TXSeries License Agreement and Terms, and clickAccept.

2. Install to the default directories:C:\opt for TXSeriesC:\Program Files\ibm\CUC for CICS Universal Client (CUC).

3. A trial license, valid for 90 days, is enabled. During installation youare informed in a window of the date and time when the triallicense will expire.

5. Configure the users and groups for accessing CICS by setting yourWindows logon account. For example, Alex will be a member of cicsgroupfor access to execute CICS commands.

1. Launch the Control Panel and select Administrative Tools >Computer Management.

2. From the left menu select Users from Local Users and Groups.

developerWorks® ibm.com/developerWorks

Run your first CICS application on a PC using TXSeries for WindowsPage 4 of 16 © Copyright IBM Corporation 1994, 2008. All rights reserved.

3. Within this view, locate your current user account, right-click andselect properties.

4. In the user properties pane select Member Of and click Add.Figure 1. Setting correct user permissions

5. Enter cicsgroup in the text box and click OK.

6. Click OK to close the preferences window, but leave the ComputerManagement window open for the next step.

7. Set the TXSeries service to run under this user to avoid any restrictionson the execution of applications and services.

1. From the Computer Management window, which should still beopen, select Services from Services and Applications.

2. Locate TXSeries LWI Service in the list, right-click on it, and selectproperties.

3. Select the Log On tab, and check This account.

4. Enter the name of your Windows account, which is case sensitive,and the account password.Figure 2. Checking if TXSeries Service is running correctly

ibm.com/developerWorks developerWorks®

Run your first CICS application on a PC using TXSeries for Windows© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 5 of 16

5. Click OK to confirm the changes.

9. You must restart your computer to enable these changes. On reboot, theTXSeries service will launch in the background.

Well done -- you installed TXSeries.

Section 4. Configure TXSeries

In this section you use the Web-based IBM TXSeries Administration Tool to create

developerWorks® ibm.com/developerWorks

Run your first CICS application on a PC using TXSeries for WindowsPage 6 of 16 © Copyright IBM Corporation 1994, 2008. All rights reserved.

and configure a TXSeries region.

1. From the Start menu select IBM > TXSeries for Multiplatforms andlaunch IBM TXSeries Administration Tool.

2. It will ask you to log in. Use your Windows account name and password,which are case sensitive.

3. Create a new CICS Region:

1. Select Regions from the menu on the left and click All Regions.

2. Click Create.

3. Enter a name for the new CICS Region. Use Test for this tutorial.Leave the File Management option set to SFS, which is the default.Figure 3. Creating a new CICS Region

5. Create a listener for the region, for example by specifying the protocolformat:

1. Expand the Test region you just created by clicking on + (plussign).

2. Select listeners.

3. Click Add.Figure 4. Creating a new listener

ibm.com/developerWorks developerWorks®

Run your first CICS application on a PC using TXSeries for Windows© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 7 of 16

4. On the next panel, enter LST1 in the Listener Name field, changethe Protocol type to Named Pipe, and enter CICSCC for the LocalNamed Pipe name.

5. Click Submit. A message should tell you the listener has beencreated successfully.

7. Create an SFS Server for the region. A CICS Structures File System(SFS) is a virtual storage access method. It is a record-oriented filesystem that can provide indexed, relative, and sequential access tofile-based data. The SFS lets you store fully recoverable file-based data.

1. Expand SFS Servers from the left menu in the Web-basedAdministration Console.

2. Select All SFS Servers.

3. Select Create.

4. On the next panel, in the Name field enter Test.

5. Click Submit. A message should indicate that the SFS has been

developerWorks® ibm.com/developerWorks

Run your first CICS application on a PC using TXSeries for WindowsPage 8 of 16 © Copyright IBM Corporation 1994, 2008. All rights reserved.

created successfully.

Now you're ready to work with the CICS application.

Section 5. Run the sample program

In this section you use the TXSeries Installation Verification Program (IVP) as asample program to verify the installation.

To install and configure IVP:

1. TXSeries comes with the source code for the IVP, but the compilation ofIVP is outside of the scope of this tutorial. Download and use thepre-compiled IVP binaries in IVP-C.ZIP.Download IVP-C.ZIP and extract the files into thec:\opt\cics\samples\ivp\C directory, which should already exist but doesn'tcontain any files.

2. Start a Windows command prompt. Change to the CICS directory usingthe command:

cd c:\opt\cics\bin

3. Enter the following command to retrieve the SFS volume name:

sfsadmin list lvols -server/.:/cics/sfs/Test

Write down or remember the volume name because you'll need it for thenext command. The name of the SFS server is shown in bold.

4. Enter the following command to add the programs into the CICS region,but substitute <sfs_volume_name> for the name of the SFS volumereturned by the previous command.

cicsivp -r Test -lC -s/.:/cics/sfs/Test -v<sfs_volume_name>

ibm.com/developerWorks developerWorks®

Run your first CICS application on a PC using TXSeries for Windows© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 9 of 16

A return code of 0 is displayed to suggest that the command has beencompleted successfully.

5. To start the region, in the Web-based TXSeries Administration Consoleselect All Regions in the left pane. Click on the test region, anddrop-down boxes will appear where you can change the Start Type toCold. Click Start to start the region so that you can connect to it.Figure 5. Starting the region

6. When the region starts, which may take a few moments, a messageconfirms the success of the process.

Running the application

The next step is to configure and start a local terminal to test the IVP, or the MENUapplication that you just deployed.

One way to access a terminal-based CICS application residing on a TXSeries regionis with the CICS local terminal. A CICS terminal application is supplied and installedalong with the TXSeries Evaluation.

1. Open the CICS local terminal initialization file (c:\opt\cics\bin\cicslcli.ini) ina text editor such as Notepad.

2. Scroll down to the first server definition and change the server name toour TXSeries region name, Test.

3. Set the NamedPipeName value to the name of the listener createdearlier, CICSCC.

4. Save and close the file.

5. Now that the terminal is configured you can connect to the region. Fromthe Windows Start menu select Programs > IBM >TXSeries forMultiplatforms > Start Local Terminal. From the list of servers, selectTEST and click OK to connect.

developerWorks® ibm.com/developerWorks

Run your first CICS application on a PC using TXSeries for WindowsPage 10 of 16 © Copyright IBM Corporation 1994, 2008. All rights reserved.

6. The terminal, which is now connected to the Test region, should appearblank with a green line along the bottom. The cursor position ishighlighted by a flashing underscore.To enter the transaction name, type MENU in the top left of the terminaland press the right-hand CTRL key to execute the MENU application.

Figure 6. Terminal awaiting input

7. The application will be executed by CICS, and the output displayed on theterminal. Using the simple menu based system you can add and createrecords that are saved in the SFS region. To create a record:

1. The cursor will be in the transaction field by default. Type ADDS.The cursor will then jump to the next field. Enter 000001 in theNumber field. Press Enter to execute the command.Figure 7 shows the result. You can now enter data into theapplication. Press Enter again to commit this data.

2. You can repeat this process, incrementing the number field, to addmore records.

3. To try the Inquiry option, enter INQY and 000001. The first recordyou created will be displayed.

ibm.com/developerWorks developerWorks®

Run your first CICS application on a PC using TXSeries for Windows© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 11 of 16

4. Now that you are familiar with using MENU, try the BRWS and UPDToptions.Figure 7. Performing an inquiry

Congratulations! You have successfully run your first CICS application on your PC.

Section 6. Troubleshooting

If you are trying to complete this tutorial offline, disconnected from a Local AreaNetwork connection, you might require the Microsoft Loopback adapter. TXseriesrelies upon the network layer to operate.

See Resources for more information about the Loopback adapter from Microsoft.

Section 7. Conclusion

In this tutorial you learned the basics of a CICS application, and took the firstpractical step in running it on your desktop using TXSeries.

developerWorks® ibm.com/developerWorks

Run your first CICS application on a PC using TXSeries for WindowsPage 12 of 16 © Copyright IBM Corporation 1994, 2008. All rights reserved.

TXSeries and CICS Transaction Server for z/OS share the same design principles,and TXSeries shares a subset of its functions. Any CICS application run or tested onTXSeries can be easily migrated onto and integrated with Transaction Server forz/OS to exploit the architectural advantages of the z/OS platform.

To further enhance your productivity in application development, you can useRational Developer for System z (RDz) to write and compile for TXSeries and CICSTS applications. You can also use it to optimize the test and debug process formainframe CICS applications by running it in a form of TXSeries before deploying toCICS TS.

ibm.com/developerWorks developerWorks®

Run your first CICS application on a PC using TXSeries for Windows© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 13 of 16

Downloads

Description Name Size Download method

TXSeries IVP Compiled Binaries ivp-c.zip 17KB HTTP

Information about download methods

developerWorks® ibm.com/developerWorks

Run your first CICS application on a PC using TXSeries for WindowsPage 14 of 16 © Copyright IBM Corporation 1994, 2008. All rights reserved.

Resources

Learn

• The IBM Redbook Revealed! The Next Generation of Distributed CICS (ISBN0-7384-9577-8) discusses distributed IBM Customer Information ControlSystem (CICS) solutions and how best to develop distributed CICS applications.

• Designing & Programming CICS Applications (ISBN 1-56592-676-5), O'ReillyMedia, introduces new users of IBM's mainframe (OS/390) to CICS features. Itshows experienced users how to integrate existing mainframe systems withnewer technologies, including the Web, CORBA, Java, CICS clients, and VisualBasic, as well as how to link MQSeries and CICS.

• The TXSeries for Multiplatforms CICS Application Programming Guidedescribes the IBM TXSeries for Multiplatforms application programminginterface (API). It explains how to prepare application programs that use CICSon AIX, HP-UX, Solaris, and Windows systems.

• The TXSeries for Multiplatforms V6.1 CICS Installation Guide is useful forinstallation questions.

• "Using IBM WebSphere Developer for System z and TXSeries forMultiplatforms to build CICS applications" (developerWorks, Apr 2007) explainshow to write CICS applications in IBM COBOL using IBM WebSphereDeveloper for System z v7.0 and IBM TXSeries for Multiplatforms v6.1.

• Find more information about the Loopback adapter from Microsoft.

• Browse the technology bookstore for books on these and other technical topics.

Get products and technologies

• Download a trial version of TXSeries for Windows V6.1.

Discuss

• Check out developerWorks blogs and get involved in the developerWorkscommunity.

About the authors

Wen Z LuWen Lu is a software engineer at the IBM Hursley Lab. Wen has worked inInformation Development, System Test, and Integration Test for WebSphereproducts. She joined the TXSeries offering team in 2005. Wen holds a degree inMathematics and Computation from University of Oxford, England.

ibm.com/developerWorks developerWorks®

Run your first CICS application on a PC using TXSeries for Windows© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 15 of 16

Alex MarshallAlex Marshall is a software engineering student from Durham University. He iscurrently working for the CICS Test department as part of an internship with IBM. Hisinterests include transaction processing, Web development, and social networking.His current research includes visualizing and providing tools for analyzing unusualsources of temporal based datatr using Web-based mapping services.

developerWorks® ibm.com/developerWorks

Run your first CICS application on a PC using TXSeries for WindowsPage 16 of 16 © Copyright IBM Corporation 1994, 2008. All rights reserved.