A user exit program called UEX@0001 is provided to allow an alternative means of editing RDML commands.
If the option to use this alternative editor is enabled in the system definition data area DC@A01, and the user indicates that it should be used by specifying USR, USER or USREDT in the editor field while reviewing RDML commands, all edit requests will be directed to user exit program UEX@0001, instead of the standard LANSA editor, or the IBM supplied EDTSRC/SEU editor.
Set up this option Refer to Enable alternate editor user exits in Compile and Edit Settings.
When UEX@0001 is called, it is passed the following parameters by the LANSA calling program DC@P3098:
There is always one process/function/member specified in the arrays passed to UEX@0001. There may be at most 11. The first one passed is the process/function/member that is being edited. The other 10, if present, are additional processes/functions/members that the user has indicated he/she may wish to browse/copy while editing the first member.
An example of how program UEX@0001 could be used follows. This CL (control language) program is used in conjunction with IBM's PC support to allow a function's RDML commands to be edited on a PC using any normal PC based source editor.
CL Program UEX@0001 - Edit RDML Commands on PC Under PC Support
UEX@0001: PGM (&DC@IDS &DC@EDS &ERROR &UPDATED &FILE &LIB
&NM &PROLIST &FUNLIST &MBRLIST)
/* Declare all parameters and work variables (not described) */
/* Create a shared folder for this IBM i job */
CHGVAR &FOLDER (&JOB *TCAT '.RML')
CRTFLR FLR(&FOLDER) TEXT('Temporary RDML work folder only')
MONMSG (CPF0000 MCH0000)
/* Copy all members from LANSA work file into files in folder */
CHGVAR &I 1
CHGVAR &J 1
CHGVAR &K 1
LAB010: IF (&I *GT &NM) GOTO(LAB020)
CHGVAR &FMEMBER %SST(&MBRLIST &J 10)
CHGVAR &TMEMBER %SST(&FUNLIST &K 7)
CPYTOPCD FROMFILE(&LIB/&FILE) TOFLR(&FOLDER)
FROMMBR(&FMEMBER) TODOC(&TMEMBER) REPLACE(*YES)
CHGVAR &I (&I + 1)
CHGVAR &J (&J + 10)
CHGVAR &K (&K + 7)
/* Set up PC command details and execute PC editor .BAT file */
LAB020: CHGVAR &FMEMBER %SST(&MBRLIST 1 10)
CHGVAR &TMEMBER %SST(&FUNLIST 1 7)
CHGVAR &PCCMD ('MYEDIT' *BCAT &FOLDER *BCAT &TMEMBER) STRPCCMD PCCMD(&PCCMD) PAUSE(*NO)
/* At end of edit, copy back into LANSA work member number 1 */ /* and then set the updated and error flags before ending */
CPYFRMPCD FROMFLR(&FOLDER) TOFILE(&LIB/&FILE) FROMDOC(&TMEMBER) TOMBR(&FMEMBER)
CHGVAR &UPDATED 'Y'
CHGVAR &ERROR 'N'
PC/DOS MYEDIT.BAT Batch Command File Used on the PC
FSPC ASSIGN J: %1
Assign shared folder to drive J
Execute your favourite PC editor over the file containing the help text.
FSPC RELEASE J:
Release the folder from drive J