AI Generate BMS docs instantly

BMS Cheat Sheet

Quick reference guide with copy-paste ready code snippets

Try DocuWriter Free

Getting Started

2 snippets

Basic BMS map definition

Simple Map

MAPNAME  DFHMSD TYPE=&SYSPARM,LANG=COBOL,MODE=INOUT,
                CTRL=(FREEKB,FRSET),STORAGE=AUTO,TIOAPFX=YES
MAP1     DFHMDI SIZE=(24,80),LINE=1,COLUMN=1
         DFHMDF POS=(1,1),LENGTH=20,ATTRB=(BRT,PROT),
                INITIAL='SAMPLE SCREEN'
         DFHMSD TYPE=FINAL
         END

Field Definition

FIELD1   DFHMDF POS=(5,10),LENGTH=30,
                ATTRB=(UNPROT,IC),
                INITIAL='Enter Name:'

Map Definition

2 snippets

DFHMSD - Map Set Definition

Map Set Attributes

MAPSET1  DFHMSD TYPE=&SYSPARM,
                LANG=COBOL,
                MODE=INOUT,
                TERM=3270,
                CTRL=(FREEKB,FRSET),
                STORAGE=AUTO,
                TIOAPFX=YES

Multiple Maps

MAPSET1  DFHMSD TYPE=&SYSPARM,LANG=COBOL
MAP1     DFHMDI SIZE=(24,80),LINE=1,COLUMN=1
         * Fields for MAP1
MAP2     DFHMDI SIZE=(24,80),LINE=1,COLUMN=1
         * Fields for MAP2
         DFHMSD TYPE=FINAL

Map Definition (DFHMDI)

2 snippets

Individual map specifications

Basic Map

CUSTMAP  DFHMDI SIZE=(24,80),
                LINE=1,
                COLUMN=1,
                CTRL=(FREEKB,FRSET)

Map with Color

COLORMAP DFHMDI SIZE=(24,80),
                LINE=1,
                COLUMN=1,
                DSATTS=(COLOR,HILIGHT),
                COLOR=NEUTRAL

Tired of looking up syntax?

DocuWriter.ai generates documentation and explains code using AI.

Try Free

Field Definition (DFHMDF)

4 snippets

Defining screen fields

Input Field

CUSTNO   DFHMDF POS=(3,10),
                LENGTH=6,
                ATTRB=(UNPROT,NUM),
                INITIAL='______'

Protected Field

TITLE1   DFHMDF POS=(1,30),
                LENGTH=20,
                ATTRB=(BRT,PROT),
                INITIAL='CUSTOMER INQUIRY'

Output Field

NAMEO    DFHMDF POS=(5,20),
                LENGTH=30,
                ATTRB=(PROT,FSET)

Bright Field

ERRORMSG DFHMDF POS=(23,1),
                LENGTH=79,
                ATTRB=(BRT,PROT),
                COLOR=RED

Field Attributes

3 snippets

Common ATTRB values

Protection

* PROT - Protected (display only)
* UNPROT - Unprotected (input allowed)
* ASKIP - Autoskip (skip to next field)

FIELD1   DFHMDF POS=(5,10),LENGTH=20,ATTRB=PROT
FIELD2   DFHMDF POS=(6,10),LENGTH=20,ATTRB=UNPROT

Intensity

* NORM - Normal intensity
* BRT - Bright (highlighted)
* DRK - Dark (hidden, for passwords)

LABEL1   DFHMDF POS=(3,1),LENGTH=10,ATTRB=(PROT,BRT)
PASSWD   DFHMDF POS=(4,10),LENGTH=8,ATTRB=(UNPROT,DRK)

Cursor & Modified

* IC - Initial cursor position
* FSET - Field has been modified
* NUM - Numeric only

INPUT1   DFHMDF POS=(5,10),LENGTH=30,ATTRB=(UNPROT,IC)
AMOUNT   DFHMDF POS=(7,10),LENGTH=10,ATTRB=(UNPROT,NUM)

Color & Extended Attributes

2 snippets

Enhanced display features

Color Attributes

REDFIELD DFHMDF POS=(10,10),
                LENGTH=20,
                ATTRB=PROT,
                COLOR=RED

BLUEFLD  DFHMDF POS=(11,10),
                LENGTH=20,
                ATTRB=UNPROT,
                COLOR=BLUE

Highlight

HIFIELD  DFHMDF POS=(12,10),
                LENGTH=20,
                ATTRB=PROT,
                HILIGHT=BLINK

Symbolic Map Usage

2 snippets

COBOL copybook integration

Send Map (COBOL)

EXEC CICS SEND MAP('MAP1')
          MAPSET('MAPSET1')
          FROM(MAP1O)
          ERASE
          CURSOR
END-EXEC.

Receive Map (COBOL)

EXEC CICS RECEIVE MAP('MAP1')
          MAPSET('MAPSET1')
          INTO(MAP1I)
END-EXEC.

Common Patterns

3 snippets

Typical BMS map structures

Header Line

HEADER   DFHMDF POS=(1,1),
                LENGTH=80,
                ATTRB=(BRT,PROT),
                INITIAL='==== CUSTOMER MAINTENANCE ===='

Input/Output Pair

NAMEI    DFHMDF POS=(5,10),LENGTH=30,ATTRB=(UNPROT,IC)
NAMEO    DFHMDF POS=(5,10),LENGTH=30,ATTRB=(PROT,FSET)

Error Message Line

MSGI     DFHMDF POS=(24,1),LENGTH=79,ATTRB=(UNPROT,DRK)
MSGO     DFHMDF POS=(24,1),LENGTH=79,ATTRB=(BRT,PROT),
                COLOR=RED

More Cheat Sheets

FAQ

Frequently asked questions

What is a BMS cheat sheet?

A BMS cheat sheet is a quick reference guide containing the most commonly used syntax, functions, and patterns in BMS. It helps developers quickly look up syntax without searching through documentation.

How do I learn BMS quickly?

Start with the basics: variables, control flow, and functions. Use this cheat sheet as a reference while practicing. For faster learning, try DocuWriter.ai to automatically explain code and generate documentation as you learn.

What are the most important BMS concepts?

Key BMS concepts include variables and data types, control flow (if/else, loops), functions, error handling, and working with data structures like arrays and objects/dictionaries.

How can I document my BMS code?

Use inline comments for complex logic, docstrings for functions and classes, and README files for projects. DocuWriter.ai can automatically generate professional documentation from your BMS code using AI.

Code Conversion Tools

Convert BMS to Other Languages

Easily translate your BMS code to other programming languages with our AI-powered converters

Related resources

Stop memorizing. Start shipping.

Generate BMS Docs with AI

DocuWriter.ai automatically generates comments, docstrings, and README files for your code.

Auto-generate comments
Create README files
Explain complex code
API documentation
Start Free - No Credit Card

Join 33,700+ developers saving hours every week