Define those function keys

I use this tool in any program utilizing screens and function keys. The keys can actually make sense when reading the program and open up indiciators if needed by the program.

When the display file is created and the function keys are defined, don't set an indicator on.

Create a source file as indicated by keydefined. This will describe all of the function keys and their hexidecimal format. The information data structure is used to return the hex values back to the calling program.

In the calling program, be sure to identify the infds(dspds) on the workstation file and place the copy statement in the data definition section of the program.

***** Non compliled source file *****
named: keydefined
library: mylibrary

* Get function key from data structure
d dspds ds
d fkey 369 369a
* Binary key definitions
d Enter s 1a inz(X'F1')
d PageUp s 1a inz(X'F4')
d PageDown s 1a inz(X'F5')
d Help s 1a inz(X'F3')
d Print s 1a inz(X'F6')
d Clear s 1a inz(X'FD')
d F1 s 1a inz(X'31')
d F2 s 1a inz(X'32')
d F3 s 1a inz(X'33')
d F4 s 1a inz(X'34')
d F5 s 1a inz(X'35')
d F6 s 1a inz(X'36')
d F7 s 1a inz(X'37')
d F8 s 1a inz(X'38')
d F9 s 1a inz(X'39')
d F10 s 1a inz(X'3A')
d F11 s 1a inz(X'3B')
d F12 s 1a inz(X'3C')
d F13 s 1a inz(X'B1')
d F14 s 1a inz(X'B2')
d F15 s 1a inz(X'B3')
d F16 s 1a inz(X'B4')
d F17 s 1a inz(X'B5')
d F18 s 1a inz(X'B6')
d F19 s 1a inz(X'B7')
d F20 s 1a inz(X'B8')
d F21 s 1a inz(X'B9')
d F22 s 1a inz(X'BA')
d F23 s 1a inz(X'BB')
d F24 s 1a inz(X'BC')

******* How used in program *********
* display file
fdsplyfile cf e workstn infds(dspds)
/copy mylibrary/src,keydefined
c if fkey=F3
c return
c endif

This was first published in April 2001

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.