Pathmaker Programming Guide
Modifying Requesters
Advanced Pathmaker Programming Topics
9–22 067868 Tandem Computers Incorporated
Creating User Conversion
Routines
A user conversion procedure is a Tandem Application Language (TAL) procedure for
processing data passed between a requester (SCREEN COBOL program) and a
terminal screen.
A user conversion procedure lets you make your own validation checks or conversions
of data. For example, you can write a user conversion procedure to strip fill characters
from the right portion of an alphanumeric string before the string is passed to the
service. TAL user conversion procedures are processed after the standard tests for
MUST-BE or NUMERIC constraints and before the SCREEN COBOL statement
ACCEPT completes.
Tandem supplies stubs for nine user conversion procedures: four to convert terminal
screen data, four to convert intelligent device data, and one to support IBM 3270
function keys. These user conversion procedure stubs reside in the TCP object library
and are invoked when the program unit has a USER CONVERSION clause as part of
either a field definition or a SEND MESSAGE statement. The Pathmaker product adds
a USER CONVERSION clause for a screen field to the Screen Section of the requester
during requester generation if, during requester definition, you indicate that you want
to create a user conversion procedure by entering a value in the User Conversion field
of the Display Detail screen for that screen field.
You write conversion procedures in TAL and use the BINDER program to store your
procedures in the TCP user-library object file, replacing the corresponding procedure
stub. Any or all of the user conversion procedure stubs can be replaced. Your TAL
program should contain the procedure declaration for the procedure you want to
replace plus logic to perform the conversion.
Each procedure declaration can have logic to perform more than one type of
conversion for that data type. For example, for alphanumeric input, you could have
code to strip fill characters from both the right and left portions of the string and code
to strip fill characters only from the right portion of the string. Use the variable
USERCODE to select the code that you want performed for the data. The TCP
automatically selects the appropriate procedure depending on whether the data is
input or output, numeric or alphanumeric, and so on.