|
1
|
|
|
2
|
- © 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
|
- Thanks to the following individuals, for assisting with this course:
- David Bean/IBM
- Russ Courtney/IBM
|
|
4
|
- 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
|
- 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
|
|
|
7
|
- 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
|
|
|
9
|
|
|
10
|
|
|
11
|
- 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
|
- 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
- Usually a ‘Screen Generator’ (like RDz's Screen Painter) is used to
develop BMS screens
|
|
13
|
- 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
|
- 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
|
- 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
|
|
16
|
|
|
17
|
|
|
18
|
- 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
|
- 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
|
|
|
21
|
- 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
|
- Options for BMS developers…
|
|
23
|
- 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
|
|
|
25
|
- 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
|
- Standard source-level development
editing options available:
- Save
- Cut
- Copy
- Paste
- Shift Right/Left
- Snippets
- Compare/Replace With (next slide)
|
|
27
|
- Same functionality as the LPEX editor for source files
|
|
28
|
- 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
|
|
|
30
|
- 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
|
- 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
|
- 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
|
|
|
34
|
- 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
|
- 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:
- 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
|
|
36
|
- 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
- The Field Properties dialog is available for new, or
existing (from
an imported BMS) map fields
|
|
37
|
- 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
|
- 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:
- 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
|
- 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
|
|
|
41
|
|
|
42
|
|
|
43
|
|
|
44
|
|
|
45
|
|
|
46
|
|
|
47
|
|
|
48
|
|
|
49
|
- 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
|
- 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
|
|
|
52
|
|
|
53
|
|
|
54
|
|
|
55
|
|
|
56
|
|
|
57
|
|
|
58
|
|
|
59
|
|
|
60
|
- 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
|
- Create the symbolic and physical maps first
- 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!
|
|
62
|
|
|
63
|
|
|
64
|
- 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
|
- 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:
- Create a new BMS map from scratch
- Optionally customize your project properties to Generate JCL to
assemble your BMS Mapset
|
|
66
|
- 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
|
|
|
68
|
|