01 - Programming (EN)01e - Programming miscellanea (EN)

ONLINE HELP IN 5250 APPLICATIONS

Last Updated on 24 September 2019 by Roberto De Pedrini

Let’s be honest: for many years we have been talking about modernization of IBM i applications, but despite the efforts made by IBM and ISVs, most interactive applications running on IBM i still use the old ‘display file’ defined with DDS. The 5250 protocol has many advantages (it’s fast, robust, and reliable) but also the disadvantages of the physical limit of the area in which to display information. Increasingly 1920 characters (the 24 x 80 is still widely used) are not enough to display all the information, so the programmer is forced to shorten the constants to leave more space for the data; the consequence of this action is that the displayed panel becomes a rebus that only an experienced user of that application is able to solve (the abbreviations are often very clear to those who write them, much less to those who read them). In a perfect world the solution would be to change the user interface to a more modern one, but life is made of compromises and so we keep our old interface in character, ignoring the revulsion of younger users.

A good compromise is to define online help using the keywords provided by DDS, so that the user can press the F1 key and read the help. Help text is written to a source member of type PNLGRP from which, with the CRTPNLGRP command, you get a PNLGRP object. All of this is described in the “Application Display Programming” part 4 “Programming Help Displays” manual. In this article we will see how to define a simple ‘display file’ with its online help.

Suppose you have a panel consisting of:

  • a line with the title;
  • a row with two input fields;
  • a line with the description of the options;
  • a row with the column header;
  • a sub file with an option field and three columns of data;
  • a line describing the functional keys at the bottom of the sub file.

More or less like this:

                               Customer Maste
r By Code: 0000000 Cance
lled: 3rd Copy... 4th Cancel... 5th View...
Op Code Description A 0000001 De
scription 1 0000002 Description
2 0 0000003 Description 3
0 0000004 De
scription 4 0 0000005 Descriptio
n 5 0 0000006 Description 6 0
000000
7 Description 7 0000008 Descripti
on 8 0 00000009 Description 9 0
0000010 Description 10
0 0000011 Descri
ption 11 0 0000012 Description 12
0 0000013 Description 13 0
0000014
Description 14 0 0000015 Descrip
tion 15 0 0000016 Description 16
0 0000017 Description 17
0 0000018 Desc
ription 18 0 F1-Help F3-Exit F5-
Rinfescare F6-New...

First it would be very useful to read a general description of the application we are using: this I get by placing the cursor on the title (line 1) and pressing F1:

                               Customer Master From Code: 0000000 Cancelled: ...................................................................
.......................................................................................................................................................................................
2nd Edit... 3rd Copy... 4th An : ANAGRAPHIC CLIENT
S : Op Code Description : : 0000001 Descripti
on 1 : This application is managed : 0000002
Description 2 : the customer record. Is : 0000
003 Description 3 : You can filter master data and : 0
000004 Description 4 : Display them in a list. The : 0
000005 Description 5 : records are sorted by :
0000006 Description 6 : code. :
0000007 Description 7 : End : 0000008 Descripti
on 8 : F2 - Extended Help F10 - Data Start : 000
0009 Description 9 : F12-Ann. F24-Other keys : 0000
010 Description 10 : : : : 0000011 Description 11 :..........................
.............................................................................
.............................................................................
.............................................................................
..............................................................................
.............................................................................
.............................................................................
.... 13 0000014 Description 14 0 0000015 Description 15 0 0000016 Description
16 0 0000017 Description 17 0 0000018 Descripti
on 18 0 F1-Help F3-Exit F5-Rinfescare F6-New...

What is the “From Code” field for? I place the cursor and I push F1:

                               Customer Master From Code: 0000000 Cancelled: .................................................
...........................................................................................................................................................
..........................................................................................................................................................
Op Code : From Code : 0000001 :
: 0000002 : Enter a customer cod
e from which to load : 0000003 :
the list. :
0000004 : End : 0000005 : F2- Extended He
lp F3 - End F10 - Data Start F12 -Ann.
: 0000006 : F13-Information Support F1
4-Print Help : 0000007 : : :0000008 :
.....................................
.....................................
........ 0
0000010 Description 10 0 0000011 Des
cription 11 0 0000012 Description 12
0 0000013
Description 13 0 0000014 Description
14 0 0000015 Description 15 0 000001
6 Description 16
0 0000017 Description 17 0 0000
018 Description 18 0 F1-Help F3-Exit
F5-Rinfescare F6-New...

Then I step into the “Cancelled” field and pressed F1 (very useful explanation of what happens in the application for each value entered in the field):

                               Customer Maste
r By Code: 0000000 Cance
lled: 3rd Copy... 4 .............................................
Op Code Description : Canceled : 000000
1 Description 1 : : 0000002 Description
2 : Filtering cancelled codes: : 000000
3 Description 3 :
: 0000004 Descripti
on 4 : Description : 0000005 Description
5 : : 0000006 Description 6 : '
: 0000007 Description 7 : : 0000008 Des
cription 8 : '0' Only active codes.
: 0000009 Description 9 : : 0000
010 Description 10 : Follows... :
0000011 Description 11 : F2- Extended Help F10 - Data Start
: 0000012 Description 12 : F12-Ann. F24-Other keys : 0000013 Desc
ription 13 : : : : 0000014 Description 14 :.....................................................
...............................................................................................
................................................................................................
...............................................................................................
................................................................................................
.......................................................... 16 0 0000017 Description 17 0 000001
8 Description 18 0 F1-Help F3-Exit F5-Rinfescare F6-New...

Often the options are many and their description is shortened to not use more than one row, so I place the cursor on the option row, or anywhere in the “Op” column, and I press F1:

                               Customer Maste
r By Code: 0000000 Cance
lled: 3rd Copy... 4th Cancel... 5th View...
..............................................................................
: Options : : : : Description O
ption : :

: : 2 To e
dit a master data. :
: : 3 To insert a new master dat
a by copying it from an already :
: existing.
: : : : 4 To undo/resto
re a master data.
: : : : 5 To display a
master data. :
: : Note: To repeat an option on all lines write the o
ption : : and press F13: the option will be repeated fr
om that line onwards, until : :
Follows... :
: F2-Extended Help F3-End F10 - Data Start F12-Ann. :
: F13- Information support F14 - Print Help F20-Ingrand. :
: :
:............................................................................:

What does column “A” contain? Just place the cursor anywhere in the column and press F1:

                               Customer Maste
r By Code: 0000000 Cance
lled: 3rd Copy... 4th Cancel... 5th View...
Op Code Description A......................................................................................................
................................................................................. 0 : A (C
ancelled) : 0 : 0 : 0 :
This column highlights c
anceled codes: 0 :

: 0 :
Value : 0 : : 0 : '0' Ac
tive code. : 0
: 0 : 0 : Fo
llows... : 0 : F2: F2-Extend
ed Help F10 - Start Data F12-Ann. : 0 : : F13:Information su
pport F24 : Other keys : 0 : : :.........................................
.........................................................................
........................................................................
.........................................................................
.........................................................................
................................ Description 15 0000016 Description 16 0
0000017 Description 17 0 0000018 Description 18
0 F1-Help F3-Exit F5-Reinfescare F6-New...

And to finish I place the cursor on the line of function keys and press F1:

                               Customer Maste
r By Code: 0000000 Cance
lled: 3rd Copy... 4th Cancel... 5th View...
Op Code Description A 0000001 Description 1 0.............................................................................
............................................................................................................................
...........................................................................................................................
: Functional keys : : : : Descr
iption key : :

: : F1
To view online help.
: : : F3 To exit the applicat
ion and return to menu.
: : : : F5 To refres
h the list.
: : : : F6 To enter a n
ew master data.
: : Finish : : F2-Extended Help F3-End
F10 - Start Data F12 -Ann. :
: : : : : : : : : : : : : : : :................
................................................
....................................F1-Help F3-Ex
it F5-Rinfescare F 6th New...

Writing the online help of an application is useful not only to the user, but also to the programmer who developed the application: just today a user phoned me because he had forgotten the meaning of a field in an application that he has been using for many years and me I got away with telling him to press F1 and read the help.

This is the source CUSHELP type DSPF:

     

 

 

 

 

 
 
 
 
 
 
 

 
 
 
 
 

 
 
 
 
 

 
 
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

 
 
 

 
 
 
 
 
 

 
 
 
 
 
 

 

 
Related Posts
DB2 for i SQL – String Manipulation – POSSTR-LOCATE-LOCATE_IN_STRING (EN)

Introduction Often, in our applications, we need to work with text strings, and DB2 SQL can come in very useful Read more

DB2 for i – FAQ & Howtos (EN)

DB2 Database and SQL ... maybe the most important things on IBM i platform: here's a collection of FAQs, tips Read more

IBM i 7.4 Announcement (En)

Comes directly with the Easter egg this IBM announcement for the news of the IBM i 7.4 version, iNext version Read more

Generated Always Columns (EN)

Introduction "Generated Always Column": are columns, table fields, filled by DB2 engine: something like columns with a default value but Read more

About author

IBM i software developer

Leave a Reply

Your email address will not be published. Required fields are marked *