PC Jobstream Will Not Run
One of the most common reasons for the failure of MAGEC's jobstreams to not run, or to not run correctly, on the PC is (cont.)
an incorrect PATH specification. All batch operations are executed via .BAT files which are all stored in the (cont.)
\MAGxx\JCL directory. When attempting to execute them you *must* include \MAGxx\JCL in your path and you *must not* (cont.)
include \MAGxx in your path. This is because there are certain .EXE files in \MAGEC which have the same names as .BAT (cont.)
files in \MAGxx\JCL. Remember, the "current directory" (CD) is always implicitly the first directory in your path; (cont.)
thus, you must *not* have \MAGxx as your current directory when you attempt to execute a MAGEC (cont.)
jobstream.
Terminal Unable to Access MAGEC
If certain terminals are having difficulty accessing MAGEC while others seem to work OK, the problem may be that some (cont.)
records on the TWA file have become corrupted. This could be caused by an errant online program, or by some other (cont.)
problem.
Each terminal has a set of records (the number of records will vary) on the TWA file. The TWA file key is eight bytes (cont.)
long, the first four bytes being the terminal ID. Data is saved in these records to support pseudo-conversational (cont.)
processing, online help, window swapping, and many other intrinsic MAGEC features. If, somehow, these records cannot be (cont.)
accessed because of file errors, index errors, or if they just have garbage data stored in them, it is possible that (cont.)
the terminal for which those records exist might not even be able to access MAGEC. MAGEC might issue a message (cont.)
indicating that an error has occurred accessing the TWA file, or that the files are not open, or some other fatal error (cont.)
message.
You can purge the TWA file of all records for a given terminal using the online command:
TWAPUR tttt
where tttt is the desired terminal ID. Omitting the tttt will purge the TWA records for all terminals except the one (cont.)
you are at. *Be sure noone is trying to access MAGEC from any terminal for which you are purging (cont.)
records.*
You can purge all records from the TWA file by executing (in batch, while online MAGEC is not running) a DELETE/DEFINE IDCAMS job, then MAGINIT to initialize the file.
Program Runs Differently in Other Environment
If you have migrated an application from one environment to another using APUNLOAD / APLOAD and it seems to work (cont.)
differently in the new environment, there are several common causes to look for. First, the data on your files may be (cont.)
different and it may be perfectly normal to get different results. Second, the release level of your MAGEC systems may (cont.)
be different. Third, you may find some differences caused by using various Cobol compilers. MAGEC attempts to protect (cont.)
you from the peculiarities of various Cobol implementations, but 100% compatibility is not always possible. Fourth, you (cont.)
may be experiencing the effects of different collating sequences in ASCII and EBCDIC. Fifth, the configuration and (cont.)
available memory on microprocessor and network systems may affect execution. In OS/2 or MS-DOS, check the CONFIG.SYS (cont.)
and/or AUTOEXEC.BAT files against the recommendations in MAGEC's (and your Cobol compiler's) installation guides. Be (cont.)
sure your mapping is correct if accessing a network server. Finally, check the data definitions in the MAGEC (cont.)
Repository, especially the KYF DD Name and Drive ID on a LAN. Remember the environment setting for LANDRV and LCLDRV (cont.)
determine MAGEC's defaults for locating files.
#
Appendix H -- Viewing the Cobol
In the event that you wish to see the actual Cobol source code generated by MAGEC, you have several means available to you.
If you are running on a PC using PC MAGEC with Realia Cobol you can interactively trace your MMP by invoking MAGEC (cont.)
using the TRACE command (.BAT file) instead of the TS01 command. This executes the REALDBUG debugger with MAGEC (cont.)
executing "under" it. You can then enter your application's function code. If you have the .LST, .SYM, and .MAP files (cont.)
(created by the compiler) in your \MAGEC directory, the debugger will display your Cobol code as it executes. You can (cont.)
set breakpoints, stop and start execution, single step forward, view the contents of data fields, and alter their (cont.)
contents, if you wish.
On the PC you can also print the compiler listing using the command:
PRINT \MAGMF\MMPnnn.LST
-or-
COPY \MAGEC\MMPnnn.LST LPT1:
Where nnn is your MMP number, and LPT1: is the port to which your printer is attached.
Instead of the .LST file, you could also print or view the .COB file, which is the actual input to the Cobol compiler. (cont.)
Of course, you can view these files on your monitor using any available editor or the DOS TYPE command (piped to MORE, (cont.)
if desired), ie:
TYPE \MAGEC\MMPnnn.LST
TYPE \MAGEC\MMPnnn.LST|MORE
On the mainframe you can view the Cobol listing using your online editor to access the POWER or JES (or other) queue. You can also route it to the printer just as for any other compile listing.
If you are fortunate enough to have a Cobol debugger on your mainframe (ie: EZtest, Intertest, etc.) you can utilize it with your MAGEC MMP's, as well.
#
Appendix I - MODELWIN
MODELWIN is a version 2.6 feature of MAGEC that allows you to create fully-functional pop-up window maintenance (cont.)
applications. These pop-ups are useful for updating records while not having to leave the full-screen application (cont.)
you're working in. They can contain any or all of the standard set of nine functions, but in a miniature one-fourth (cont.)
size screen.
In order to specify an MMP as a pop-up window application:
1.
In the SHD record, specify "MODELWIN" in the 'Use Model:' field to indicate to MAGEC that you are creating a window (cont.)
application. (Refer to the Define Application section of the *Tutorials* manual or to the "Screen Painting" section of (cont.)
the *Programmer's Reference Guide* for explanations of all SHD screen fields.) Specify the MMP record as (cont.)
usual.
2.
Choose 'Paint Screen/Define Mask Detail' from the 'TSKLST nnn' screen (or just use the command: "MSKDEF nnn") to enter (cont.)
the screen painter. It will sense that you are using MODELWIN and will auto-generate the window border for (cont.)
you.
Any fields painted outside of the border will cause a warning message to display in SCOMPL:
Field drawn outside window border
**
This warning will not, however, keep the field from being added to the mask. Any field painted entirely inside or (cont.)
entirely outside of the window border will be part of the mask. Any fields drawn overlapping the borders will cause the (cont.)
"overlapping fields" error message to be displayed.
The field names for the borders are: SBTOP, SBBOTOM, SBRIGHT, and SBLEFT. **If these screen names are altered your (cont.)
program will not compile properly.** The Cobol code generated when you use MODELWIN makes reference to all these border (cont.)
fields in order to adjust them for monochrome or color terminals.
3.
Verify that the control card into MMPCRE (MMPCRE.RDR file on a PC) contains the -MAGECINC &MDL card in lieu of the old (cont.)
-MAGECINC MOD&TYP card as in earlier versions of MAGEC. When MMPCREAT runs, you should verify that MODELWIN is the (cont.)
first -MAGECINC listed in the MMPCREAT listing.
4.
If you wish to call the pop-up window from another function, perhaps a full-screen function, refer to the Attach / (cont.)
Detach feature of MAGEC which is discussed in Appendix R of the Customization section of this *Tutorial* (cont.)
manual.
#
Appendix J - Selecting Data
When you are filling in the specifications for the SHD (Screen Header) definition, you are asked to give the Data Class (cont.)
(DCL) name (i.e. VAC) and the Element (ELT) names for the data Elements (i.e. VAC01, VAC02, etc.) You could, if you (cont.)
knew them, just type in the 3-character Data Class name and the 5-character Element names. This was how you did it in (cont.)
the tutorial project; but what if you did not remember the names or their correct spellings?
MAGEC provides for you to request a pop-up window to help you search for the proper Data Class and Elements knowing (cont.)
only a fragment of the description. For example, you might not remember that the DCL name for the vacation data file (cont.)
was VAC, but only that its description contains the word "vacation". You might not remember the Element names of the (cont.)
Elements which contain the employee address and vacation data.
By pressing PF6 from the SHD definition screen you can request the pop-up data selection windows.
First, you will be asked to enter a search argument to search for the Data Class. If you leave the argument blank, you (cont.)
will be listed all Data Classes defined to MAGEC. If you enter a character string, only those Data Classes containing (cont.)
that character string will be shown. This pop-up is actually a standard MAGEC FND function (query) against the DCL (cont.)
definitions from the repository. You can scroll up and down through the list if more than one page of items matches the (cont.)
selection argument. To select the desired Data Class, place the cursor to the line on which it is shown and press (cont.)
ENTER. To abandon the search, press PF3.
Next, after making the DCL selection, you will be presented a list of all the Elements which make up the chosen Data (cont.)
Class. You can scroll up and down through this list also, if it spans more than one page. You can select an Element by (cont.)
pointing the cursor to the line on which it is displayed and pressing ENTER. The selected items will apear highlighted (cont.)
using reverse video, if your terminal or monitor supports reverse video. You can select up to nine Elements. When you (cont.)
are done, press PF6 to pass both the DCL and ELT selections back to the SHD screen. To abandon the selections, press (cont.)
PF3.
PF3 will return you to the SHD screen with no changes; no selections passed back to it. PF6 will record your (cont.)
selections. If all of the other specification on the SHDADD screen are acceptable (there are no errors found in the (cont.)
validation of what you have entered), you will likely be transferred immediately to the MMPADD screen without again (cont.)
seeing the SHDADD screen, this is normal. It helps expedite the definitions for a new application.
You can return to the SHD definition screen at any time by selecting it from the TSKLST, or by typing in the command: (cont.)
SHDSEE xxx (where xxx is your Screen Header number, "600" in the example project used in this (cont.)
tutorial)
You can press PF6 from the SHD screen while you are displaying the existing definitions. The same pop-up windows will (cont.)
apprear. Since you may wish to retain some or all of the selections you originally made, they will be shown (cont.)
(remembered) when the pop-up windows appear. You can override them easily. Pointing to a selected ELT and pressing PF4 (cont.)
will un-select it. There are PF key instructions displayed in SERRMSG (last three lines of the screen), as with all (cont.)
MAGEC functions.
* **
The first window allows you to search for a Data Class using any string of characters which might appear in the (cont.)
3-character DCL name or in the description. You can select the one you want by pointing with the cursor and pressing (cont.)
ENTER.
When you make your selection from the first window you will automatically be presented the second window.
The second window lists the Elements which make up the selected Data Class. You can select one or more Elements by (cont.)
pointing with the cursor and pressing ENTER. PF4 will un-select a selected Element. PF6 will pass your selections back (cont.)
to the SHD screen.
You can select multiple Elements. The ones you select will be highlighted if you are at a monitor or terminal which supports reverse video.
#
Appendix K - GUI Applications
[Read about the LAMP Stack version!](https://magec.com/images/MAGEC_RAD_PHP.pdf)
Obsolete, replaced by LAMP Stack version!** MAGEC-generated applications can be executed in either text (character) (cont.)
mode or in GUI (Graphical User Interface) mode. You do not have to do any special development tasks in order to (cont.)
generate GUI applications; in fact, the same program can be executed in text mode and in GUI mode without even being (cont.)
re-compiled.
The way MAGEC handles this is by automatically generating a GUI "panel" for your application if a user executes it in a (cont.)
GUI environment and no panel already exists. A GUI panel is simply a definition of the screen, including its menu bar, (cont.)
pull-down menus, and toolbar icons. MAGEC is unique in its ability to automatically generate a GUI panel from your (cont.)
text-based application. This is possible only because MAGEC applications automatically, in text mode or in GUI mode, (cont.)
include features which are normally found only in GUI applications. The GUI panel is merely a different presentation of (cont.)
the same program functions and data. It has a more appealing look and takes advantage of the mouse better than a text (cont.)
display does.
If you develop your application in a GUI environment you will be the first person to use the new screen and therefore (cont.)
you will cause the GUI panel to be generated. This happens when you generate the mask by pressing PF10 from the MSKDEF (cont.)
screen. When the mask is generated it is then displayed to you using the MSKSEE function, if no GUI panel exists for (cont.)
this mask MAGEC immediately generates it at that time. If you develop your application in text mode it is possible that (cont.)
one of your users might be the first person to use it in GUI mode and he/she will therefore cause the GUI panel to be (cont.)
generated. This could be important since MAGEC will ask various questions of the operator (either you or your user) to (cont.)
choose from a number of options regarding screen appearance and toolbar icons. You may (!) prefer to be the one to make (cont.)
those choices.
Once the GUI panel has been generated you can use the GUI screen painter to customize it if you so desire. That is not (cont.)
necessary, but it does allow you to dress up your panel with some of your own graphics, et cetera..
Now lets discuss the options you will be asked to choose from when the GUI panel is being generated
Background Color
This is the color of the panel's background. Each user can set his/her profile for preferences regarding text colors (cont.)
for any given panel background. There are sixteen colors to choose from. You can mouse-click the Background Color (cont.)
specification box to pop up a scrolling list of color codes with descriptions.
Static Text Color
This is the color for static text, such as headings, on your panel. You can select from the sixteen possible colors.
Border Type
This is the type of border you wish to be displayed around enterable (unprotected) data fields on the panel. You may (cont.)
specify that you want a 3-D border, which gives the appearance that the enterable fields are recessed into the panel, a (cont.)
line border, which simply appears as an outline around the fields, or no border at all. If your panel has a lot of (cont.)
enterable fields crowded close to one another, it may be best to specify no border to avoid further cluttering the (cont.)
display.
Toolbar
You can select a default toolbar, which includes all the standard buttons, or a custom toolbar, which is the standard (cont.)
buttons less any you choose to exclude, or no toolbar at all. The toolbar is placed at the bottom of your panel. For (cont.)
most applications the standard default toolbar is a good choice.
Tool Icons
If you choose "custom toolbar" MAGEC will prompt you with each of the standard buttons (showing you the button with its (cont.)
icon and a brief description to the right of it) and ask you to respond with a Yes or No as to whether you want each (cont.)
button included in the toolbar for this panel. When you begin there will be an empty toolbar shown at the bottom of (cont.)
your screen. As you choose buttons, they are moved into the toolbar so that you can see how it will appear on the (cont.)
panel.
You might wish to refer to the User's Guide*, Appendix B for a more detailed description of the toolbar buttons.
##
Doing Development in GUI Mode
[Read about the LAMP Stack version!](https://magec.com/images/MAGEC_RAD_PHP.pdf)
**Obsolete, replaced by LAMP Stack version!**
You can create an application in either text or GUI mode. Regardless which mode you used to do the development, the (cont.)
application can be executed in both text and GUI mode. If you do the development in GUI mode, however, MAGEC helps you (cont.)
even more by providing very user-friendly panels instead of the text screens. It also allows you to access the GUI (cont.)
screen painter to make further customization changes to your GUI panel.
You may wish to refer to the discussion in you *Programmer's Reference Manual*, Screen Painting section, under the (cont.)
topic "GUITOOL". It describes a related facility which enables you to dynamically create GUI objects from your MMP. The (cont.)
principles for GUITOOL and for the GUI screen painter are the same.
A detailed discussion, with graphical exhibits, can be accessed online from MAGEC (in GUI mode). To access it: from the menu bar at the top of any MAGEC screen, select Help, then select Tutorial.
To do development in GUI mode you can actually use the same text screens as you used in text mode, but that would not (cont.)
next: app09.md.txt