Model Building Made Easy

Download Report

Transcript Model Building Made Easy

Model Building Made Easy
Presented by
Sandi McDonald
ExcelSys, Inc.
ExcelSys, Inc.
Why?
 SAG
Models are inappropriate
Re-engineering
Mainframe GUI
Web Browser
 SAG Models are insufficient
Separate Data Validation
Web Configuration
ExcelSys, Inc.
How?
 How
CONSTRUCT Generates
 How the Model is defined
 How the Model is built
 How the Code Frames are built
 How the Model Components are
created
ExcelSys, Inc.
Sample Model - Validation
Batch
Maint
Validation
Object Subp
ExcelSys, Inc.
Object Dialog
How CONSTRUCT Generates
From NCSTG, Generate an Object
Parameter Data
Area
CLEAR
Subprogram
MODIFY
Subprogram(s)
READ
Subprogram
SAVE
Subprogram
PRE GENERATE
Subprogram
CODE
FRAMES
User Exit Definitions
Sample Subprograms
Generator
Subprograms
ExcelSys, Inc.
POST GENERATE
Subprogram
DOCUMENT
Optional
How the Model is Defined
Model OBJECT-MAINT-DIALOG-SUBP displayed successfully
CSDFM
N A T U R A L
C O N S T R U C T
Aug 10
Maintain Models
4.1.2
CSDFM0
1 of 1
Action ..................... __ A,B,C,D,M,N,P,R
Model ...................... OBJECT-MAINT-DIALOG-SUBP________
Description ........ *0201_____________________________________________________
OBJECT-MAINT-DIALOG-SUBP Subprogram
PDA name ................. CUOMPDA_
Status window ............ Y
Programming mode ......... S_
Comment start indicator .. **_
Type ..................... N Subprog.
Comment end indicator .... ___
Code frame(s) ............ COMA?___
Modify server specificatn CUOMMA__
________
Modify client specificatn CUOMMA__
________
COMB?___
CUOMMB__
________
CUOMMB__
________
COMC?___
CUOMMC__
________
CUOMMC__
________
COMD?___
CUOMMD__
________
CUOMMD__
________
________
________
________
CUOMME__
________
Clear specification ...... CUOMCS__
Post-generation .......... CUOMPS__
Read specification ....... CUOMR___
Save specification ....... CUOMS___
Pre-generation ........... CUOMPR__
Document specification ... CUOMD___
Command ............ __________________________________________________________
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12--help retrn quit frame
main
ExcelSys, Inc.
How the Model is Built
Logon SYSCST
Build Code Frame
Define
USER EXIT
Generate
SAMPLE
Subprogram(s)
ExcelSys, Inc.
Define
GENERATOR
Process(es)
Generate
GENERATOR
Subprogram(s)
Generate and
Modify PDA
Build MODIFY
Map(s)
Generate
POST GENERATE
Generate
READ
Define MODEL
Generate MODIFY
Subprogram(s)
Generate
PRE GENERATE
Generate
CLEAR
Generate
SAVE
Generate
DOCUMENT
(Optional)
How the Code Frames are Built
Develop a Prototype Program
Test the Program
Read the Prototype into the
Code Frame Editor
Examine the Code Frame(s)
IDENTIFY
Substitution
Parameters
ExcelSys, Inc.
Conditional
Codes
Generator
Processes
User
Exit(s)
Prototype
 Design,
Write and Test Sample Program
Control logic
Interface with menu
PF-keys
Update logic
Confirmation prompts
etc.
 Read
program into Code Frame Editor
 Convert specifics to variables
ExcelSys, Inc.
Administration Menu
In SYSCST, enter MENU
CSDMAIN
Aug 10
N A T U R A L
C O N S T R U C T
Administration Main Menu
4.1.2
CSDMNM0
1 of 1
Functions
----------------------------------------------M Maintain Models
F Code Frame Menu
S Maintain Subprograms
R Maintain Control Record
C Compare Menu
D Drivers Menu (CUA)
? Help
. Return
----------------------------------------------Function ........... _
Command ............ __________________________________________________________
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12--help retrn quit
lang
ExcelSys, Inc.
Code Frame Editor
ExcelSys, Inc.
Code Frame ......... COMA9
SIZE 11061
Description ........ Object Maint Dialog* define data area
FREE
57308
>
> + ABS X X-Y _ S 166 L 2
....+....1....+....2....+....3....+....4....+....5....+....6....+....7.. T
C
DEFINE DATA
GDA-SPECIFIED
1
GLOBAL USING &GDA &WITH-BLOCK
"
SUBPROGRAM
1
PARAMETER
"
01 #PDA-KEY(&KEY-NAT-FORMAT)
"
01 #PDA-ACTION(A&ACTION-LENGTH)
"
NOT GDA-SPECIFIED
2
PARAMETER USING CDPDA-D /* Dialog Information.
"
PARAMETER USING CDPDA-M /* Message Information.
"
PARAMETER USING CDPDA-P /* Other Information.
"
RETURN-TO-CONDITION
1
PARAMETER-DATA
U
"
NOT GDA-SPECIFIED AND NOT SUBPROGRAM
1
LOCAL USING CDPDA-D /* Dialog Information.
"
Read into Code Frame & Convert
Specifics
Code Frame not found. New member started
Code Frame : EXCLC1
Line: 1
of 1
Description:
Size: 4
Free: 120141
Cmd: read excelsys
Abs: X x-y: _ Dir: +
All...+....1....+....2....+....3....+....4....+....5....+....6....+....7.. T C
Code Frame : EXCLC1
Line: 1
of 146
Description:
Size: 3688
Free: 119921
Cmd:
Abs: X x-y: _ Dir: +
Top...+....1....+....2....+....3....+....4....+....5....+....6....+....7.. T C
DEFINE DATA
PARAMETER
1 #ACTION (A1)
1 #KEY (A8)
1 #MSG (A79)
LOCAL
1 #HEADER (A30)
INIT <'Employees Maintenance'>
1 #CV1 (C)
1 #CV2 (C)
1 #CV3 (C)
1 #CV4 (C)
ExcelSys, Inc.
Convert Specifics to Variable
 Substitution
parameters
Substitute one for one
 Conditional
Code Frame Lines
Code is only in program based on condition
 Generator
Process Calls
Code which is more complex
 User
Exit Definition
Code which cannot be anticipated
ExcelSys, Inc.
Substitution Parameters
*
*
*
View to obtain data for map and to be used for update
1
UPDATE-VIEW VIEW OF EMPLOYEES
*****
FIND-1.
FIND UPDATE-VIEW WITH PERSONNEL-ID = #KEY
IF NO RECORDS FOUND
COMPRESS 'Employee' #KEY 'Does Not Exist' INTO #MSG
ESCAPE BOTTOM (PROG.)
END-NOREC
*
*
*
View to obtain data for map and to be used for update
1
UPDATE-VIEW VIEW OF &PRIME-FILE
*****
FIND-1.
FIND UPDATE-VIEW WITH &PRIME-KEY = #KEY
IF NO RECORDS FOUND
COMPRESS '&PRIME-KEY' #KEY 'Does Not Exist' INTO #MSG
ESCAPE BOTTOM (PROG.)
END-NOREC
ExcelSys, Inc.
Conditional Code Frame Line
Description: BROWSE CODE 2 (MAIN BODY)
Size: 54125 Free: 67900
Cmd:
Abs: X x-y: _ Dir: +
....+....1....+....2....+....3....+....4....+....5....+....6....+....7.. T
MAP-USED
MAP-CONTAINS-STAR
Subprogram: CUSCGIN1 Parameter:
N
ELSE
USE-MSG-NR
INPUT WITH TEXT *MSG-INFO.##MSG-NR,
ELSE
INPUT WITH TEXT MSG-INFO.##MSG,
RETURN-TO-CONDITION
MSG-INFO.##MSG-DATA(1), MSG-INFO.##MSG-DATA(2),
MSG-INFO.##MSG-DATA(3)
USING MAP '&MAP-NAME'
ELSE
Subprogram: CUSCGIN1 Parameter:
N
RESET MSG-INFO
ExcelSys, Inc.
C
1
2
"
2
3
"
3
"
2
"
"
"
1
"
Generator Process Calls
Code Frame : CUOBC2
Line: 91
of 273
Description: OBJECT SUBPROGRAM SUBROUTINES
Size: 16516 Free: 103189
Cmd:
Abs: X x-y: _ Dir: +
....+....1....+....2....+....3....+....4....+....5....+....6....+....7.. T C
/*
/* Shift primary entity information to object
MOVE BY NAME &PRIME-FILE TO &OBJECT-NAME
MULTIPLE-ENTITIES
1
Subprogram: CUOBGET Parameter: LEVEL-1-PERFORMS
N "
ASSIGN &RESTRICTED-PDA.HELD-ID = &OBJECT-PDA-ID
END-FIND
AFTER-GET
U
END-SUBROUTINE /* GET-OBJECT
MULTIPLE-ENTITIES
1
Subprogram: CUOBGET Parameter: GET-SUBROUTINES
N "
ExcelSys, Inc.
Called Subprogram
0210 DEFINE DATA
0220
PARAMETER USING CUOBPDA
0230
PARAMETER USING CU--PDA
0240
PARAMETER USING CSASTD
0550
0560
0570
0580
0590
0600
0610
0620
0630
0640
0650
0660
0670
0680
0690
ExcelSys, Inc.
**SAG DEFINE EXIT GENERATE-CODE
DECIDE ON FIRST VALUE OF CU--PDA.#PDA-FRAME-PARM
VALUE 'LEVEL-1-PERFORMS'
ASSIGN #I = 1
PERFORM GEN-PERFORM-GET-SUBROUTINE
VALUE 'LEVEL-1-AFTER-GET'
PERFORM GEN-LEVEL-1-AFTER-GET
VALUE 'GET-SUBROUTINES'
PERFORM GEN-GET-SUBROUTINE
NONE
ASSIGN CSASTD.RETURN-CODE = 'E'
COMPRESS 'Invalid parameter:' CU--PDA.#PDA-FRAME-PARM 'passed to'
*PROGRAM TO CSASTD.MSG
END-DECIDE
*
Generate the Code
>
> + Subprogram CUOBGET Lib SYSCST
....+....1....+....2....+....3....+....4....+....5....+....6....+....7..
1120 FOR #I = 2 TO CUOBPDA.C#RELATIONSHIP-INFO
1130 ASSIGN #PARENT-I = CUOBPDA.#PDA-PARENT-FILE-ELEM(#I)
1140 PRINT(SRC) NOTITLE '*'
1150 PRINT(SRC) NOTITLE '*'(72)
1160 PRINT(SRC) NOTITLE 'DEFINE SUBROUTINE'
1170
CUOBPDA.#PDA-RELATED-FILE-NAME(#I)(EM=' G-'X(30))
1180 PRINT(SRC) NOTITLE '*'(72)
1190 PRINT(SRC) NOTITLE '*'
1200 PRINT(SRC) NOTITLE '* Get' CUOBPDA.#PDA-RELATED-FILE-NAME(#I)
1210
'related to' CUOBPDA.#PDA-RELATED-FILE-NAME(#PARENT-I)
ExcelSys, Inc.
User Exit Definition
.eTER-OBJECT-CALL
U
*
* If object detected an invalid field, reinput the screen
IF MSG-INFO.##ERROR-FIELD NE ' ' THEN
CSMUSEX
Aug 10
1 of 1
User exit name .........
Code frame name ........
User exit required .....
Generate as subroutine .
Sample subprogram ......
Default user exit code .
ExcelSys, Inc.
NATURAL CONSTRUCT
Maintain User Exit
AFTER-OBJECT-CALL
COMC9
Conditional
X
_
________
N
*_______________________________________________________________
________
* Additional processing upon returning from object subprogram,
for______
* example, MSG-INFO.##ERROR-FIELD or MSG-INFO.##MSG/MSG-NR
could be_____
*
overriden.______________________________________________________
______
Define Model
Model OBJECT-MAINT-DIALOG-SUBP displayed successfully
CSDFM
N A T U R A L
C O N S T R U C T
Aug 10
Maintain Models
4.1.2
CSDFM0
1 of 1
Action ..................... __ A,B,C,D,M,N,P,R
Model ...................... OBJECT-MAINT-DIALOG-SUBP________
Description ........ *0201_____________________________________________________
OBJECT-MAINT-DIALOG-SUBP Subprogram
PDA name ................. CUOMPDA_
Status window ............ Y
Programming mode ......... S_
Comment start indicator .. **_
Type ..................... N Subprog.
Comment end indicator .... ___
Code frame(s) ............ COMA?___
Modify server specificatn CUOMMA__
________
Modify client specificatn CUOMMA__
________
COMB?___
CUOMMB__
________
CUOMMB__
________
COMC?___
CUOMMC__
________
CUOMMC__
________
COMD?___
CUOMMD__
________
CUOMMD__
________
________
________
________
CUOMME__
________
Clear specification ...... CUOMCS__
Post-generation .......... CUOMPS__
Read specification ....... CUOMR___
Save specification ....... CUOMS___
Pre-generation ........... CUOMPR__
Document specification ... CUOMD___
Command ............ __________________________________________________________
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12--help retrn quit frame
main
ExcelSys, Inc.
How the Model Components are
created
Logon SYSCST
Build Code Frame
Sustitute Params
Conditionals
Define
USER EXIT
Generate
SAMPLE
Subprogram(s)
ExcelSys, Inc.
Define
GENERATOR
Process(es)
Generate
GENERATOR
Subprogram(s)
Generate and
Modify PDA
Build MODIFY
Map(s)
Generate
POST GENERATE
Generate
READ
Define MODEL
Generate MODIFY
Subprogram(s)
Generate
PRE GENERATE
Generate
CLEAR
Generate
SAVE
Generate
DOCUMENT
(Optional)
PDAs
 Common
PDA
CU--PDA
Headers, Title, etc.
#PDA-FRAME-PARM
Pass Parameter from Frame Code
 Standard
PDA
CSASTD
Message Fields
 Model
ExcelSys, Inc.
Specific PDA
Model Specific PDA
 Condition
Codes
#PDAC- (Logical)
 Fields
from Map(s)
#PDAX Derived
#PDA-
ExcelSys, Inc.
Fields
Generate PDA
Use CST-PDA
01 PDA-name
02 #PDA-CONDITION-CODES
(L/75)
02 #PDA-USER-AREA
(A100/40)
02 REDEFINE #PDA-USER-AREA
03 #PDAC-ADD-ACTION
(L)
02 REDEFINE #PDA-USER-AREA
03 #PDAX-PRIME-FILE
(A32)
03 #PDAX-PRIME-KEY
(A32)
03 #PDAX-.....
FIND.
FIND (1) &PRIME-FILE WITH &PRIME-KEY = #KEY
MOVE *ISN (FIND.) TO #UPDATE-ISN
ESCAPE BOTTOM (FIND.)
END-FIND
ExcelSys, Inc.
Modify PDA
 EDIT
PDA-name
 Use the editor to change the PDA
01 #KEY
(&KEY-FORMAT)
01 PDA-name
02 #PDA-CONDITION-CODES
02 #PDA-USER-AREA
02 REDEFINE #PDA-USER-AREA
03 #PDAX-PRIME-FILE
03 #PDAX-PRIME-KEY
03 #PDAX-.....
**
03 #PDA-KEY-FORMAT
ExcelSys, Inc.
(L/75)
(A100/40)
(A32)
(A32)
(A15)
Design & Build Modify Map(s)
 Minimize
User Parameters-System
Globals
Direct Command Processing
Vertical Scroll Pages
etc.
 Minimize
User Parameters-Module
Use PREDICT
Use Maps
Supplied PREDICT & NATURAL Objects
 Use
ExcelSys, Inc.
Standard Helproutines
Minimize User Parameters
CUSCMA
MA0
Aug 10
4
Module .............
System .............
Global data area ...
With block .........
BROWSE Program
Standard Parameters
CU-1 of
MYBROWSE
NATURAL-CONSTRUCT_______________
CDGDA___
________________________________
Title .............. Browse ..._______________
Description ........ This program is used to browse the
..._________________
_______________________________________________________
_______________________________________________________
_______________________________________________________
First heading ...... ________________________________________________
Second heading ..... ______________________________________________________
Command ............ _
Message numbers .... _
Password ........... _
ExcelSys, Inc.
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11-PF12--right help retrn quit
right main
Use Standard Helproutines
Parameter data area is required
CUGRMA
CST-READ Subprogram
CUG-MA0
of 1
Position cursor or enter screen value to select
CNHOBJN
NATURAL CONSTRUCT
CNHOBJ0
Aug 10
Select Parameter
1
ExcelSys, Inc.
Module
Type
SM Vers Level
User
-------- ------------ ---- ---- -------- -------____
CD-MKEY Parameter
2.2
0008
CST412
18:17:09
____
CDAAACTA Parameter
2.2
0008
CST412
18:17:09
____
CDACTA
Parameter
2.2
0008
CST412
18:17:10
____
CDACTD
Parameter
2.2
0008
CST412
18:17:10
CDACURS Parameter
2.2
0008
CST412
18:17:13
CDADEBUG Parameter
2.2
0008
CST412
18:17:13
CDAMARK Parameter
2.2
0008
CST412
1 of
Date
Time
-------- ------98-02-26
98-02-26
98-02-26
98-02-26
98-02-26
98-02-26
98-02-26
Generate Subprograms
CSGMAIN
Aug 10
*****
N A T U R A L
C O N S T R U C T
- GENERATION MAIN MENU -
4.1.2 *****
CSGMNM1
05:00 PM
Code Function
Spec Panel Model Options
---- ------------------------------------- ---- ----- ----- ------R
Read specification and object
R
O
M
Modify specification panel(s)
O
O
R
U
User exit editor
R
G
Generate source from specification
R
R
O
T
Test generated source
R
E
Edit generated source
R
S
Save specification and source
R
O
W
Stow specification and source
R
O
L
List generated programs for selection O
C
Clear specification and edit buffer
O
?/. Help/Terminate
---- ------------------------------------- ---- ----- ----- ------Code...: _ Specification/Program: EXCELRD_ Panel..: __
Library....: SYSTEM
Model..: CST-READ________________________
Options: _
Object type: Subprog.
Desc...: MODEL READ Subprogram
ExcelSys, Inc.
Generate Subprograms
 No
User Exits Needed
POSTGENERATE
READ
 User
Exits - Optional
CLEAR
DOCUMENT
 User
Exits - Required
PREGENERATE
SAVE
ExcelSys, Inc.
Subprograms - No User Exits
 POSTGENERATE
Substitute values for ‘&’ in Code Frame
 READ
Retrieve #PDAX- values from the most
recently generated object
ExcelSys, Inc.
Subprograms - Optional User
Exits
 CLEAR
Initialize PDA fields
Optionally provide defaults for PDA fields
 DOCUMENT
- Suggestions
Description
Inputs
Non-standard PF Keys
Miscellaneous details of interest
ExcelSys, Inc.
Clear Subprogram
CSGSAMPL
CSGSM0
Aug 10
1 of 1
CST-CLEAR Subprogram
User Exits
User Exits
Exists
Sample
Required
Conditional
-------------------------------- -------- ---------- ------------------_ CHANGE-HISTORY
Subprogram
_ PARAMETER-DATA
_ BEFORE-CHECK-ERROR
Example
_ LOCAL-DATA
_ PROVIDE-DEFAULT-VALUES
Subprogram
_ ADDITIONAL-INITIALIZATIONS
Example
_ END-OF-PROGRAM
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10-PF11--PF12--help retrn quit
bkwrd frwrd
ExcelSys, Inc.
Document Subprogram
CSGSAMPL
CSGSM0
Aug 10
1 of 1
CST-DOCUMENT Subprogram
User Exits
User Exits
Exists
Sample
Required
Conditional
-------------------------------- -------- ---------- ------------------_ CHANGE-HISTORY
Subprogram
_ PARAMETER-DATA
_ BEFORE-CHECK-ERROR
Example
_ LOCAL-DATA
_ START-OF-PROGRAM
_ ADDITIONAL-TRANSLATIONS
_ ADDITIONAL-INITIALIZATIONS
Example
_ DESCRIBE-INPUTS
Example
_ PF-KEYS
Subprogram
_ MISCELLANEOUS-VARIABLES
Subprogram
_ END-OF-PROGRAM
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10-PF11--PF12--help retrn quit
bkwrd frwrd
ExcelSys, Inc.
Document Subprogram
CUGDSKEY
***** MODEL DOCUMENT Subprogram *****
- SUPPORTED PF KEYS Mark the keys to be supported by the generated
Validation for Update Edits subprogram
_
_
_
_
_
_
_
_
_
_
_
_
ExcelSys, Inc.
help
retrn
quit
add
flip
place
bkwrd
frwrd
left
right
main
print
_ pref
_ confm
CUGDSM1
05:19 PM
Subprograms - Required User
Exits
 PREGENERATE
Set #PDAC- Condition Codes to True
Derive #PDA- variables
 SAVE
Save supplied #PDAX- values by writing
them to the source (**SAG ...)
ExcelSys, Inc.
PreGenerate Subprogram
CSGSAMPL
CSGSM0
Aug 10
1 of 1
CST-DOCUMENT Subprogram
User Exits
User Exits
Exists
Sample
Required
Conditional
-------------------------------- -------- ---------- -------- ----------_ CHANGE-HISTORY
Subprogram
_ PARAMETER-DATA
_ BEFORE-CHECK-ERROR
Example
_ LOCAL-DATA
_ START-OF-PROGRAM
_ ADDITIONAL-TRANSLATIONS
_ ADDITIONAL-INITIALIZATIONS
Example
_ DESCRIBE-INPUTS
Example
_ PF-KEYS
Subprogram
_ MISCELLANEOUS-VARIABLES
Subprogram
_ END-OF-PROGRAM
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10-PF11--PF12--help retrn quit
bkwrd frwrd
ExcelSys, Inc.
PreGenerate Subprogram
0010
0020
0030
0040
0050
0060
0070
0080
0090
0100
0110
0120
0130
0140
0150
0160
ExcelSys, Inc.
DEFINE EXIT SET-CONDITION-CODES
* Set conditions in PDA.
DECIDE FOR EVERY CONDITION
WHEN #PDAX-GDA NE ' '
ASSIGN #PDAC-GDA-SPECIFIED = TRUE
WHEN NONE
IGNORE
END-DECIDE
END-EXIT
DEFINE EXIT GENERATE-CODE
IF #PDAX-PDA NE ' '
ASSIGN #PDA-PRIMARY-DATA = #PDAX-PDA
ELSE
ASSIGN #PDA-PRIMARY-DATA = #PDAX-LDA
END-IF
END-EXIT
Save Subprogram
CSGSAMPL
Aug 10
_
_
_
_
_
X
_
_
ExcelSys, Inc.
CST-SAVE Subprogram
User Exits
CSGSM0
1 of 1
User Exits
Exists
Sample
Required Conditional
-------------------------------- -------- ---------- -------- -----------CHANGE-HISTORY
Subprogram
PARAMETER-DATA
BEFORE-CHECK-ERROR
Example
LOCAL-DATA
Example
START-OF-PROGRAM
SAVE-PARAMETERS
Subprogram
X
ADDITIONAL-INITIALIZATIONS
Example
END-OF-PROGRAM
How the Model Components are
created
Logon SYSCST
Build Code Frame
Define
USER EXIT
Generate
SAMPLE
Subprogram(s)
ExcelSys, Inc.
Define
GENERATOR
Process(es)
Generate
GENERATOR
Subprogram(s)
Generate and
Modify PDA
Build MODIFY
Map(s)
Generate
POST GENERATE
Generate
READ
Define MODEL
Generate MODIFY
Subprogram(s)
Generate
PRE GENERATE
Generate
CLEAR
Generate
SAVE
Generate
DOCUMENT
(Optional)