Preprocessing Rules This concept involves application of processing rules in layouts that, by design, affect the initial screen displayed to the user.
First, we define our data in the program that utilizes this rather esoteric approach as:
|
0010 DEFINE DATA LOCAL 0020 1 EMPLOYEES VIEW OF EMPLOYEES 0030 2 PERSONNEL-ID 0040 2 NAME 0050 2 FIRST-NAME 0060 2 M-NAME 0070 2 CITY 0080 2 ZIP 0090 2 COUNTRY 0100 2 DEPT 0110 2 JOB-TITLE 0120 1 #GENERAL(A25) 0130 1 #PID(A8) 0140 1 #NAME(A20) 0150 1 #FOUND-CV(C) 0160 END-DEFINE
|
|
Ob _ Ob D CLS ATT DEL CLS ATT DEL . . T D Blnk T I ? . . A D _ A I ) . . A N ¨ M D & . . M I : O D + . . O I ( . . 001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+---- +XXXXXXXX Testing a Preprocessing Rule +XXXXXXXX Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12--- Help Mset Exit Test Edit -- - + Full < > Let
|
|
12:34:56 Field and Variable Definitions - Summary 02-04-01 Cmd Field Name (Truncated) Mod Format Ar Ru Lin Col ___ *DATX_____________________________________________ S D 1 2 ___ *TIMX_____________________________________________ S T 1 71 +--------------------------- PARAMETER DEFINITIONS ---------------------------+ | Cmd Name of Parameter (Truncated) Format Ar | | __ #FOUND-CV___________________________________________________ C____ | | __ #GENERAL____________________________________________________ A25__ | | __ #NAME_______________________________________________________ A20__ | | __ #PID________________________________________________________ A8___ | | __ ____________________________________________________________ _____ | | __ ____________________________________________________________ _____ | | __ ____________________________________________________________ _____ | | __ ____________________________________________________________ _____ | | __ ____________________________________________________________ _____ | | | +-----------------------------------------------------------------------------+ Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12--- Help Mset Exit -- Parm Local Let
|
|
Rule ________________________________ *PF-KEY RULE > > + Rank 0 S 23 L 1 Struct Mode TOP ....+....10...+....+....+....30...+....+....+....50...+....+....+....70.. 0010 DEFINE DATA LOCAL 0020 1 EMPLOYEES VIEW OF EMPLOYEES 0030 2 PERSONNEL-ID 0040 2 NAME 0050 2 FIRST-NAME 0060 2 M-NAME 0070 2 CITY 0080 2 ZIP 0090 2 COUNTRY 0100 2 DEPT 0110 2 JOB-TITLE 0120 END-DEFINE 0130 RESET #FOUND-CV 0140 IF #NAME = ' ' /* And it always is. 0150 FIND EMPLOYEES WITH PERSONNEL-ID = #PID /* Use the ID to find the 0160 IF NO RECORDS FOUND /* record. If its not there 0170 MOVE 'No Record Found' TO #NAME /* set the variable and get 0180 ESCAPE BOTTOM IMMEDIATE /* out. If a record is found 0190 END-NOREC /* then compress the name 0200 COMPRESS FIRST-NAME M-NAME NAME INTO #NAME /* values into the variable 0210 MOVE (AD=P) TO #FOUND-CV /* and set the control variable. 0220 END-FIND /* ESCAPE IMMEDIATE bypasses 0230 END-IF /* normal IF NO processing. Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12--- Help Mset Exit Test -- - + Split Sc= Let
|
|
12:34:56 Define Map Settings for MAP 02-04-01 Delimiters Format Context ----------------- --------------------------- -------------------------- Cls Att CD Del Page Size ...... 23 Device Check .... ________ T D BLANK Line Size ...... 79 WRITE Statement _ T I ? Column Shift ... 0 (0/1) INPUT Statement X A D _ Layout ......... DDHMAP98 Help ____________________ A I ) dynamic ....... Y (Y/N) as field default N (Y/N) A N ¨ Zero Print ..... N (Y/N) M D & Case Default ... UC (UC/LC) M I : Manual Skip .... N (Y/N) Automatic Rule Rank 1 O D + Decimal Char ... . Profile Name .... SYSPROF O I ( Standard Keys .. N (Y/N) Justification .. L (L/R) Filler Characters Print Mode ..... __ ------------------------ Optional, Partial .... Control Var .... ________ Required, Partial .... Optional, Complete ... Required, Complete ... Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12--- Help Exit Let
|
|
Fld #PID Fmt A8 ------------------------------------------------------------------------------- AD= MYT_______ ZP= SG= HE= _____________________ Rls 0 AL= _____ CD= __ CV= #FOUND-CV_______________________ Mod User PM= __ DY= ______________________________ EM= _______________________________________________________________ 001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+---- +XXXXXXXX Testing a Preprocessing Rule +XXXXXXXX Main Program General Field ..+XXXXXXXXXXXXXXXXXXXXXXXXX Personnel ID ....EXXXXXXX Name ...........&XXXXXXXXXXXXXXXXXXXX City ...........:XXXXXXXXXXXXXXXXXXXX Postal Code ....:XXXXXXXXXX Country ........:XXX Department .....:XXXXXX Job Title ......:XXXXXXXXXXXXXXXXXXXXXXXXX Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12--- HELP Mset Exit <--- ---> -- - + < > Let
|
|
0010 DEFINE DATA LOCAL 0020 1 EMPLOYEES VIEW OF EMPLOYEES 0030 2 PERSONNEL-ID 0040 2 NAME 0050 2 FIRST-NAME 0060 2 M-NAME 0070 2 CITY 0080 2 ZIP 0090 2 COUNTRY 0100 2 DEPT 0110 2 JOB-TITLE 0120 1 #GENERAL(A25) 0130 1 #PID(A8) 0140 1 #NAME(A20) 0150 1 #FOUND-CV(C) 0160 END-DEFINE 0170 INPUT #PID 0180 INPUT USING MAP 'DDHMAP99'
|
|
#PID 20000700
|
|
02-04-01 Testing a Preprocessing Rule 12:34:56 Main Program General Field .. Personnel ID ... 20000700 Name ........... JENNIFER G. HALL City ........... _ Postal Code .... Country ........ Department ..... Job Title ......
|
|
#PID 20000701
|
|
02-04-01 Testing a Preprocessing Rule 12:34:56 Main Program General Field .. Personnel ID ... 20000701 Name ........... No Record Found City ........... Postal Code .... Country ........ Department ..... Job Title ......
|