Column and margin manipulation in ISPF involves setting and working with column boundaries, margins, and column positions. The BOUNDS command sets editing boundaries, while columns commands help you work with fixed-format files where specific columns have meaning. This tutorial covers BOUNDS, column manipulation, margin settings, and techniques for working with column-based formatting.
Understanding column and margin manipulation is essential for working with fixed-format languages like COBOL, where specific columns have specific meanings. Proper column boundaries ensure you maintain correct formatting and avoid errors from text extending beyond allowed columns.
Understanding Columns and Margins
Columns and margins define the editable area and help maintain proper formatting.
What are Columns?
Columns are:
Vertical positions in a line
Numbered from left to right (typically 1-80 or 1-132)
Important for fixed-format languages
Used to position text correctly
What are Margins?
Margins are:
Left and right boundaries of the editable area
Defined by column positions
Restrict where you can type
Help maintain proper formatting
Why Columns and Margins Matter
Columns and margins are important because:
Fixed-format languages have column requirements
COBOL uses specific column areas (Area A, Area B)
Record length limits must be respected
Proper formatting ensures code compiles correctly
BOUNDS Command
The BOUNDS command sets the left and right column boundaries for editing.
Basic BOUNDS Syntax
Basic syntax:
text
1
BOUNDS leftcolumn rightcolumn
Where leftcolumn is the left boundary and rightcolumn is the right boundary.
BOUNDS Examples
Setting boundaries for full-width editing (columns 1-72):
text
1
Command ===> BOUNDS 1 72
Setting boundaries for COBOL Area B (columns 12-72):
text
1
Command ===> BOUNDS 12 72
Setting boundaries for a specific range (columns 8-72):
text
1
Command ===> BOUNDS 8 72
BOUNDS Behavior
When BOUNDS is set:
Editing is restricted to the specified column range
You cannot type outside the boundaries
Boundaries are enforced visually and functionally
Boundaries persist until changed or editor is closed
Boundaries apply to all editing operations
Changing BOUNDS
You can change BOUNDS at any time:
Use BOUNDS again with new column numbers
New boundaries take effect immediately
Previous boundaries are replaced
You can adjust boundaries as needed during editing
COBOL Column Areas
Understanding COBOL column areas helps you set appropriate boundaries.
COBOL Column Structure
COBOL uses specific column areas:
text
1
2
3
4
5
Columns 1-6: Sequence Number Area (optional)
Column 7: Indicator Area (continuation, comment, etc.)
Columns 8-11: Area A (division, section, paragraph names, level numbers)
Columns 12-72: Area B (procedure statements, data descriptions)
Columns 73-80: Identification Area (optional, for sequence numbers)
BOUNDS for COBOL
Common BOUNDS settings for COBOL:
BOUNDS 1 72: Full editing range (most common)
BOUNDS 12 72: Area B only (for procedure statements)
BOUNDS 8 72: Area A and Area B
BOUNDS 1 80: Full width including identification area
When to Use Each BOUNDS Setting
Use different BOUNDS settings based on what you're editing:
BOUNDS 1 72: General COBOL editing, allows access to all areas
BOUNDS 12 72: When writing procedure statements in Area B
BOUNDS 8 72: When working with Area A and Area B
BOUNDS 1 80: When you need the full record width
Column Display
Column display helps you see column positions while editing.
Column Markers
Column markers may be displayed as:
Column numbers at the top or bottom of the data area
Vertical lines marking specific column positions
Highlighted columns for important positions
Column rulers showing column positions
Enabling Column Display
Column display can be enabled through:
ISPF Settings (Option 0)
Editor display options
Panel-specific configurations
Function keys or commands (depending on ISPF version)
Column Display Benefits
Column display helps you:
See exact column positions
Position text correctly
Stay within column boundaries
Understand where different areas begin and end
Margin Settings
Margins define the left and right boundaries of the editable area.
Left Margin
The left margin:
Defines where text starts when you type
Typically starts at column 1, but can be configured
Can be set through BOUNDS or editor settings
Important for fixed-format languages
Right Margin
The right margin:
Defines where text ends
Typically corresponds to record length (LRECL)
Helps you stay within record length limits
Important for fixed-format languages where specific columns mark the end
Position division/section names in Area A (columns 8-11)
Position procedure statements in Area B (columns 12-72)
Use column 7 for continuation or comment indicators
Ensure lines don't extend beyond column 72
JCL Editing
When editing JCL:
JCL statements typically start at column 1
Continuation lines use column 72 for continuation indicator
Set BOUNDS appropriately (typically 1 72)
Respect column positions for proper JCL syntax
Other Fixed-Format Files
For other fixed-format files:
Understand the column requirements
Set BOUNDS to match the format
Use column markers to maintain alignment
Respect record length limits
Best Practices
Following best practices helps you work with columns and margins effectively:
Set BOUNDS Early: Set appropriate BOUNDS when you start editing
Use Column Markers: Enable column markers to see positions
Understand Format Requirements: Know the column requirements for your file type
Respect Boundaries: Stay within BOUNDS to avoid formatting errors
Adjust as Needed: Change BOUNDS when switching between different areas
Verify Column Positions: Check that text is positioned correctly
Use Appropriate Settings: Set BOUNDS based on what you're editing
Test Formatting: Verify formatting is correct for your file type
Common Scenarios
Here are common scenarios for column and margin manipulation.
Editing COBOL Procedure Statements
When editing COBOL procedure statements:
Set BOUNDS 12 72 for Area B
Position statements starting at column 12
Ensure statements don't extend beyond column 72
Use column markers to verify positions
Editing COBOL Data Descriptions
When editing COBOL data descriptions:
Set BOUNDS 1 72 for full range
Position level numbers in Area A (columns 8-11)
Position data descriptions in Area B (columns 12-72)
Maintain proper column alignment
Switching Between Areas
When switching between COBOL areas:
Change BOUNDS as needed
Use BOUNDS 8 72 when working with both Area A and Area B
Use BOUNDS 12 72 when working only in Area B
Adjust boundaries based on current editing needs
Column Commands Reference
Here are common column-related commands and operations.
BOUNDS Command
Primary command for setting column boundaries:
text
1
BOUNDS leftcolumn rightcolumn
Column Display Toggle
Some ISPF versions support toggling column display. Check your ISPF documentation for available commands.
Column Navigation
You can navigate by column using:
Cursor movement keys
Column positioning commands (if available)
Status line to see current column position
Error Prevention
Preventing errors when working with columns and margins.
Common Mistakes
Avoid these common mistakes:
Wrong BOUNDS Settings: Use appropriate BOUNDS for your file type
Text Beyond Boundaries: Ensure text stays within BOUNDS
Wrong Column Positions: Verify text is positioned at correct columns
Ignoring Format Requirements: Respect column requirements for your format
Not Using Column Markers: Enable column markers to see positions
Recovery Strategies
If you make mistakes:
Adjust BOUNDS: Change BOUNDS if you set incorrect boundaries
Reposition Text: Move text to correct column positions
Use Column Markers: Enable column markers to verify positions
Review Format Requirements: Check format requirements and adjust accordingly
Explain Like I'm 5: Column and Margin Manipulation
Think of columns and margins like lines on a piece of paper:
Columns are like the numbers on a ruler. Each number tells you "this is position 1, this is position 10, this is position 50!" They help you know exactly where you are on the line, like using a ruler to measure where to put things.
Margins are like the edges of your paper. The left margin is like the left edge where you start writing, and the right margin is like the right edge where you stop. They keep your writing in the right place, like the edges of a piece of paper!
BOUNDS is like drawing lines on your paper. You say "you can only write between line 1 and line 72!" It's like drawing boundaries and saying "stay inside these lines!" This helps make sure everything is in the right place.
Column Areas are like different sections of your paper. In COBOL, there's Area A (like one section) and Area B (like another section). Each section has its own rules about where you can write, like having different areas on a form!
So column and margin manipulation is like having special guides and boundaries that help you write in exactly the right places on your "paper" (file), making sure everything is positioned correctly!
Practice Exercises
Complete these exercises to reinforce your understanding of column and margin manipulation:
Exercise 1: Setting BOUNDS
Practice setting BOUNDS: try different BOUNDS settings (1 72, 12 72, 8 72), observe how boundaries affect editing, and practice changing BOUNDS during editing. Build familiarity with boundary settings.
Exercise 2: Column Positioning
Practice column positioning: enable column markers if available, practice positioning text at specific columns, work with fixed-format files, and verify text is positioned correctly. Master column-based positioning.
Exercise 3: COBOL Area Editing
Practice COBOL area editing: set BOUNDS for Area A and Area B, practice positioning division/section names in Area A, practice positioning procedure statements in Area B, and verify column positions are correct.
Exercise 4: Margin Management
Practice margin management: understand left and right margins, set margins through BOUNDS, observe how margins affect editing, and practice working within margin boundaries.
Exercise 5: Format-Specific Editing
Practice format-specific editing: work with COBOL files using appropriate BOUNDS, work with JCL files, understand column requirements for different formats, and apply appropriate boundary settings.
Test Your Knowledge
1. What does the BOUNDS command do?
Finds text
Sets left and right column boundaries for editing
Saves the file
Deletes lines
2. What BOUNDS setting is appropriate for COBOL Area B?
BOUNDS 1 72
BOUNDS 12 72
BOUNDS 8 11
BOUNDS 1 80
3. Why are column boundaries important?
Only for display
For fixed-format languages like COBOL that have specific column requirements
Only for wide files
Only for debugging
4. Can you change column boundaries during editing?
No, they are fixed
Yes, by using BOUNDS again
Only administrators can
Only in some ISPF versions
5. What happens when you set BOUNDS?
Nothing
Editing is restricted to the specified column range