HANDLE Aid-key
[Aid-Key]…;
Statements
Aid-Key = {CLEAR | PF1 … PF12 | PA1 | PA2 | PA3 | ENTER | OTHER
}
The HANDLE
statement may only be written within a program with INSCREEN(screen)
where “screen” is a 3270-type display.
It may not be written within any other logic (IF, CASE, ROUTINE, etc) – Jazz expects you to
write HANDLE
statements at the start of your logic.
If you have
written one or more HANDLE statements then you must finish with HANDLE ENTER. This
must be the last HANDLE statement, and will be where almost all of your program
logic will be written.
A HANDLE
statement may name several aid keys, e.g.
HANDLE PF2 PF3;
PERFORM Routine1;
is
equivalent to
HANDLE PF2;
PERFORM Routine1;
HANDLE PF3;
PERFORM Routine1;
If you
combine several AID keys with ENTER, write ENTER first, e.g.
HANDLE ENTER PF7 PF8;
is valid,
but
HANDLE PF7 PF8 ENTER
is not.
Each aid
key may be named only once, e.g.
HANDLE PF3;
Action 1;
HANDLE PF3, PF4;
Action 2;
is
invalid. It does NOT mean that both
Action 1 and Action 2 are performed when PF3 is clicked.
When two or
more AID keys can cause the same action you can use normal conditional logic
like
IF EIBAID = DFHPF7 THEN;
…
to
distinguish detail which depends on the particular key clicked.
Following a
HANDLE
the statements following are executed only if the aid key is clicked. The end of the “HANDLE action” is delimited
by another HANDLE
statement, or a ROUTINE
statement;
You can
consider that, in the absence of explicit HANDLE statement your program starts
with
HANDLE CLEAR
Clear the screen, ready
for another transaction code to be entered.
HANDLE PF3
The program will be
terminated and control will return to the CICS program that initiated this one.
HANDLE PF12
The transaction is
cancelled and
·
If
the PROGRAM statement has an EXIT option control is transferred to
that program
·
If
there is no EXIT option then “Enter Transaction code” is displayed on the screen. The use can type another four-character CICS
transaction code to start the corresponding program.
HANDLE ENTER
[PF7 PF8]
The program’s main logic is performed. PF7 and PF8 are added if the program detects a multi-record situation, otherwise PF7 and
PF8 are treated as OTHER
HANDLE OTHER
Error message “Invalid Function
Key”
If you
write your own HANDLE
condition for one of these AID keys this default handling will be replaced by
your logic.