| OPTION | Set session option for CLEAR and PA1 key | **HELP | Menu-driven review of help text | **SWAP | Swap windows (same as pressing PF9) | **EXIT | Exit MAGEC | (same as pressing PF15) | **PF01 thru **PF24 | Simulate PF key entry | **PA01 thru **PA03 | Simulate PA key entry | **ERR1 | HELP (same as pressing PF1) | **MENU | High level menu | ++MENU | Intermediate level menu | $$MENU | Low level menu | MSGSEE | Display broadcast message | BROWSE BACKWARD | Set browse direction to backwards for LOC, SCN, | and FND functions | BROWSE FORWARD | Set browse direction to forward for LOC, SCN, and | FND functions | CLEARS | Display MAGEC logo screen | SYSLOG ON | Log on to MAGEC | SYSLOG OFF | Log off of MAGEC # Appendix G -- Problem Solving Aids *MAGEC includes a variety of utilities and features to assist you in resolving problems you might encounter in the (cont.) course of using MAGEC either to develop applications or in the execution of those applications. You could save many (cont.) hours of frustrating work by familiarizing yourself with them. This appendix is a brief summary of many of the most (cont.) useful aids and techniques.* Error Messages in SERRMSG These messages are stored on the MAGEC ERR file and they include a 4-line description. You can press the high-level (cont.) help key (PF1) whenever an error message is being displayed. Pressing PF1 will give you an online display of the (cont.) explanations for your errors. You can produce a hardcopy list using the batch ERRLIST program, or you can display the (cont.) error messages with their explanations online using the command: ERRSEE xxx (xxx is the error number) Error Messages In SCOMPL Certain error conditions display messages in SCOMPL. These are documented in the "Database Administration" chapter of the *Programmer's Reference Guide*. DBxx Abend Codes Various types of I/O-related errors may be detected by MAGEC's I/O module which will result in the I/O module's (cont.) aborting the task and issuing an abend code as: DBxx. These codes are documented in the "Database Administration" (cont.) chapter of the *Programmer's Reference Guide*. There is usually also an explanatory message issued to either the user (cont.) terminal, the console, or both. I/O errors on a PC are often caused by insufficient memory, causing a file OPEN to fail (cont.) for lack of adequate space for buffers. Also, refer to the ["Abend Codes"](/DOC/magref_main.htm#MAGREF009002) reference table for a compact list of codes. DB17 Abend Code This return code can result from several causes, but it usually means that the definition of a file key does not match (cont.) the definition given to MAGEC. For example: an alternate key might specify No Duplicates to the access method and (cont.) Duplicates Allowed to MAGEC, or the offset/length given to MAGEC might not agree with the definition to the access (cont.) method, or the number of keys might be different, et cetera. Also check that fixed-length/variable-length and record (cont.) length specifications agree. MSKCREAT Errors When the batch MSKCREAT jobstream is executed, it produces a listing which serves as an audit trail of what has been (cont.) processed and also displays any appropriate error message(s). If you are experiencing problems which seem to involve (cont.) the screen display or references to screen fields in your program you should look at the MSKCREAT printout to see if it (cont.) indicates any problems. If any errors are found, MSKCREAT will not catalog the new mask copybook On a PC this "print" (cont.) output might have been routed to your screen, rather than to print. You can execute MSKCREAT with the print routed to (cont.) LPT1 or LPT2 if necessary. To do so use the command: MSKCREAT nnn LPT1 (or LPT2, as appropriate). MSKCRE Errors When you execute the online MSKCRE function, instead of the batch MSKCREAT jobstream, error messages will be displayed (cont.) to your screen instead of being printed. If any error is encountered processing will not complete, just as in the batch (cont.) MSKCREAT. MMPCREAT Errors As the batch MMPCREAT jobstream is generating your MMP's it edits and validates all specifications. If any errors are (cont.) encountered MMPCREAT will print error messages in the printed output which includes an audit trail of its processing. (cont.) If you experience errors in executing or compiling the generated program you should check the printed output from (cont.) MMPCREAT to see if any errors or warnings were displayed. On a PC this output mignt have been routed to your screen, (cont.) rather than to print. You can execute MMPCREAT with the print routed to LPT1 or LPT2 if necessary. To do so use the (cont.) command: MMPCREAT nnn LPT1 (or LPT2, as appropriate). MBPCREAT Errors -same as for MMPCREAT Errors- Data Definition Errors If you suspect that your application might be executing using a non-current definition of a data Element, check the version verification information online using the command: VERZUN MMPnnn If you would like complete hardcopy documentation, including where-used reporting for any given data-class, you can (cont.) execute the batch DCLDOC utility. Refer to the "Offline Utilities" chapter of your *Programmer's Reference Guide* for (cont.) control card and execution instructions. If you would like to see or update the contents of a file, you can use the online DBDITO function which provides (cont.) combined character/hexadecimal display and update capabilities. Refer to the "Database Administration" chapter of your (cont.) *Programmer's Reference Guide*. If you are using a PC and would like a hardcopy dump of your file, use the MAGUNLD utility provided with MAGEC for PC's. Refer to the MAGEC *Installation Guide* for information regarding MAGUNLD. On a mainframe you can use the (IBM) IDCAMS utility to produce a file dump for VSAM files. Business Rule Errors If you have made, or intend to make, changes to a Business Rule, you should use the online where-used facility to ascertain what applications will be affected. To do so, enter the command: RULUSE eeeee (eeeee is an Element name) Referential Integrity Rule Errors -same as for Business Rule Errors- MAGEC System Program Abends One of the most likely causes for unexplained abends of MAGEC's own programs would be corruption of the dictionary (cont.) files. To audit the dictionary, producing a comprehensive report of errors or suspected errors, execute the batch (cont.) DDAUDIT utility. Refer to the "Offline Utilities" chapter of your *Programmer's Reference Guide* for control card and (cont.) execution instructions. Note that it is normal for some of MAGEC's batch programs to force an abend in certain circumstances. In these cases (cont.) you will usually receive a "decimal divide exception" (OC9) accompanied by an error message displayed with the printed (cont.) output; or you may receive an "operation exception" (0C1) with the PSW pointing (in the dump) to an error message. The (cont.) most common place where you might experience this is in the MMPCREAT or MBPCREAT jobstreams when they encounter (cont.) specification errors which preclude the proper generation of a program. You might also receive an abend from the online (cont.) control program if certain unrecoverable errors are detected, especially errors involving corrupted screen mask control (cont.) sequences. Suspected Dictionary Errors Execute DDAUDIT to verify the integrity of your MAGEC dictionary. Refer to the "Offline Utilities" chapter of your *Programmer's Reference Guide* for control card and execution instructions. MMP Errors If you think that your MMP is operating incorrectly, and do not know why, it might be because you are executing an old (cont.) version of the program. It might also be because your program was compiled using an old version of the mask copybook, (cont.) or an element copybook. To quickly verify the versions of those components of your MMP, use the online version (cont.) verification by keying the command: VERZUN MMPnnn (nnn is your MMP number) If you would like hardcopy documentation of all the specifications for your application, execute the batch msk (cont.) documentation utility, MSKDOC. Refer to the "Offline Utilities" chapter of the *Programmer's Reference Guide* for (cont.) control card and execution instructions. If you are using a PC, you can invoke your program in trace mode by executing MAGEC's TRACE.BAT file instead of the (cont.) TS01.BAT file. The trace utilizes Realia COBOL's RealDBUG utility. It includes online instructions for key utilization. (cont.) You can also refer to you Realia documentation for more specifics on the use of RealDBUG. MMP Abends If you are using a PC, you can usually debug abend situations easily by invoking MAGEC using the TRACE command (instead (cont.) of TS01), and executing your transaction. When the screen displays your Cobol code, just press the "T" key to let the (cont.) program execute while simultaneously tracing on the screen. When it reaches the abend, it will stop. You will see the (cont.) instruction on which the abend occurred and can view the contents of storage to determine the cause. This works well (cont.) for "data exception" abends, and for some others as well. Table Lookup Usage If you wish to know which applications are using a given MAGEC Lookup Table, you can find the answer online using the command: SCDTBL nnn (nnn is the table number in question) Data Usage In addition to the DCLDOC utility, you can also use the where-used facilities of the MAGECLBR utility to produce (cont.) hardcopy reports. You can report usage for Data Items, Elements, copybooks, tables, and even generic character strings. (cont.) Refer to the "Offline Utilities" chapter of your *Programmer's Reference Guide* for control card and execution (cont.) instructions. Insertion Point Mis-Use A number of customization errors can be avoided or corrected by simply reviewing the appropriate areas of the (cont.) "Insertion Points" chapter of your *Programmer's Reference Guide*. The "cautions" for each insertion point were (cont.) compiled based upon errors encountered by other people. There is a good chance that an error you experience might not (cont.) be original and that you can benefit from their pain. Compiler Diagnostics If you have received error messages from the Cobol compiler, you can follow a simple procedure to get directly to the (cont.) coding containing the errors. First look at the line numbers shown immediately to the left of each error message in the (cont.) error report at the end of your compile listing. Then find those line numbers in the body of the source listing. You (cont.) will notice that MAGEC has inserted "markers" above, below, and in the right margin (columns 73-80) of all of your (cont.) customization coding. Since the probability is very high that any errors will be in the customization code, rather (cont.) ,than in the generated code, this will help you to go directly to the customization coding to correct the errors. The (cont.) markers identify the mnemonic insertion point name plus any modifier you have used (i.e. EDIT/BADDATE, or JOIN/01-SIF). (cont.) You can use the online ALGSEE function to display and update the customization coding, i.e.: ALGSEE 600/JOIN/01-SIF   Bad Data on Files If you suspect that there is bad data on your data files, you can verify it by using the online DBDITO facility to view (cont.) or update virtually any data--if you are authorized. If your are getting a Data Exception abend and suspect that it is (cont.) caused by non-numeric data in data items which are defined as being numeric, you can turn on the VERIFY option (on the (cont.) SHDxxx screen, or BCHPGM screen) for your application. The VERIFY option will usually protect your application from (cont.) abending and enable you to use your [online] application to correct the bad data on file. It cannot protect against (cont.) data exceptions occurring in your customization coding, though. Refer also to the topic "MMP Abends" earlier in this (cont.) appendix. 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: Next: https://magec.com/DOC/markdown/app07.md.txt