Progress0 of 0 lessons

ISPF Panel Language and Structure: Fields, Variables, Attributes

Understanding ISPF panel language structure is essential for creating effective panels. The panel language defines fields for user interaction, variables for data storage, and attributes for field appearance and behavior. Mastering panel language structure helps you create professional, functional panels. This tutorial covers fields, variables, attributes, panel language syntax, and detailed structure.

ISPF panel language provides a structured way to define interactive screens. Fields enable user input and output display, variables store and manage data, and attributes control appearance and behavior. Learning the panel language in detail enables you to create sophisticated user interfaces. This tutorial provides comprehensive guidance on panel language structure.

Understanding Panel Language Structure

Panel language uses specific syntax and sections.

Panel Language Components

Panel language consists of:

  • Sections: )BODY, )ATTR, )INIT, )PROC, )END
  • Fields: Input, output, and text areas
  • Variables: Data storage and management
  • Attributes: Field appearance and behavior
  • Logic: Processing and control flow

Panel Definition Flow

Panel definition follows this flow:

  • Define attributes in )ATTR
  • Layout panel in )BODY using attributes
  • Initialize variables in )INIT
  • Process logic in )PROC
  • End with )END

Fields in Panels

Fields are interactive areas on panels.

Field Types

ISPF supports several field types:

  • Input Fields: Users can type data
  • Output Fields: Display-only information
  • Text Fields: Static text display
  • Selection Fields: For menu selections

Input Fields

Input fields allow user data entry:

  • Defined with TYPE(INPUT) in )ATTR
  • Marked with attribute character in )BODY
  • Associated with variables
  • Users can type and edit

Example input field:

text
1
2
3
4
5
6
7
)ATTR @ TYPE(INPUT) INTENS(HIGH) CAPS(ON) )BODY %Enter dataset name: @ZDSN )INIT .ZVARS = 'ZDSN' )END

Output Fields

Output fields display information:

  • Defined with TYPE(OUTPUT) in )ATTR
  • Marked with attribute character in )BODY
  • Display variable values
  • Read-only to users

Example output field:

text
1
2
3
4
5
6
7
)ATTR # TYPE(OUTPUT) INTENS(HIGH) )BODY %Current user: #ZUSER )INIT .ZVARS = 'ZUSER' )END

Text Fields

Text fields show static text:

  • Defined with TYPE(TEXT) in )ATTR
  • Used for labels and messages
  • Not associated with variables
  • Display-only content

Variables in Panels

Variables store and manage data in panels.

Variable Types

ISPF supports different variable types:

  • Z Variables: System-defined variables
  • User Variables: Application-defined variables
  • Panel Variables: Panel-specific variables

Z Variables

Z variables are system-provided:

  • ZUSER: Current user ID
  • ZPREFIX: User prefix
  • ZCMD: Command entered
  • ZSEL: Selection made
  • ZTDTOP: Table display top
  • Other system variables

User Variables

User variables are custom:

  • Defined by application
  • Stored in ISPF variable pool
  • Accessed with & prefix
  • Can be set and retrieved

Example user variables:

text
1
2
3
4
5
6
7
8
9
)BODY %Dataset name: @MYDSN %Member name: @MYMEM )INIT .ZVARS = 'MYDSN MYMEM' )PROC IF (&MYDSN = '') + .MSG = 'Dataset name required' )END

Variable References

Variables are referenced with & prefix:

  • &ZUSER references ZUSER variable
  • &MYDSN references MYDSN variable
  • Used in )PROC for logic
  • Used in )BODY for display

Attributes in Panels

Attributes control field appearance and behavior.

Attribute Definition

Attributes are defined in )ATTR:

  • Each attribute character is defined
  • Specifies field properties
  • Used in )BODY to mark fields
  • Controls appearance and behavior

Common Attribute Properties

Common attribute properties:

  • TYPE: Field type (INPUT, OUTPUT, TEXT)
  • INTENS: Intensity (HIGH, LOW)
  • JUST: Justification (LEFT, RIGHT, CENTER)
  • CAPS: Uppercase conversion (ON, OFF)
  • COLOR: Field color
  • SKIP: Skip on tab (ON, OFF)

TYPE Property

The TYPE property specifies field type:

  • TYPE(INPUT): User input field
  • TYPE(OUTPUT): Display-only field
  • TYPE(TEXT): Text area
  • Determines field behavior

INTENS Property

The INTENS property controls brightness:

  • INTENS(HIGH): Bright display
  • INTENS(LOW): Dim display
  • Affects visibility
  • Used for emphasis

JUST Property

The JUST property controls alignment:

  • JUST(LEFT): Left alignment
  • JUST(RIGHT): Right alignment
  • JUST(CENTER): Center alignment
  • Affects text positioning

CAPS Property

The CAPS property controls case:

  • CAPS(ON): Convert to uppercase
  • CAPS(OFF): Preserve case
  • Applies to input fields
  • Useful for dataset names

Panel Language Syntax

Understanding panel language syntax details.

Attribute Character Definition

Attribute characters are defined as:

text
1
2
3
4
5
)ATTR @ TYPE(INPUT) INTENS(HIGH) CAPS(ON) JUST(LEFT) # TYPE(OUTPUT) INTENS(HIGH) JUST(LEFT) $ TYPE(TEXT) INTENS(LOW) % TYPE(TEXT) INTENS(HIGH) SKIP(ON)

Each line defines one attribute character with its properties.

BODY Field Marking

Fields are marked in )BODY:

text
1
2
3
4
5
6
7
8
9
10
)BODY %------------------- Sample Panel ------------------- % %Enter dataset: @ZDSN %Current user: #ZUSER % %Press Enter to continue )INIT .ZVARS = 'ZDSN ZUSER' )END

Attribute characters mark field positions, followed by variable names.

Variable Initialization

Variables are initialized in )INIT:

text
1
2
3
4
5
6
)INIT .ZVARS = 'ZDSN ZUSER MYVAR' &ZDSN = 'USERID.SOURCE.COBOL' &MYVAR = 'DEFAULT' .CURSOR = ZDSN .HELP = PANEL01

ZVARS lists variables, variables can be set, and panel options configured.

Processing Logic

Logic is written in )PROC:

text
1
2
3
4
5
6
7
8
)PROC IF (&ZDSN = '') + .MSG = 'Dataset name required' IF (&ZCMD = '1') + .ZSEL = 'PANEL(OPTION1)' IF (&ZCMD = 'X') + .ZSEL = 'EXIT' )END

PROC contains conditional logic, variable assignments, and flow control.

Field and Variable Relationships

Fields and variables work together in panels.

Field-Variable Association

Fields are associated with variables:

  • Attribute character marks field position
  • Variable name follows attribute character
  • Variable stores field value
  • Variable can be accessed in logic

Input Field Association

Input fields store values in variables:

  • User types in input field
  • Value stored in associated variable
  • Variable accessible in )PROC
  • Can be validated and processed

Output Field Association

Output fields display variable values:

  • Variable value displayed in field
  • Field shows current variable value
  • Value can be updated programmatically
  • User cannot edit output fields

Advanced Attribute Features

Advanced attribute features provide additional control.

SKIP Property

The SKIP property:

  • SKIP(ON): Field skipped during tab navigation
  • SKIP(OFF): Field included in tab sequence
  • Controls field accessibility
  • Useful for display-only fields

Color Properties

Color properties:

  • Specify field colors
  • Provide visual distinction
  • Enhance user interface
  • Dependent on terminal support

Protected Fields

Protected fields:

  • Cannot be modified by user
  • Useful for display-only information
  • Defined with TYPE(OUTPUT)
  • Or with protection attributes

Best Practices

Following best practices improves panel quality:

  • Use Meaningful Variable Names: Use descriptive variable names
  • Define Attributes Clearly: Clearly define all attributes
  • Initialize Variables: Initialize variables in )INIT
  • Validate Input: Validate input in )PROC
  • Use Appropriate Field Types: Choose correct field types
  • Set Cursor Position: Use .CURSOR to set focus
  • Provide Help: Include help panels
  • Test Thoroughly: Test all field interactions

Explain Like I'm 5: Panel Language Structure

Think of panel language like building a form with special instructions:

  • Fields are like the boxes on a form where you write answers. Some boxes you can write in (input fields), some boxes just show information (output fields), and some are just labels (text fields). It's like having different types of boxes on your form - some for writing, some for showing!
  • Variables are like the memory that remembers what you wrote in the boxes. When you write something in a box (field), the computer remembers it in a variable. Later, the computer can use that memory to do things or show it in other boxes. It's like having a notebook that remembers everything you wrote!
  • Attributes are like the instructions for how each box should look and work. You decide if a box is bright or dim, if you can write in it or just look at it, and how the text should be arranged. It's like having a style guide that tells you exactly how each box should appear!
  • Panel Language is like the special language you use to tell the computer how to build your form. You write instructions like "make this box bright and let people write in it" or "show this information but don't let people change it." It's like writing a recipe that tells the computer exactly how to make your form!

So panel language is like a special instruction manual that tells the computer how to build a form with boxes (fields) that remember things (variables) and look a certain way (attributes)!

Practice Exercises

Complete these exercises to reinforce your panel language skills:

Exercise 1: Define Attributes

Practice attributes: define various attributes in )ATTR section, understand attribute properties, test different attribute combinations, and learn attribute definition. Master attribute definition.

Exercise 2: Create Fields

Practice fields: create input and output fields in )BODY, associate fields with variables, understand field-variable relationship, and learn field creation. Master field creation.

Exercise 3: Use Variables

Practice variables: use Z variables and user variables, initialize variables in )INIT, access variables in )PROC, and learn variable usage. Master variable handling.

Exercise 4: Field Types

Practice types: create different field types (INPUT, OUTPUT, TEXT), understand type differences, test field behavior, and learn field types. Master field types.

Exercise 5: Complete Panel

Practice complete: create complete panel with all sections, use fields, variables, and attributes together, test full functionality, and learn complete panel structure. Master panel language.

Test Your Knowledge

1. What are Z variables?

  • User-defined variables
  • System-defined ISPF variables
  • Panel attributes
  • Field types

2. How are fields marked in )BODY?

  • Using variable names
  • Using attribute characters
  • Using field names
  • Using coordinates

3. What does TYPE(INPUT) mean?

  • Display-only field
  • User input field
  • Text field
  • System field

4. What does INTENS(HIGH) mean?

  • Low intensity
  • High intensity (bright)
  • Medium intensity
  • No intensity

5. How are variables referenced in panel logic?

  • With $ prefix
  • With & prefix
  • With # prefix
  • With no prefix

Related Concepts