Notes
Slide Show
Outline
1
RDz Workbench – BMS Map Editor
  • Jon Sayles
2
IBM Trademarks and Copyrights
  • © Copyright IBM Corporation 2007,2008, 2009.  All rights reserved.


  • The information contained in these materials is provided for informational purposes only, and is provided AS IS without warranty of any kind, express or implied.  IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, these materials.  Nothing contained in these materials is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement  governing the use of IBM software. References in these materials to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates.


  • This information is based on current IBM product plans and strategy, which are subject to change by IBM without notice. Product release dates and/or capabilities referenced in these materials may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature availability in any way.


  • IBM, the IBM logo, the on-demand business logo, Rational, the Rational logo, and other IBM Rational products and services are trademarks or registered trademarks of the International Business Machines Corporation, in the United States, other countries or both. Other company, product, or service names may be trademarks or service marks of others.
3
Course Contributing Authors
  • Thanks to the following individuals, for assisting with this course:
    • David Bean/IBM
    • Russ Courtney/IBM



4
Purpose of This Document
    • Course Name:  COBOL Foundation Training - with RDz


    • Course Description:  Learn the COBOL language, RDz and learn z/OS terms, concepts and development skills in this course.


    • Pre-requisites: Some experience in a 3rd or 4th Generation Language is expected.  SQL is also recommended.


    • Course Length: 10 days


    • Topics (Agenda)
      • Getting Started - installing and configuring RDz - and the course  materials, and using Eclipse to edit COBOL
      • COBOL General Language Rules
      • Basic COBOL Statements
      • Data records and table handling
      • Debugging Programs - Note: Deep dive on using RDz for common COBOL programming errors (001, 0C4, 0C7, infinite loops, fall-thru, etc.)
      • Input/Output and Report Writing Patterns
      • Sequential File Match/Merge Patterns
      • COBOL Subprograms and the Linkage Section
      • Structured Programming Concepts and Coding Patterns
      • Advanced Character Manipulation, COBOL Intrinsic Functions, Date and Time coding patterns, and Language Environment calls
      • OS/390 Concepts and JCL
      • Compile/Link & Run Procs on the mainframe
      • Indexed file Coding Patterns
      • Sort/Merge and Master File Update Coding Patterns
      • Accessing DB2 Data and Stored Procedures
      • COBOL in the Real World:
        • CICS - lecture only
        • IMS (DL/I and TM) - ditto
        • Batch processing - ditto
        • Java calling COBOL
        • COBOL and XML Statements
        • SOA and COBOL - creating and calling Web Services
        • Web 2.0 using Rich UI


5
Course Details
  • Audience
    • This course is designed for application developers who have learned or programmed in a 3rd or 4th generation language – and who need to build leading-edge applications using COBOL and Rational Developer for System z.

  • Prerequisites
    • This course assumes that the student has a basic understanding and knowledge of software computing technologies, and general data processing terms, concepts and vocabulary.
    • Knowledge of SQL (Structured Query Language) is assumed for database access is assumed as well.
    • Basic PC and mouse-driven development skills, terms and concepts are also assumed.
6
The RDz Workbench
7
Objectives
  • After completing this unit, you should be able to:
    • Describe the types of 3270 data streams available to CICS applications
    • Define the three BMS macros
    • Define an "attribute byte"
    • Describe how to code BMS macros (manually)
    • List a few of the BMS field macro attributes
8
Brief Mini-Tutorial on BMS
9
"Real"  BMS  Developers
10
What is BMS?
11
3270 Terminal Characteristics – Vocabulary
  • A 3270 terminal device is a field oriented display
    • Screen divided into user defined fields
    • Each field has characteristics, determined (programmed) by ATTRIBUTE BYTES – which assume the first character of each field
        • Each attribute byte is displayed as a space, but it is NOT available for data entry













  • With BMS you send and             receive data to/from 3270 terminals using BMS maps
12
BMS Map – Mapset, MAPs and Fields
  • A complete BMS map is composed of a Mapset, Map and individual defined fields
  • A Mapset defines the MAP(s) used by program
  • A MAP provides for screen formatting
  • Maps consist of  one-to-many Field definitions
  • A MAPSET is group of screens (1 or more MAPs)
    • Normally there is only one MAP per MAPSET
  • Only three macro’s used to create a BMS map
    • See next slide
  • Usually a ‘Screen Generator’ (like RDz's Screen Painter) is used to develop BMS screens
13
BMS Mapset – Three Native Coding Macros
  •       BMS (native coding) uses assembler macros to define screen layout(s)


    • DFHMSD = mapset descriptor (one per mapset)


    • DFHMDI = map descriptor initiator (one per map)


    • DFHMDF = map descriptor field (one for each map field)


  •      Note: DFH = Always means "CICS"
14
Code BMS Macros
  • Like most of the IBM assembly languages, BMS is column oriented.
  • Labels must start in column 1.
  • Macros (BMS statements) may not extend beyond column 71, unless they are continued to the next line.
    • Continue a macro by coding an X in column 72
    • Macros may have one or more parameters
    • Each parameter is separated by a comma
  • Comments can be coded after statements and before the continuation character
15
Define a Mapset
  • To define the mapset.
    • <MapsetName>  DFHSMD TYPE=(type of mapset),
    • MODE=<how map is used>,
    • CTRL=FREEKB,  (Note: FREEKB is the default)
    • LANG=<language>,
    • TIOAPFX=YES,
    • …


  • To end a mapset definition
    • DFHSMD TYPE=FINAL
16
Define a Map
17
Define Fields
18
BMS Quiz
  • Based on the BMS statements below,
    • Fill in the screen capture on the left, with the proper names for the Mapset/Map(s) where the underscores currently exist.  Then answer the following questions:
      • What are the names of the two BMS maps?
      • What is the size of the MAPB 3270 device?
      • Where is the cursor initially going to be placed?
      • What are the names of the four fields in MAPA?
      • Where will "Enter Key" be placed on the 3270 screen?
      • What does the PROT attribute do for a field?
19
Objectives
  • After having completed this unit, you should now be able to:
    • Describe the types of 3270 data streams available to CICS applications
    • Define the three BMS macros
    • Define an "attribute byte"
    • Describe how to code BMS macros (manually)
    • List a few of the BMS field macro attributes
20
The RDz Workbench
21
Objectives
  • After completing this unit, you should be able to:
    • List the features of the BMS map editor
    • Use the BMS map editor to create several different kinds of BMS screens
    • Describe how to import existing BMS maps
    • Show how to generate BMS maps
    • List the outputs of the generate process
    • Describe how to deploy BMS maps on z/OS
    • Describe how to run and test BMS-map applications
  •                The RDz Help system has excellent documentation
  • From the menu: Help   >  Help Contents   Search on: Using the BMS Map Editor
        • From the inline help on the BMS Map Editor, check out the Tutorial                              – available as a hyper-link in the help text
22
Coding a BMS Mapset …vs… Creating a BMS Mapset
  • Options for BMS developers…
23
Loading a BMS Mapset into the Design Canvas
  • The BMS editor opens on a file recognized as a BMS map set.



  • For an existing z/OS file, the file or dataset must:
    • Be named with an extension of .BMS
    • … or be mapped to a .bms file extension using the z/OS Mapping System view
24
The BMS Map Editor – Overview
25
Source View Mode
  • Displays your BMS file in source (macro/assembler) mode
    • Customized color highlighting
    • Line numbers
    • Syntax error markers


  • Field selection is maintained between Design çč Source mode


  • At any time during your BMS work you can flip from Design ŕ Source ŕ Preview mode
26
Source View Mode – Context Menu Options
  • Standard source-level development  editing options available:
    • Save
    • Cut
    • Copy
    • Paste
    • Shift Right/Left
    • Snippets
    • Compare/Replace With (next slide)


27
Source View Mode –                      Compare/Replace With Options
  • Same functionality as the LPEX editor for source files
28
Preview Mode
  • Here is the same BMS dataset in Preview mode
    • Note that we have set Toggle Sample Values "on" in Design mode, for this screen capture




  • Preview mode is basically for screen documentation, design-reviews and prototyping your 3270-U.I.
    • There is no application COBOL/CICS Send/Receive logic executing
    • But you could use Preview mode effectively during           U.I. Design/JAD sessions with business users


29
The BMS Map Editor – Design Mode
30
BMS Editor – Toolbar Display Options (Part 1 of 2)
  • Display options enable you to control how Mapsets are displayed in the editor at design time.
    • Size – drop-down list to select a new size for the Map
    • Toggle Gridlines – shows or hides a grid over the form to help in sizing and arranging fields


    • Toggle Sample Values – shows or hides sample values for input fields, which are otherwise invisible unless they have the Initial property specified
31
BMS Editor – Toolbar Display Options (Part 2 of 2)
  • Display options enable you to control how Mapsets are displayed in the editor at design time.


    • Toggle Black and White Mode – switches the editor between black and white mode and full color mode using the default background color


    • Zoom level – sets the magnification level of the editor


    • Filters (see next slide)
32
BMS Editor – Filters
  • Filters enable you to
    • Focus on just one Map within a Mapset


    • Review the appearance of a popup form and its underlying form


    • Select or deselect to filter the forms you want to include in the default filter
33
BMS Editor – Palette View
34
BMS Map Enhancements – Using the Palette – 1 of 6
  • Let's add phone# as a new literal and field to BADD400.BMS.  To that we'll:
    • Select and move the existing/related Salary fields down two rows
    • Add a literal and input field
  • Selecting and dragging BMS fields – options:
    • To select a single field, simply:
      • Left-Click the field to set focus
      • (Holding down the left mouse button) Drag the field to its destination
    • To select multiple fields:
      • Hold down the Ctrl key
        • Left-Click each field you wish to select
        • (Holding down the left mouse) Drag the fields to their destination

    • Or use the Marquee selector:
      • Click the Marquee selector (this allows you to "lasso a rectangular group of fields)



      • (Holding down the left mouse button) Lasso the fields and select them


      • Change selector back to an arrow pointer


      • (Holding down the left mouse button) Drag the field to its destination


  • Note that you could also use your PC's up/down/right/left arrows                       – to select (not move, just select) fields in your BMS map
35
Using the Palette – 2 of 6 – Adding New Fields
  • Add a new Label to Row 16, column 4 - from the Palette
    • Left-click to select: Label
    • Holding down the left-mouse button
      • Drag the mouse pointer to:
        • Row: 16
        • Column: 4
      • Drop






    • Type in the label's text:  PHONE:



  • A few things:
    • You will notice that the widget's color is blue (not turquoise).  This can be:
      • Changed for this one label (next slide)
      • Changed for all new labels (from BMS Editor Preferences – covered in a bit)
    • If you make an mistake and drop the field in the wrong place – or you type something else that needs fixing, you will find it easy to modify every element of your BMS field
      • Next slide…
36
Using the Palette - 3 of 6 - Customizing Field Properties
  • The BMS Editor allows you to modify every element of                       your screen using a consistent Properties dialog
    • Right-click over the field
    • Select Field Properties…
  • From Field Properties you can customize virtually                 any element of a BMS screen field:
    • From Basic:
      • Enter BMS field name
        • Note that labels are        rarely named in        BMS maps
      • Add a comment
      • Alter the layout R/C
      • Change field length
      • Modify initial value
      • Change color
        • Click the color     tablet


  • The Field Properties dialog is             available for new, or existing                    (from an imported BMS) map                         fields
37
Using the Palette – 4 of 6 – Additional Field Properties
  • Besides Basic there are three additional   Field Properties dialogs:


    • Presentation:
      • Intensity, Highlighting, Transparency
      • Different types of boxed outlines


    • Attributes:
      • Disabling/Enabling data entry
      • Adding Validation logic


    • Advanced:
      • Gives you control over the creation of COBOL group data structures to handle sub-elements of a field with individual variables – yet be able in COBOL to address the entire group as a single structure
        • Example:  mm  /  dd  /  yyyy   - could be thought of a single date group field, composed of five elementary items (see Slide Notes)
38
Using the Palette – 5 of 6 –  Add an Input Field
  • Add a new Input Field to Row 16, column 11 - from the Palette
    • Left-click to select: Input Field
    • Holding down the left-mouse button
      • Drag the mouse pointer to:
        • Row: 16
        • Column: 11
      • Drop
      • (optional) Using your mouse, stretch (resize) the new input field as shownč

  • Customize the input field's properties:
      • As shown in the screen captures here
      • Or – feel free to experiment with your own options for this new field (this is not a production map)


39
Using the Palette – 6 of 6 –  Finished Enhancement
  • Added – Phone              number field with literal label and               initial value





  • If you already know               BMS, consider looking                     at the Source view to         see what has been         generated for your               Fields


40
Defining Table Structures
41
Define an Array
42
Define a Table – 1 of 2
43
Define a Table – 2 of 2
44
Define a Structure – 1 of 2
45
Define a Structure – 2 of 2
46
The BMS Map Editor – Context Menu – 1 of 2
47
The BMS Map Editor – Context Menu – 2 of 2
48
BMS Form Editor – Properties and Outline Views
49
Creating a New BMS Mapset
  • Besides maintaining existing BMS, you may wish to create completely new Mapsets/Maps using the BMS editor.
  • Here are the steps:
        • Create New BMS Mapset and Map
        • Customize the Map Properties
        • Use the Palette widget tools (as shown before) to create individual BMS fields and to customize field properties


  • Optionally – You can generate JCL for assembling your map using z/OS project tooling


  • And – You can customize the BMS map editor's preferences
50
1. Create New BMS Mapset
  • From the File menu, select:
    • New   >   Other…
    • From the New dialog, type:  Map and select BMS – Map Set
    • Select a Folder for your new Mapset (if created on z/OS), or if   creating on your workstation, select a Project location
51
New Mapset and Map – 1 of 4
52
New Mapset and Map – 2 of 4
53
New Mapset and Map – 3 of 4
54
New Mapset and Map – 4 of 4
55
Generated JCL Properties for a Mapset
56
The link options for a map set
57
The application entry point properties
58
Building the Mapset -        Symbolic map
59
Building the Mapset - Physical Map
60
Viewing maps on CICS
  • Place physical map set file in a CICS RPL library
    • Can be targeted by Link Options property “Load Module Location”
  • Define the map set resource to CICS
    • CEDA DEFINE MAPSET(myset) GROUP(mygroup)
  • Make the new map set resource available
    • CEDA INSTALL GROUP(mygroup)
  • View a map in the map set, under CICS
    • CECI SEND MAP(mymap) MAPSET(mygroup)
61
Using BMS maps in a CICS COBOL program
  • Create the symbolic and physical maps first
    • Assemble-Link JCL
  • Typically use COPY statement to include the map fields in the Data Definition section of the program
  • Compile COBOL program, including CICS option
  • Define both program and map set to CICS
    • CEDA DEFINE PROGRAM(myprog) GROUP(mygroup)
    • CEDA DEFINE MAPSET(mymapset) GROUP(mygroup)
  • Define transaction to initiate the program
    • CEDA DEFINE TRANSACTION(mytr) GROUP(mygroup)
  • Install resources
    • CEDA INSTALL GROUP(mygroup)
  • Execute transaction!
    • mytr
62
BMS Palette, Widget Field Preferences
63
Checkpoint
64
Workshop – Four BMS MAPS
  • In the Slide Notes is sample BMS code for four simple 3270/BMS screens:
      • BADD400
      • BMEN400
      • BINQ400
      • BDLT400
  • From z/OS Projects:
    • Create a \bms\ folder
    • Inside the \bms\ folder:
      • Create four new files             – one for each of the         BMS source files in the Slide Notes
    • Save each file
      • Use .bms as the file's extension
    • Ensure there are no                 syntax errors
65
Workshop – Using the Sample BMS Provided
  • Return to the slides in this unit – starting with: Loading a BMS Mapset into the Design Canvas
  • Follow the steps and/or directions on the slides to:
    • View BMS in different modes: (Design/Source/Preview)
    • Maintain a BMS Mapset:
      • Move fields in a map to different locations
      • Add fields
        • Set custom properties
        • Change field sizes
      • Align fields
      • Define complex fields:
        • Arrays
        • Tables
        • Structures
    • Create a new BMS map from scratch
    • Optionally customize your project properties to Generate JCL to assemble your BMS Mapset
66
Summary
  • Having completed this unit, you should be able to:
    • Describe the function of BMS maps
    • Describe the components of BMS maps
    • Show the features of the BMS map editor
    • Describe how to import existing BMS maps
    • Show how to generate BMS maps
    • List the outputs of the generate process
    • Describe how to deploy BMS maps on z/OS
    • Describe how to run and test BMS-map applications

67
Appendix
  • Module 9: CICS BMS maps
68
Output from BMS Mapset Assembly