Using EPI BMS Map Classes

The map classes generated using CICSBMSC can be compiled and built into a Client application. Note that when building Windows® applications using pre-compiled headers, add #include stdafx.h to the .cpp file generated by CICSBMSC.

CclEPI, CclTerminal and CclSession objects are used in the normal way to start a CICS® transaction:
        try {
           // Initialize CICS Transaction Gateway EPI
           CclEPI epi;
           // Connect to CICS server
           CclTerminal terminal( "CICS1234" );
           // Start transaction on CICS server
           CclSession session( Ccl::sync );
           terminal.send( &session, "EPIC" );
In this example the server program uses a BMS map for its first panel, for which a map class "MAPINQ1Map" has been generated. When the map object is created, the constructor validates the screen contents with the fields defined in the map. If validation is successful, fields can then be accessed using their BMS field names instead of by index or position from the CclScreen object:
            MAPINQ1Map map( terminal.screen() );
            CclField* field;
            // Output text from "PRODNAM" field
            field = map.field(MAPINQ1Map::PRODNAM);
            cout << "Product Name: " << field->text() << endl;
            // Output text from "APPLID" field
            field = map.field(MAPINQ1Map::APPLID);
            cout << "Product Name: " << field->text() << endl;
        } catch (CclException &exception) {
            cout << exception.diagnose()<<endl;
        }

BMS Map objects can also be used within the handleReply method for asynchronous and deferred synchronous calls.

For validation to succeed, the entire BMS map must be available on the current screen. A map class cannot therefore be used when some or all of the BMS map has been overlayed by another map or by individual 3270 fields.