You can read the CICS Section of the Getting Started Guide for a better understanding of how Elastic COBOL and Elastic Transaction Platform combine to provide full CICS functionality in a stand-alone server environment or on the Enterprise Legacy Platform-as-a-Service environment. Or, you could just follow this cookbook recipe and attached programs to run a CICS transaction within 5 minutes or so.
The CICS demo transaction here represents the pseudo-conversational nature of CICS/COBOL programming, roughtly akin to way Web services programming is used today in Web 2.0 applications. It shows BMS (green screen) user interface and CICS journalling (debugging log) facility.
You can use the enclosed demo programs to add more transactions that use SQL or CICS file I/O mapped to SQL databases or other advanced features. See the Getting Started Guide for a more complete demo and screenshots of the various Eclipse and Elastic COBOL dialog boxes mentioned here.
Cloud or Desktop Based Demos
You can run this demo in the cloud using the trial or free versions of Elastic COBOL and Enterprise Legacy Platform-as-a-Service. Sign up for the free version of each and "Power On" instances of your development environment and deployment environment through the portals on www.elasticcobol.com and www.elpaas.com. No other setup is required.
Or, you can set up the Elastic COBOL interactive development environment and a JEE Application Server (which acts as the CICS region or LPAR) on your desktop.
Register for the 30-day free trial or non-commercial use version of Elastic COBOL at www.elasticcobol.com. Download the Eclipse development environment with the Elastic COBOL IDE plug-in from that site. Also download the latest Geronimo Application Server and install it on your desktop system.
COBOL Project Setup
A COBOL Project within Eclipse sets up the executable programs for one or more CICS transactions. Use the two files attached to this article to set up the project.
- Start Eclipse with a new workspace directory and switch to the "Elastic COBOL" perspective using the Perspectives button in the upper-right.
- Create a new COBOL Project with the Eclipse "File" > "New" menu.
- From the New COBOL Project dialog box, name the project "ctst" and select "Compatibility" pull-down selection of "Elastic Transaction Platform Template"
- Copy the "CICSCTST.CBL" file into the "ctst" project's "cobol_source" folder (e.g., by dragging the file name from a Windows Explorer window to the Eclipse Navigator window, cobol-source folder)
- Copy the "BMSCTST.BMS" file into the "ctst" project's "resources" folder.
- Right-click on "BMSCTST.BMS" and select "Elastic COBOL BMS" > "Generate Copyfile"
- Right-click on "BMSCTST.BMS" and select "Elastic COBOL BMS" > "Generate HTML"
- Use Eclipse menu "Project" > "Clean" to recompile the program
- Deployment Project Setup
An ETP Project sets up the CICS configuration (SYSID, APPLID, transaction mappings) that are necessary to tie the COBOL program to a set of CICS names.
- Create a new ETP Project named "ctst-deploy" with the Eclipse "File" > "New" menu
- Double-click on the "ctst-deploy" file "project.etp_deploy_settings" to begin editing the ETP Deployment Settings
- In the General tab, select the "ctst" project and set the SYSID to "ctst"
- In the Programs tab. add the program "cicsctst" and select "cicsctst" class from the list of classes
- In the Transactions tab, add the transaction "init" and associate it with the program "cicsctst"
- In the Journals tab, add the journal "info" as type "SYSOUT" for this output to go to Geronimo's "geronimo.out" logging file or as type "TextFile" and specify a filename like "C:\\temp\\ctst.txt" to have a separate log
- Click "Apply" in the ETP Deploy Settings
Deploy the CICS Region
This series of steps define the CICS Region embedded in the ear file toy our JEE Application Server. If running in the cloud (your region was started with the www.elpaas.com portal) choose to deploy as "Cloud". If running on a desktop, choose "Traditional."
- Right click on the "ctst-deploy" project in the Eclipse Navigator pane and select "Export" > "Elastic COBOL" > "Elastic Transaction Platform Deploy Wizard"
- In the ETP Deploy Wizard dialog box, use "Browse" next to "Ear File" to select a folder in which to place the Enterprise Archive then append "/ctst.ear" to it
- In the ETP Deploy Wizard dialog box, click "Finish" and "OK" and "OK"
- Start Geronimo or other JEE App Server. This can be done from within Eclipse with the "Servers" view or from Geronimo's startup.bat command
- For Geronimo, access "http://localhost:8080/console" and enter "system" and "manager" (in the cloud use your registration name (email box without the "@company name") and password you registered as)
- On the "Deployer" tab, select the "ctst.ear" file you exported
Run the CICS Transaction
- Enter "http://localhost:8080/ctst/servlet" in a new browser tab to start the transaction
- Enter "123 " in the first field and either "$1234.56" or "1234.56" in the second field and hit the "Enter" button
- If started in Eclipse and the journal has been set to "SYSOUT" or "SYSERR" the CICS journal message will appear in Eclipse's console. If using a Text File journal, the entry will be sent to the file you specified.
This demo is not complete. For example, if you hit PF3 it will attempt
but there is no menu transaction. It will ABEND with code AEI0 error PGMIDERR. Copy the code and map and rename everything CMNU, adding in the new program and transaction into the deploy settings. Change the map and the logic to act like a menu selecting CTST. Add other features from your CICS usage into this project. Have fun with CICS! According to a May 2013 study 15% of all new programs built by IT are done are in COBOL!