This chapter walks through the process of building a CICS application in Net Express with MSS, and deploying it under Enterprise Server.
CICS applications that used to run on the mainframe, now run under Enterprise Server. You maintain the applications in Net Express.
The process from developing through to running the application is as follows:
Throughout this chapter, the demonstration application ACCT supplied with Net Express is used as an example. The ACCT application comprises several COBOL programs and two BMS maps, and uses the resource definitions in the file dfhdrdat.
To work through this chapter, you need:
Enterprise Server is an option in Net Express, and is also available stand-alone.
To build an application in Net Express, you need to create a Net Express project. You need to add to the project all the files that comprise the application, such as the COBOL source files and any BMS files.
The files for the demonstration are in the directory, Examples\Net Express IDE\mto-bms of your Net Express installation.
Open the demonstration project in Net Express. To do this click File > Open and browse to acct.app and select it.
Notice that the project consists of:
The project tree view shows acctset.cpy and acctset.mod, but these files don't exist yet. They will be created when the BMS mapset is compiled.
The BMS maps need to be included in your Net Express project, so that you can edit and compile them easily. To edit them, you use the BMS Screen Painter in Net Express. To compile them, you use the Compile option in Net Express. You can compile just the BMS mapsets or the whole project.
There is no need to edit the BMS files for the purposes of the MSS walkthrough. However, if you did need to edit them, you would open the BMS Painter by double-clicking a map in the project view.
You can also edit a text version of the BMS map by right-clicking the BMS macro (.bms) file in the right-hand pane of the File View and clicking Edit as Text.
If a transaction program uses BMS maps, the program must have a symbolic definition of the maps that it uses to send or receive data. This symbolic definition is stored in a load module, which is generated when you compile the BMS maps and mapsets.
When you compile a BMS mapset, a copyfile .cpy is, by default, generated for it in the project directory, and also a load module .mod.
The filename given to the load module is by default mapset.mod, where mapset is the name field of the BMS mapset's properties and is defined in the DFHMSD macro in the BMS source; it is not the name of the BMS mapset file itself. Any EXEC CICS SEND MAP commands must use this mapset name. You can override the default name mapset.mod and specify your own filename, in the BMS Build Settings, on the Advanced tab, in the DSECT and MAP fields.
When Enterprise Server runs the application, it needs to know where the BMS load module is. You specify its location using the TXMAPP environment variable, but more of this later.
To compile the BMS mapset for the demonstration application:
By default, the settings specify that both the BMS copyfile and load module are generated. You can prevent generation of these by unchecking DSECT and MAP as needed.
The acctset.cpy copyfile is generated and added to the files list on the right of the project. The acctset.mod load module is also generated.
You can compile CICS COBOL programs using Net Express.
When you compile CICS, you use the CICS External Compiler Module (preprocessor or ECM). This is invoked by the CICSECM() directive, which you set when you choose EXEC CICS in the project build settings.
The type of object files created, and where they are put, depends on the build type you select. For the default build type, General Debug Build, they are .int and .idy files and they go in the debug directory.
When Enterprise Server runs the application, it needs to know where the object files are. You specify their location using the TXTRANP environment variable, but more of this later.
To compile the demonstration application:
If you used the default build type, Debug Build, the build created . int and .idy files and put them in the Examples\Net Express IDE\mto-bms\debug directory of your Net Express installation.
Note:
When you come to compile your own CICS applications, you might need to specify other Compiler directives. For more information see the section Compiler Directives
To deploy to Enterprise Server, you need to:
To do these tasks (apart from copying files), you use the Enterprise Server Administration console and Enterprise Server Monitor and Control (ESMAC). See the chapters:
All the files for your application need to be available to the enterprise server that will run your application. You will probably want to copy the application files, for example, if you want them on the same machine as the enterprise server or if you want them in a different location from the files you are continuing to work on.
Your application comprises the following files:
The acct demonstration uses a file called acctfil, which is created using a CFCR transaction when you run the application, but more of this later
For debugging, you will also need to include the dictionary (.idy) files for the application.
You enable and disable MSS in Enterprise Server Administration on the Edit Server page for the enterprise server that will run the CICS application.
To enable MSS for the demonstration application:
The enterprise server needs to be stopped and restarted for these changes to take effect, but you can do this later, because there are more changes to make first.
Your application files need to be in directories where Enterprise Server can find them. To ensure this, you specify the locations of the files using the Properties > MSS page for the enterprise server which runs your application.
You might need to set the following fields on the MSS page::
| Field | Type of Files Pointed to |
|---|---|
| Transaction Path | Executable program files (.int, .idy and so on) |
| VSAM File Path | Data files |
| Map Path | Load modules from BMS maps (.mod) |
| Resource Definition File Path | Resource definition file (dfhdrdat) |
To configure the search paths for the demonstration application:
| Field | Set to... |
|---|---|
| Transaction Path | examples-dir\Net Express IDE\mto-bms\debug |
| VSAM File Path | examples-dir\Net Express IDE\mto-bms |
| Map Path | examples-dir\Net Express IDE\mto-bms |
where examples-dir is the path to your Net Express Examples directory. You can specify a drive letter and have spaces in the path, if necessary.
You need to set up a listener to listen for incoming CICS requests and to pass the requests to the enterprise server for processing.
If your CICS application includes BMS maps, you need to use a TN3270 listener, since the end user interacts with the application through a TN3270 terminal. If your CICS application has a client program that uses the External Call Interface to send requests to the IBM CICS Transaction Gateway, you use an MSS-ISC listener.
To add a TN3270 listener for the demonstration application:
Then click Add to return to the configuration page.
Note: You must stop Enterprise Server from the Enterprise Server Administration console, if you started it there. If you started it from the command line or from the IDE (either the Tools menu or the Start Debugging dialog box), you must stop from either the command line or the Tools menu. This is a security restriction.
The CICS resources that your application uses include things like System Initialization Tables (SITs), startup lists, data files, transactions, programs and so on. These need to be defined and the definitions available at run time for Enterprise Server to access when running the CICS application.
The CICS resources are defined in the Resource Definition file dfhdrdat (with index dfhdrdat.idx). This is an ISAM file.
You can edit the resource definitions using ESMAC, which provides a graphical user interface. Alternatively, you can edit them using a text editor, but to do this, you first need to export the resource definition tables from the dfhdrdat file, and when you have finished editing, you need to import the tables back again.
When Enterprise Server runs the application, it needs to know where the application's dfhdrdat file is. You specify its location using the TXRDTP environment variable.
You can change the CICS resources that your CICS application uses by using ESMAC.
To use ESMAC to examine the resource definitions for the demonstration application:
This shows summary information of the application that the server is running and its transactions.
Notice that the first group is DFH$ACCT for the ACCT demonstration program. If you click the Details button for this group, you display information on the demo's resources, and you can click Details again to see further details on each item.
You can edit the CICS resource definitions as text, but first you need to export the resource definition tables from the Resource Definition file dfhdrdat. When you have edited the resource definition tables in a text editor, you then need to import them back into dfhdrdat.
The dfhdrdat containing the supplied resource definitions, which includes those for demonstration applications, is installed in the following location:
You use the following command line tools for importing and exporting resources:
| casrdtup | Imports the resource definition tables in a specified file into the resource definition file dfhdrdat |
| casrdtex | Exports the resource definition tables from the resource definition file dfhdrdat to a specified file |
These tools use the TXRDTP environment variable to find the directory containing the dfhdrdat. You can enter casrdtex and casrdtup at the command line to display a full list of the switches available.
To edit the resource definitions of the demonstration application:
set TXRDTP=net-express\base\files\sys
casrdtex /g /omyresources.rdt
where:
| net-express | is the directory where Net Express is installed |
| /g | means export all groups |
| /o | indicates that the name of the output file follows. Notice that there is no space after the o. |
casrdtup /fmyresources.rdt
Where /f indicates the name of the input file follows.
When you run a CICS application under Enterprise Server, you run it in the same way as you would run it on the mainframe. If you run it from a 3270 terminal or emulator, you enter transaction IDs at the terminal.
Note that on a PC the keys assigned to act as the CICS keys depend on your TN3270 emulator. For example, in many cases the Escape key is used as the 3270 Clear key, and the right-hand Ctrl key is used as the 3270 Enter key.
To run the demonstration application:
| Session name | A name of your choice |
| Host name | Computer running the enterprise server, for example localhost |
| Port | The port number of the listener you specified in the section Adding a Listener |
| Host type | CICS |
The CFCR transaction creates an empty file acctfil in the directory indicated by the environment variable TXFILEP.
You can now use this application. You add entries in the second half of the screen, giving them a Reason of "N" and other fields to suit yourself. You search for entries in the top half of the screen.
You can start debugging by using:
Note: When you have finished debugging, you must stop the debugger before you stop the enterprise server. This stops all the active transactions and ensures the enterprise server stops cleanly.
This requires no changes to your program code. It does, however, require that you associate your project with the enterprise server on which your CICS application will run. You must also ensure that the enterprise server is configured to enable dynamic debugging.
Note: When you browse for enterprise servers, Net Express will check on each of the machines specified in the mfclient.dat file. This is located in the base\bin directory of your Micro Focus software installation.
The dialog displayed enables you to specify the details of the application that you want to debug.
You use this tab to specify the details of the application that you want to debug. Enterprise server uses this information to inform your IDE when the application is started.
Net Express now passes the service details to the enterprise server and waits for the application to start.
Each time a CICS application is started, the enterprise server will check to see if it matches the details that you provided. If it does, the enterprise server attaches the Net Express debugger to the application.
The IDE debugger now waits for the application to start again.
To have the debugger start when you start a particular application, specify the INITCALL Compiler directive with the CBL_DEBUGBREAK switch, when you compile the application.
casstart /rESDEMO
A new instance of the Net Express IDE starts, with the source of ACCT00 ready to debug.
To have the debugger start when any application is started in a particular enterprise server, use the command cassi with the /a switch. This command works only if you started the enterprise server from the command line, using the casstart command.
With both these commands, you use the /r switch to specify the enterprise server. There must be no space between the r and its value, for example: casstart /rESDEMO. If you omit this parameter, it defaults to ESDEMO.
See the reference help topics casstart and cassi for details.
If you started ESDEMO from the Net Express IDE, you don't need to stop it.
casstart /rESDEMO
cassi /a /rESDEMO
The source of the file acct00.cbl opens in Net Express ready for you to debug.
casstop /rESDEMO
To avoid migration issues that arise when the application is moved from the mainframe to the PC you might have to specify some or all of the following Compiler directives:
| DEFAULTBYTE"00" | Specifies that all fields (both numeric and alphabetic) are initialized to LOW-VALUES. Use DEFAULTBYTE"00" to emulate the mainframe behavior of initializing index values to LOW-VALUES. |
| DEFAULTBYTE"48". | Specifies that all fields (both numeric and alphabetic) are initialized to zero. Use DEFAULTBYTE"48" to emulate the mainframe behavior of initializing numeric fields to zeros. |
| HOST-NUMMOVE | Specifies that run-time system error 163 ("Illegal character in numeric field") occurs when moving an alphanumeric literal or figurative constant to an integer numeric data item of USAGE DISPLAY. |
| NOMFCOMMENT | Stops an asterisk in column 1 from indicating that the whole line is a comment. |
| PERFORM-TYPE"OSVS" | Provides compatibility with the mainframe behavior of OS/VS COBOL and DOS/VS COBOL with regard to whether performed sections are dropped through or returned from. You need this directive if you use the HANDLE ABEND, HANDLE AID or HANDLE CONDITION CICS API calls. |
| SPZERO. | Specifies that space characters in numeric data items of USAGE DISPLAY are to be treated as zeros. |
Copyright © 2008 Micro Focus (IP) Ltd. All rights reserved.