Mainframes 360
The one stop destination for System Z professionals

Sunday, November 28, 2010

ISPF Panel Primer

Q. What is an ISPF Panel?
As a Mainframe Programmer, you constantly work with and use Software Tools such as File-Aid, Expeditor, Abend-Aid etc. which save time and key-strokes. At its heart, these software tools have a power-packed engine(the Main COBOL Program or even a REXX EXEC) that does all the processing. But, its not just the Main COBOL program that makes them special. These software-tools also have pretty good-looking GUI Screens, on which the user types the Input and sees the outputs. Thus, the GUI-Screens allow the the User to work with and use the Software-Tools interactively. GUI-Screens of an Application are called ISPF Panels.

ISPF Panels look like Internet Web-pages. They have a Menu or Action-Bar in the top-portion. When you click on or select an action-bar item, a pull-down containing the choices appears. ISPF Panels have a Panel-Title. The Body of the Panel has the main contents of the Panel – Input and Output Fields. The Message-Area displays any messages, when you enter the wrong Inputs. The Command Area allows you to enter Commands like START 3.2.

image
Q. What is Dialog Tag Language(DTL)?
Dialog Tag Language(DTL) is used to write the source code for ISPF Panels, and windows that are displayed on Mainframes. What HTML is to Internet Web-Pages, DTL is to ISPF Pages. Behind the scenes, you must write Source-code in DTL, to develop an ISPF-Panel like the one you saw above. In fact, DTL and HTML are identical-twins, DTL also has tags like <panel> <p> etc. just like HTML. Tags provide markup(descriptive information), about how text in a file is to be interpreted, or presented. 
Q. How do you code a Panel in DTL?
You use the <panel> tag to create a new ISPF Panel. You must enclose the contents of the panel inside <panel> start and </panel> end tags.

image 

The name attribute assigns a name to the ISPF Panel. I have named my ISPF Panel TSTPAN01. You may also code name=*, to set the panel name same as the member-name. I also wanna a panel-title "Catalog Ordering System", look how I’ve added it below -

image

Every panel has a width and depth, that define how large the panel would look. If you specify window=no, then the panel has a default size of 24 rows x 80 columns.

image  
Q. How do you position the Cursor on the Panel?
The panel tag has attributes cursor, csrindex and csrpos. The cursor attribute is the easiest and simplest to go with. You can set the cursor attribute the the name of a <choice> or <selfld> tag. You may also set the cursor attribute to the DATAVAR value of a <chofld>, <dtafld> or a <lstcol> tag. You may also position the cursor at the command-area, by specifying cmdarea as the cursor-value. The code given below, is for a simple-panel with a choice field. Look how the cursor is positioned at the dest field.

image 

When you actually DISPLAY the Panel TSTPAN01, this is what it looks like. DTL is a WYSWIG Language(What you see, is what you Get).

image
Q. How do you compile the DTL Source Code and see the Output?
The Mainframe does not understand the Source-code that you have written in DTL. So, you must first translate the DTL Source-Code into an ISPF Compatible form. The Compiler or Translator Software is called ISPDTLC. You can invoke ISPDTLC Compiler Software by typing ISPDTLC in the Command-Area.

image 

I have written the DTL Source-Code in a Member TSTPAN01 which resides under the library(PDS) SYSADM.DTL.SRCLIB. I would like the compiled output-panel to be stored in USER.ISPPLIB. Look at how I have filled in the details on the above screen. After filling in these details, hit ENTER Key to run the Compiler-Software.

Once, the compilation is done, you can go ahead and test your panel, to see for yourself, how it looks. Go to ISPF Primary Menu Option 7.2. Here, you must enter your panel’s name.

image
Q. How do you create Action-Bars and Pull-Downs?
The Action-Bar is like the Menu-Bar on the Microsoft Office Word-Processor. Once you click or select a Menu, a pull-down with several options appears. It is one of the most important elements of a User-Interface.

Although DTL allows you to create an Action-bar Menu, it is the responsibility of the Programmer, to map these Menu-Items to the correct functions. This is not a part of the presentation-layer.

To create a new Action-bar you would code the <ab> and </ab> tags. In the Action-Bar, to create an Action-Bar Choice you write <abc> and </abc> tags. Under each action-Bar, you write an associate Pull-Down Choice <pdc> and </pdc>. The action to be performed when the user select a pdc, is defined using the <action run=...> tag. The value that you assign to the run attribute of the action-tag tell, which command to run(what function to perform). In addition to this, a pull-down choice may also be marked un-available, by using the unavail attribute. Check out the Panel below.

image

I have coded four action-bar choices <abc> on the above panel, File, Edit, Options and Help. Under the File Action-bar Choice, I have coded the following Pull-Down Choices – Add Entry, Delete Entry, Update Entry and Exit.

image

Under the Edit Action Bar choice, I have coded the Reset Pull-down Choice, under Options it is Undo and under Help, its Hi Lite.

image

When you compile the above DTL Source-Code and test-run the generate Panel using the ISPF Primary Menu Option 7.2, the panel is DISPLAY'ed as shown below.

image
Q. How do I define the Panel Body? 
Think of the Application-Form that you filled up for taking up an examination. The ISPF Panel-Body is like any exam-form. It may contains instructions at the top and bottom, areas that contain data fields, regions and dividers(separator-lines).

The below DTL Source-Code shows, how one may write <topinst> Top Instructions and <botinst> Bottom-Instructions.

image 

When you compile and Test-Run the above DTL Source-Code, this is how the ISPF Panel looks like -

image
Q. How do you code the <area> tag in the Panel Body?
The <area> tag represents the main body of the panel. In reality, you should code all the interactive fields inside an area tag. Thus, the correct way to write the <selfld> Selection-Field of the "Item Selection" Panel would be, nesting it inside the <area> tag.

image

You can set the marginw attribute of the <area> tag, to specify a Margin-width for the area. For example, I have coded marginw=10 in the below example.

image

Look at how it affects the panel. The entire area has a margin of 10 columns.

image
Q. What are Scrollable Areas?
Any area can be made scrollable, by specifying the depth, extend and div attributes. depth attribute makes the panel scrollable. You can specify EXTEND=ON on a scrollable panel, to allow it to expand beyond the logical window size. You may use the div attribute to have a divider(separator) line either before or after the scrollable area. div=blank adds a blank divider, whereas adds a visible divider.

The next panel that I have coded broadly contains two areas – a simple area and a scrollable-area with depth 6.

image 

In the first area, I have coded the Case No, Name and Address Data-Fields. I have also coded a Selection-Field for the Case – Is it civil case, or real-estate or Environmental.

image

In the Scrollable-Area, I have coded a Multiple Selection-Field for the Type of offense, with several choices.

image 

See below, how this panel actually looks like, when it is displayed.

image

When you scroll down by pressing PF08 Attention Key, the remaining part of the scrollable panel is displayed.

image 

To many people who are thrown to work at a mainframe computer on their first job, they feel lost. Mainframe people seem to speak a completely different language and that doesn't make life easy. What's more, the books and manuals are incredibly hard to comprehend.

"What on earth is a Mainframe?" is an absolute beginner's guide to mainframe computers. We'll introduce you to the hardware and peripherals. We'll talk about the operating system, the software installed on a mainframe. We'll also talk about the different people who work on a mainframe. In a nutshell, we'll de-mystify the mainframe.

Readers based in India, can buy the e-book for Rs. 50 only or the print book. International readers based in the US and other countries can click here to purchase the e-book.