---
title: "cstm_main"
original_file: "cstm_main"
generated: "2026-06-12 10:24:07"
---
**
#
Introduction### Customization Tutorial
##
Who Should Read This Guide
This guide is written primarily for use by those persons who will be using MAGEC to develop and maintain online applications.
Copies of this guide should be distributed to:
Application Developers
Database Administrators
System Programmers
Auditors
This chapter will teach you how to do some of the most common types of Application Customization. To demonstrate the (cont.)
process most effectively, it uses sample projects based upon adding Customization to an existing sample application. It (cont.)
uses a tutorial approach. You must** first have completed the development project in the "Application Developer" (cont.)
section of this *Tutorials* manual before you can do the projects in this set of tutorials.
##
Supplemental Reading
This guide is written assuming that the reader is familiar with the overall MAGEC philosophy. It presumes that you (cont.)
understand how the "standard set of nine" functions work and that you are familiar with the standard screen formats of (cont.)
MAGEC. We suggest that you first read the manual titled *Application User's Guide* if you have not (cont.)
already.
This manual has a tutorial format which guides you through the Customization of an actual sample application. The (cont.)
sample application was developed by following the tutorial in the chapter titled "Application Developer" which should (cont.)
be completed before this one is started.
While doing the sample projects it would also be useful for you to have the *Programmer's Reference Guide* handy for the following chapters:
"Database Administration"
"Security System"
"Offline Utilities"
"Librarian"
"Documentation"
"Analysis of the Generated MMP"
These are not required but they will help you gain a more complete understanding of the MAGEC environment.
Since the Customization coding is done using IBM Cobol this chapter assumes you are familiar with Cobol.
##
How to Use the Tutorial
In this manual you will notice that there are many screen exhibits showing, step by step, exactly how each screen (cont.)
should look as you go through the exercise. You will also notice, on the page opposite each exhibit, both descriptive (cont.)
explanations and concise commands. The commands tell you exactly what to do to accomplish the project, the rest of the (cont.)
text gives you a more complete understanding of what you are doing and why, and how to get more (cont.)
information.
You may want to first go through this chapter following the tutorial exercise, doing the project as you go, and (cont.)
skimming over the background explanations. Then you might re-read the chapter more slowly and completely to get greater (cont.)
understanding. This approach has proven very effective for many people.
In order to help you to discern the commands from the background as readily as possible, you will notice that they are enclosed in a box.
| ```
** DO THIS:
Commands look like this.
```**
#
Sample Project 1
##
Displaying Calculated Figures
For the first project we will add Customization to the Sample Vacation System to display four calculated figures on the screen:
1) Remaining Vacation Days (Earned - Taken)
2) Remaining Sick Days (Earned - Taken)
3) Remaining Comp Days (Earned - Taken)
4) Total Remaining Days (Sum of all three above)
While following this tutorial, you will use the Screen Painting function (MSKDEF) to add four new screen fields and you (cont.)
will enter the Cobol Customization logic to define and calculate the desired figures.
You will use the TSKLST to guide you through the process; however, as you become more familiar with MAGEC you will find (cont.)
that you often can bypass the TSKLST and go directly to any screen or function by entering the appropriate command on (cont.)
the top line of the screen. When you cursor select a task from the TSKLST screen, MAGEC simply "simulates" that you (cont.)
have keyed a command on the top line by actually moving the command there for you.
The Cobol Customization code you enter will be stored in the MAGEC Library (ALG file) and will be inserted into the (cont.)
generated program when you re-submit the MMPCREAT jobstream to regenerate and compile. You can always return to it to (cont.)
modify or add to it (or delete it) and then regenerate and compile again. The TSKLST and the Customization screens work (cont.)
exactly the same whether you are initially adding Customization or modifying it later on. MAGEC aids both new (cont.)
development and maintenance programming.
##
Customization Menu
Begin by logging on to MAGEC.
| ```
** DO THIS:
Key in the command: TSKLST 600 . . . and press ENTER.
```**
The TSKLST screen will serve now as your menu and status display for Customization, just is it did for the basic (cont.)
application development. The TSKLST display actually continues for several pages; the basic development tasks are all (cont.)
on the first page. You can just press ENTER on any page of the TSKLST display to page forward, unless you are on the (cont.)
last page already.
| ```
** DO THIS:
Press PF8 to page forward to the second page.
```**
| ```
**
TSKLST 600 PF8 = next page -- PF5 = Page 1
M A G E C TASK LIST FOR MSK600
...............T A S K......................... PAGE 1 .....STATUS......
I. DEFINE APPLICATION TO DICTIONARY
1. DEFINE SCREEN HEADER DONE
2. DEFINE MMP DONE
II. VERIFY THAT FILES/DATABASE ARE DEFINED
1. DEFINE MASTER KEY & NORMALIZATION RULES DONE
2. DEFINE SUBORDINATE KEY(S) NOT DONE
III. DEFINE SCREENS
1. PAINT SCREEN / DEFINE MASK DETAIL 29 DONE
2. SELECT FIELDS FOR LOCATE SCREEN 5 DONE
3. SPECIFY LOCATE HEADINGS 5 DONE
4. GENERATE MASK (EXECUTE MSKCREAT) DONE
IV. CODE CUSTOMIZATION ALGORITHMS
A. DATA DIVISION
1. DATA DEFINITIONS %DATADEF 1 DONE
2. ADD/MODIFY FUNCTION CODES %FUNCT DEFAULT LOGIC USED
3. MODIFY (MODMAINT) FUNCTION CODES %FUNCTM DEFAULT LOGIC USED
Position the Cursor on an Item and Press ENTER to Select it, Press PF2 for
Item Description -OR- PF1 FOR HELP
KEY = MASK NUMBER
```**
Figure 01 -- Task List Screen, page 1
On the second page of the task list you will notice a screen full of Customization tasks.
If you examine the generated Cobol MMP (see MAGEC "Analysis of the Generated MMP") you will notice "Customization Insertion Points" denoted by percent-sign-markers, such as:
%DATADEF
%VARSTOR
etc.
These indicate the places where you can have MAGEC insert your own Cobol code at the time that the MMPCREAT job is run (cont.)
to generate and compile the MMP. As you enter your Customization code online you indicate which Customization Insertion (cont.)
Point you are entering coding for by name. For a more complete explanation refer to the "Librarian" (cont.)
chapter.
On the TSKLST display you will notice those same markers shown to the right of each Customization task. This helps you (cont.)
to relate the task to the section in the MMP's logic to which it applies. The bottom of the first page of the TSKLST (cont.)
display shows a few such tasks, page 2 shows more.
| ```
** DO THIS:
Use the arrow keys to move the cursor to the line (on page 2)
saying: "add items to VARIABLE-STORAGE (%VARSTOR)", press ENTER.
```**
You will be transferred to the Customization Algorithm ADD screen for inserting coding into **VARIABLE-STORAGE in the LINKAGE SECTION.
| ```
TSKLST 600 PF8 = Next Page -- PF5 = PAGE 1
M A G E C TASK LIST FOR MSK600
...............T A S K......................... PAGE 2 .....STATUS......
IV. CODE CUSTOMIZATION ALGORITHMS (CONTINUED)
4. DATA CONSTANTS %LITERAL DEFAULT LOGIC USED
5. Special SECTION-NAME for IDMS %SCHEMA DEFAULT LOGIC USED
6. DEFINE user work area %USRAREA DEFAULT LOGIC USED
_7. add items to VARIABLE STORAGE %VARSTOR DEFAULT LOGIC USED
B. INITIALIZATION
1. MAINT. FUNCTION INITIALIZATION %INIT DEFAULT LOGIC USED
2. ATTRIBUTE INITIALIZATION %INITATB DEFAULT LOGIC USED
3. BROWSE FUNCTION INITIALIZATION %LOCINIT DEFAULT LOGIC USED
4. PRE INITIALIZATION ROUTINE %PREINIT DEFAULT LOGIC USED
C. SCREEN HANDLING
1. INITIALIZE SCREEN (BLANK SCREEN) %BLNKSCR DEFAULT LOGIC USED
2. COMPUTATIONS FOR SCREEN DISPLAY %COMP DEFAULT LOGIC USED
3. SCREEN FIELD EDIT(S) %EDIT DEFAULT LOGIC USED
4. PHASE 2 EDITS %EDIT2 DEFAULT LOGIC USED
5. ADDITIONAL DATA TO BROWSE SCREEN %LOCMOV DEFAULT LOGIC USED
Position the Cursor on an Item and Press ENTER to Select it, Press PF2 for
Item Description -OR- PF1 FOR HELP
KEY = MASK NUMBER
```**
Figure 02 -- Task List Screen, page 2
##
Defining Work Fields
The screen will be displayed to you (as shown on opposite page) with "proforma" coding already on it. The proforma (cont.)
simply shows you (approximately) what your coding should look like. It may be used to simplify your own entry since you (cont.)
can overkey it on the screen to make it say exactly what you wish. When you press ENTER whatever coding is on the (cont.)
screen will be added to the MAGEC Library. You may, of course, change it at any time.
As the proforma indicates, your coding in %VARSTOR should be Cobol data definitions which begin with a level 05 and do not use the VALUE clause (VALUE is illegal in LINKAGE SECTION).
**
NOTE:
**
To protect reentrancy in the mainframe environments we recommend a rule that all work fields are to be placed into the (cont.)
LINKAGE SECTION's VARIABLE-STORAGE area rather than into WORKING-STORAGE. WORKING-STORAGE (insertion point name is (cont.)
%LITERAL) is to be used only for constants and literals, never for variables (fields you will MOVE TO). In some (cont.)
environments (such as WESTI) violating this rule will result in unpredictable results at execution time while in some (cont.)
environments (CICS) it will simply be less efficient. In any case, the rule does not cause any hardship on you since it (cont.)
is just as easy to put your code one place as the other.
In the PC and Network environments there is no penalty for placing variables in WORKING-STORAGE. If your application is (cont.)
to be executed only in these environments you may find it convenient to do so. Remember, though, that if/when your (cont.)
program is swapped out of memory, all data in WORKING-STORAGE will revert to its initialized values. Data in (cont.)
VARIABLE-STORAGE is initialized to LOW-VALUES every time your program is invoked.
If you desire to store data to be passed to another program or to the next invocation of this program (after sending (cont.)
the screen and reading the operator's response), you should place that data into the %DATADEF insertion point, rather (cont.)
than the %VARSTOR insertion point.
| ```
** DO THIS:
Go to the next Figure in this Chapter.
```**
| ```
**
ALGADD 600/VARSTOR
SEARCH ARG: ...........................................................
.......
Password: M A G E C VARSTOR page
New Password: CUSTOM ALGORITHM DEFINITION FOR MMP 600
add items to VARIABLE STORAGE TAB Option (PF14=ON/OFF): ON
....+..;10.;..+;..20....+...30....+...40....;+...50....+...60....+...70..
05 work-amount pic x9(7)v99 comp-3. 01
next: cstm02.md.txt