This is the first of a series of articles that will explain how to build, modify, display, and accept 3270-formatted screen images in COBOL/XE.
This article will demonstrate how to build a screen or "paint panel" and how to set attributes for a field or for a literal. It also includes a description of each option for the field attributes.
Building A Paint Panel Using the PAINT Transaction
COBOL/XE provides an online transaction called PAINT used to define and develop a "paint panel" (screen) for your COBOL/XE application.
Let's get started...
Sign on to your CICS region and enter PAINT from a clear screen.
The following screen will be displayed:
PAINT Screen Definition Facility R3.0.0
Command: ____________ Panel: ________ Library: USRIOX
Height: 24 Width: 080 Data-name prefix: ________
Author/Description: _________________________________________________________
Color? N Hi-Lite? N Validation? N Case? U Outline? N Output MDT? N
-------------PF Key Assignments------------- Special Char Assignments
PF1 (1) Define PF13 (b) Scroll Backward ? field mark
PF2 (2) Paint PF14 (f) Scroll Forward ' space substitute
PF3 (3) Detail PF15 (t) Ruler Screen ! command-id
PF4 (4) True image PF16 - Unassigned @ no-op
PF5 (5) Demo Screen PF17 - Unassigned field separator
PF6 (6) Demo Mode PF18 - Unassigned detail expansion
PF7 (s) Store Field PF19 - Unassigned
PF8 (r) Restore Field PF20 - Unassigned
PF9 (i) Insert Field PF21 - Unassigned
PF10 (c) Copy Field PF22 - Unassigned
PF11 (d) Delete Field PF23 - Unassigned <CLEAR> Exit PAINT
PF12 (m) Move Field PF24 - Unassigned <PAn> Sync Point
To create a new panel (screen), enter GET into the "Command:" field, and enter a name for the paint panel in the "Panel:" field. In this example, the panel name entered is SCREEN.
Below is the result from the GET command:
PAINT Screen Definition Facility R3.0.0
Command: ____________ Panel: SCREEN Library: USRIOX
Last accessed on / / at : Version .00
Height: 24 Width: 080 Data-name prefix:
Author/Description:
Color? N Hi-Lite? N Validation? N Case? U Outline? N Output MDT? N
-------------PF Key Assignments------------- Special Char Assignments
PF1 (1) Define PF13 (b) Scroll Backward ? field mark
PF2 (2) Paint PF14 (f) Scroll Forward ' space substitute
PF3 (3) Detail PF15 (t) Ruler Screen ! command-id
PF4 (4) True image PF16 - Unassigned @ no-op
PF5 (5) Demo Screen PF17 - Unassigned field separator
PF6 (6) Demo Mode PF18 - Unassigned detail expansion
PF7 (s) Store Field PF19 - Unassigned
PF8 (r) Restore Field PF20 - Unassigned
PF9 (i) Insert Field PF21 - Unassigned
PF10 (c) Copy Field PF22 - Unassigned
PF11 (d) Delete Field PF23 - Unassigned <CLEAR> Exit PAINT
PF12 (m) Move Field PF24 - Unassigned <PAn> Sync Point
Ready to Paint
To initiate the panel painting process, press the PF2 key. PF2 will bring you to the Paint screen that will initially be blank except for "-Ready to paint-" on the first line.
For this example, we are going to define an 8-byte field starting in position 2 (the first usable position) on the first line of the screen. Overtype the "-Ready to paint-" with:
''''''''
A quote on the paint screen is called a space substitute. The PAINT facility treats the single quote as a field until it encounters a blank. Press PF3 to redisplay the Define screen.
Below are the results after pressing PF3:
PAINT Screen Definition Facility R3.0.0
1 2 3 4 5 6 7 8
2345678901234567890123456789012345678901234567890123456789012345678901234567890
''''''''
Panel: SCREEN Library: USRIOX Command: _ Next Row: 01
Current Row: 01
P P I D Occurs
Column -------Field-Name----- I R N E Ver Hor
bgn end C T T T Ln No Ln No
002 009 ______________________ N A L N __ __ __ __
The Define screen above displays the image of what was entered, the row number, and the beginning and ending column of the field or of the literal. In this case, the field will start in position 2 and end in position 9. You can also enter a Field-Name that can be used in an COBOL/XE program. To the right of the Field-Name are the field's attributes. In the above example, the Picture, Protect, Intensity, and Detectable attributes are displayed; these are the defaults.
To assign additional attributes to all of the fields on the panel, go back to the Define screen by pressing the PF1 key and modify the field attribute flags that are located below the "Author/Description" line.
PAINT Screen Definition Facility R3.0.0
Command: ____________ Panel: SCREEN Library: USRIOX
Last accessed on / / at : Version .00
Height: 24 Width: 080 Data-name prefix:
Author/Description:
Color? Y Hi-Lite? Y Validation? Y Case? L Outline? Y Output MDT? Y
-------------PF Key Assignments------------- Special Char Assignments
PF1 (1) Define PF13 (b) Scroll Backward ? field mark
PF2 (2) Paint PF14 (f) Scroll Forward ' space substitute
PF3 (3) Detail PF15 (t) Ruler Screen ! command-id
PF4 (4) True image PF16 - Unassigned @ no-op
PF5 (5) Demo Screen PF17 - Unassigned field separator
PF6 (6) Demo Mode PF18 - Unassigned detail expansion
PF7 (s) Store Field PF19 - Unassigned
PF8 (r) Restore Field PF20 - Unassigned
PF9 (i) Insert Field PF21 - Unassigned
PF10 (c) Copy Field PF22 - Unassigned
PF11 (d) Delete Field PF23 - Unassigned <CLEAR> Exit PAINT
PF12 (m) Move Field PF24 - Unassigned <PAn> Sync Point
Press PF3 to go back to your Detail screen. Notice that 7 more field attributes have been added. When multiple fields exist, all of the fields will be assigned these attributes.
Below is the Detail screen:
PAINT Screen Definition Facility R3.0.0
1 2 3 4 5 6 7 8
2345678901234567890123456789012345678901234567890123456789012345678901234567890
''''''''
Panel: SCREEN Library: USRIOX Command: _ Next Row: 01
Current Row: 01
P P I D M C H M F T O Occurs
Column -------Field-Name----- I R N E D O L N I R U Ver Hor
bgn end C T T T T L I D L G T Ln No Ln No
002 009 ______________________ N A L N N N N N N N ____ __ __ __ __
If you wish to modify any of the field attributes for an individual field, overtype the attribute(s) for the field(s) on this Detail screen, and then press enter.
What are the Field Attributes?
PIC (Picture)
N - The fields will be defined as a PIC X(N)
Y - Will use the picture that you specified on the paint panel
PRT (PROTECT)
A (AUTOSKIP) - Data cannot be entered into this field and the
cursor will skip over it
B (BARRIER) - Data cannot be entered into this field and the
cursor will not proceed to the next field
D (DATA-ENTRY) - Any data can be entered into this field
N (NUMERIC-ENTRY) - Only numeric data can be entered into this field
INT (INTENSITY)
L - Displays the field in low intensity
H - Displays the field in high intensity
N - The field is not displayed
DET (DETECTABLE)
N - Makes the field undetectable by a light pen
Y - Makes the field detectable by a light pen
MDT
N - The MDT (modified data tag) bit will not be set on for this field
in the output data stream
Y - The MDT will be set on in the data stream
COL (COLOR)
N - No color
B - Blue
R - Red
P - Pink
G - Green
T - Turquoise
Y - Yellow
W - White
HLI (HIGHLIGHT)
N - field will not be highlighted
B - field will be blinking
R - field will be displayed as reverse video
U - field will be displayed with underscores
MND (MANDATORY)
N - It is not mandatory to enter data into the field
M - Operator must enter data into the field before pressing any
program function keys; otherwise, the keyboard will lock
FIL (FILL)
N - It is not required to fill in the field
Y - Operator must fill in the field before moving the cursor out of
the field; otherwise the keyboard will lock
TRG (TRIGGER)
N - Field is not a trigger field
T - Field is a trigger field and the computer will be notified when
the operator attempts to move the cursor out of this field
OUT (OUTLINING)
N - Field will not be outlined
L - Field will have a left vertical line
R - Field will have a right vertical line
T - Field will have an overline
B - Field will have an underline
Read More About It
To learn more about painting a panel and assigning field attributes using the PAINT transaction, refer to the COBOL/XE PAINT Reference Manual and the COBOL/XE Language Reference Manual.
Contribute Your Ideas
If you have a technique that you would like to share with the COBOL/XE community as a published article, please contact COBOL/XE Technical Support.