---
title: "app_main"
original_file: "app_main"
generated: "2026-06-12 10:24:05"
---

**
#
Introduction ### Application Developer Tutoral
##
Who Should Read This Guide
This guide is written primarily for use by those persons who will be using the MAGEC software to develop and maintain online and batch applications.
Copies of this guide should be distributed to:
Application Developers
Database Administrators
System Programmers
Auditors
This book is not intended to replace the Online Documentation but to augment it. This book will introduce the reader to (cont.)
the basic process used to generate online applications. In order to demonstrate the tasks most effectively, it uses an (cont.)
actual new development project which the reader can do as he/she is following the tutorial (cont.)
instructions.
##
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. You may wish to read through this book first to gain an initial understanding of the application development (cont.)
process. We suggest that you read the MAGEC *Application User's Guide* before actually designing and developing your (cont.)
own applications.
While doing the sample project it would also be useful for you to have several other chapters handy for reference:
"Database Administration"
"Security System"
"Offline Utilities"
"Librarian"
"Documentation"
"Analysis of the Generated MMP"
These are not required but will help you gain a more complete understanding of the MAGEC environment.
This tutorial may be used as an introductory course without requiring you to have read the other chapters listed above (cont.)
since brief explanations are included for all features necessary to develop and to test the sample (cont.)
application.
##
How to Use This Tutorial
Throughout this book you will find explicit commands telling you exactly what to do to develop the sample application. (cont.)
You will also notice quite a bit of explanation and background information to help you to understand what is (cont.)
happening.
In order to allow you to "skim" over the background information the first pass through the book we have inserted "markers" pointing to the explicit commands. They look like this:
| ```
     DO THIS:
The commands are inside a box like this.
   
```**
You may wish to go through the tutorial actually doing the project as you read, then re-read it for more complete explanation. This technique seems to facilitate faster learning for most people.
##
GUI Development
The PC Cobol versions of MAGEC are no longer available, they have been superseded by the LAMP Stack version.
[Read about the LAMP Stack version!](https://magec.com/images/MAGEC_RAD_PHP.pdf)
#
The Sample Project
##
Vacation System
The sample project we have chosen to demonstrate the application development process of MAGEC is the creation of a (cont.)
system which records vacation, sick leave, and comp time for your staff. Though this is a sample project, you may want (cont.)
to keep the new application you will create since it will be a complete, working system which you can use as is or may (cont.)
customize if you like.
The Vacation System we will create will use two "Data Classes" (files). They are:
1) VAC Vacation, Sick and Comp time Data
2) SIF Security Information File
You may wish to refer to Appendix A of this chapter to see more detailed information about these Data Classes. Both of (cont.)
them are already defined to your system and are ready to be used. If you wish to know more about the MAGEC processes (cont.)
used to define them you may refer to the "Database Administration" chapter of the *Programmer's Reference Guide*. You (cont.)
may also refer to the "Data Definition" chapter of this manual.
The VAC file will be the "primary data class" and the created application will do Inquiry, Update, Data Entry, Browse, (cont.)
and Programmerless Query functions against it. The SIF file will be accessed only to get the employee's name to display (cont.)
on the screen. It will not be updated. The key for the VAC data class is employee number, for the SIF it is a zero (cont.)
prefix plus employee number.
The application we will create consists of one Cobol program, called an MMP (MAGEC Message Processor). It will include nine online functions:
VACSEE Inquiry
VACCHG Update
VACDEL Delete
VACADD Add
VACNXT Inquiry, next employee (forward or backward)
VACDUP Duplicate existing record
VACLOC Simple browse with generic start
VACSCN Selective browse -- query by example
VACFND Complex search -- boolean search
These are the standard set of nine functions which are produced automatically by MAGEC. Later you will see that through (cont.)
customization you can add your own additional functions with very little effort. All transactions in MAGEC are (cont.)
identified by a six-character function code like those listed above. The function code is always the first field on (cont.)
every screen, in the top left corner. It is immediately followed by a key value; hence, to see the data for employee (cont.)
#18, you could home the cursor to the upper left corner and type "VACSEE 18".
After you complete the exercise in this book you may wish to go on to the MAGEC "Customization" Tutorial, which uses the same Vacation System for its sample projects.
The VACLOC, VACSCN, and VACFND functions are called the "browse functions." The VACSCN and VACFND are also called (cont.)
"programmerless queries". All three of them can browse both forward and backward through the data and they all allow (cont.)
the operator to cursor select any item for either full-screen inquiry (VACSEE) or update (VACCHG).
In all cases the operator can enter the function code followed by an employee number (leading zeros not required) to do (cont.)
that particular function. The browses will accept a generic (inexact or partial) key. The application also will take (cont.)
advantage of the built-in automatic editing facilities of MAGEC to prevent bad data from being placed in the (cont.)
records.
The Vacation file and the Security Information file are already defined to the dictionary. The data items (fields) (cont.)
which make them up are also defined, including editing rules for each field. There is also a **business rule** defined (cont.)
for the Vacation data to specify that any employee number on the VAC file must first be defined to the SIF file. This (cont.)
will automatically generate code into your program to prevent a user from adding records to the VAC file for undefined (cont.)
employee numbers. This is just one example of the type of data integrity which can be enforced automatically using (cont.)
MAGEC's central dictionary and automated generation capabilities.
The data definitions for the VAC and SIF data classes take advantage of MAGEC's "Domain" facility. The data items (cont.)
(fields) which make up the keys for each file are defined as belonging to Domains. The employee numbers in each file (cont.)
are in the Domain called "EMPNUM", and the zero prefix for the key of the SIF file is in the Domain called "ZERO". This (cont.)
enables MAGEC to provide even greater automation for the development process than would be possible if Domains had not (cont.)
been specified; it enables MAGEC to fully automate the Logical Join process which will join the VAC data to the SIF (cont.)
data via the employee number. If Domains had not been specified, you could still develop the same application, but (cont.)
MAGEC would have to ask you to do a bit more work to properly join the SIF data to the VAC data.
The procedures to define Domains and to relate data items to them (as well as other data definition procedures) will be (cont.)
shown to you in the "Data Definition" chapter later in this manual. For now it is sufficient to note that the Domain (cont.)
facility will be employed in the development of this application, and that it enhances MAGEC's automated development (cont.)
capabilities.
#
Getting Started
##
Deleting Previous Student's Work
If you are not the first person in your company to follow this tutorial to develop the sample application then you may need to delete the previous student's work in order to start fresh.
Follow the procedure in Appendix D of this chapter, if needed.
##
Mask & MMP Numbers
There are two principle components to any online application:
Mask 3270 Screen Format and Editing Rules
MMP Online Cobol application program
Before you can begin to create a new application you must first be assigned a Mask Number and an MMP Number for the (cont.)
application you are to develop. This is usually controlled by a central administrator to prevent two persons from (cont.)
trying to use the same numbers. For the purposes of this demonstration we have set aside one Mask Number and one MMP (cont.)
Number for your use. They are:
Mask Number 600
MMP Number 600
Assigning the same number for the MMP and Mask is not required by MAGEC but it does make them easy to remember. In some (cont.)
applications you may need to have multiple Masks for one MMP or multiple MMP's for one Mask. Either of these situations (cont.)
is fully supported by MAGEC. However, these cases are rare because of the many built-in capabilities and features of (cont.)
MAGEC, like automatic pop-up windows, browses and queries with cursor selection, window swapping, (cont.)
etc.
If you are curious you could refer to Appendix A now to review the VAC and SIF definitions. This is by no means necessary, but should satisfy your curiosity.
**
NOTE:
**
Mask and MMP numbers do not have to be numeric, they can be alphanumeric as well, following the pattern:
nxx
             
 
where:
             
 
n
             
= any digit (0 thru 9)
x
             
= any digit (0 thru 9) or any alphabetic character (A through Z, excluding space character)
Hence, some valid "numbers" are: 1AA, 12D, 8XY, etc. You should note as well that the numbers beginning with "6" are (cont.)
reserved for use by MAGEC Software and you should not use them for your applications.
**
Hint:
**
The appendices of this, and the other, tutorials often contain condensed information which is handy for reference by (cont.)
application developers, database adminsitrators, security officers, and the like. You may wish to copy some of them to (cont.)
keep them handy in condensed form as you are using MAGEC.
#
Task List
##
How to Begin
With the exception of the necessary offline (batch) Generate and Compile Job Streams, all of the development you do (cont.)
will be online through MAGEC screens. The first thing you must do is to "log on" to MAGEC. If you have not yet been (cont.)
defined to the MAGEC Security System and assigned a password, then now is the time to see your Security Officer to have (cont.)
that detail taken care of.
**
NOTE:
**
A special logon identity is provided for your convenience in doing these tutorials, you can logon using an employee number of 18 and a password of ALEE.
| ```
**     DO THIS:
Log on to MAGEC.
   
```**
If you receive the notification on the bottom line of the screen which tells you to press PF1 to read the broadcast (cont.)
message (MSGSEE), then do so at this time. This releases the bottom line of the screen for its normal uses. Refer to (cont.)
the ["PF Keys"](/DOC/magref_main.htm#MAGREF004001) reference table for a compact list.
Once you have logged on to MAGEC you are ready to start. There is a Task List function (TSKLST) built into MAGEC to (cont.)
assist you. It serves as both your developer's special menu and also as a status report to help you track your (cont.)
progress.
Every screen in MAGEC, including screens for your applications, follows certain standards. One of those standards is (cont.)
that the first field on every screen, at the top left corner, is a six-character function code field; immediately (cont.)
following it is a free-form key value field. You do not need to type the space which is always shown separating the (cont.)
function from the key since MAGEC inserts a 3270 attribute to cause the cursor to automatically skip to the key (cont.)
field.
There is a more complete discussion of the screen standards in the *Programmer's Reference Guide*, in the "Screen (cont.)
Painting" chapter. You may wish to read through later on to get a more thorough understanding. Definition of data files (cont.)
is shown in the "Data Definition" chapter of these tutorials.
**
NOTE:
**
The combination of a six-character function code plus a key value is often referred to as a "command".
To use the TSKLST:
| ```
**     DO THIS:
Type the command: TSKLST 600 on the top

next: app02.md.txt