a mainframe. Being the sole user of the system allows you to do things which would be very un-neighborly on a (cont.) multi-user mainframe. If you are doing this project on a PC or PS/2 using the PC version of MAGEC, you might be able to (cont.) simply re-install part of MAGEC's dictionary to delete the VAD definitions. Using the initial installation diskettes (cont.) you could, at the DOS prompt, enter the commands: C: CD\MAGEC RESTORE A: DCLK1.DAT RESTORE A: KYFK1.DAT RESTORE A: ELTK1.DAT RESTORE A: ALGK1.DAT This assumes that your \MAGEC directory is on the C: drive and that the diskettes are on the A: drive; you may need to adjust the above for your particular situation. ## Un-Defining VAD Data Class Whether you are using a PC or mainframe you can un-define the VAD Data Class. To delete all definitions for the sample VAD Data Class and all subordinate entities: In all environments:** Online, in MAGEC, do the following functions: | | DITPUR VAD01 | | LBRPUR VAD01-C | | RULPUR VAD01 | | ELTDEL VAD00 | | ELTDEL VAD01 | | KYFDEL VADK1 | | DCLDEL VAD | | **Click here for [MAGEC Data Diagram Tool](../images/MAGEC_Data_Diagram_Tool.pdf) User Guide. Figure 28 — Example, Joined Via Domain On a PC:** *Also*, issue the following command from the DOS prompt: | | ERASE C:\MAGEC\VADK1.DAT # Appendix B -- DB Commands The following is a list of DB Commands which may be used with DBDITO. For more detailed information, please refer to (cont.) the *MAGECIO Commands* topic in the "Database Administration" chapter (section, Accessing Files from (cont.) Programs). | COMMAND | FUNCTION | REDKY | read record for key value in the screen data area | REDNX | read the next record from the one just read | REDPR | read the previous record (not on Datacom DB) | REDID | re-read the record just read | RDUKY | same as REDKY but with intent to update | RDUID | same as REDID but with intent to update | RDUNX | same as REDNX but with intent to update | LOCKY | locate record with key = or > the screen data area | LOCKX | locate record with key = the screen data area | LOCNX | locate next record from one just read or located | FSTAT | test file status (open or closed, etc.) | REDLE | read the record just located | UPDAT | update the record | DELET | delete the record | RELES | release the record just read-with-intent | ADDIT | add a record **Note:** Datacom/DB supports all of the above commands plus a list of additional ones. If you are accessing a (cont.) Datacom/DB file/database, you can use any legal command and it will be passed through to Datacom's DBENTRY entry point (cont.) and the results displayed to you. # Appendix C -- Edit Type Codes ## Automatic Editing When you define your mask using MSKDEF, or when you modify it after having allowed the auto-paint feature to generate (cont.) it for you, you can specify to MAGEC that you desire automatic editing to be done to screen fields. You do this by (cont.) specifying, for each field, an edit type code. These same edit type codes are also specified in the dictionary definitions for data items (DIT's). When you use the (cont.) auto-paint feature (for online screens) or the automatic report program generation (as in the "Batch Developer" (cont.) Tutorial) MAGEC sets the screen or report editing formats based upon the edit type codes found in the DIT definitions. (cont.) You can override them in the MSKDEF or RPTDEF functions if you need to. There are three general categories of edit types: AlphaNumeric Numeric Dates The Cobol copy book for a mask or the detail line definition for a report will contain appropriate Cobol edit patterns (cont.) (ie. ZZZ.99-) based on the edit type. You might refer to the chapter, "Analysis of the Generated MMP" (found in (cont.) the *Programmer's Reference Guide*) for more detail. For numeric fields there is also a specification as to how many digits left of the decimal point and right of the decimal point are allowed. One of the alphanumeric types is "T", that means table lookup validation. Operator entries will be validated by looking (cont.) them up in a MAGEC lookup table. You can define lookup tables and the valid entries in those tables. Refer to the MAGEC (cont.) "Database Administration" chapter for further details about lookup tables. ## Table of Edit Types AlphaNumeric Edit Types: X Miscellaneous fields, any characters will be accepted. Example: company name, comments. b Same as X. A Alphabetic (A-Z and blank) characters only. Example: person's name, city name. U Uppercase. Any characters will be accepted as valid, lowercase alphabetics will be converted to uppercase by MAGEC. T Table lookup. Same as U plus MAGEC will validate entry against a lookup table. W Where to display a description from a lookup table. Used in conjunction with a T field. MAGEC moves the description from the found entry in the table to a W field. P Pattern edited alphanumeric field. Numeric Edit Types: N Numeric, MAGEC will pad with leading zeros. S Numeric, MAGEC will suppress leading zeros. = Same as S, plus trailing minus sign. Z Same as S, plus comma insertion. -  (hyphen) Same as Z, plus trailing minus sign. $ Same as Z, plus floating dollar sign. # Pattern edited numeric field. Date Edit Types: M MM/DD/YY or MM/DD/CCYY (2 or 4-digit years). D DD/MM/YY or DD/MM/CCYY (2 or 4-digit year). Y YY/MM/DD or CCYY/MM/DD (2 or 4-digit year). **Note:** When the operator enters data into screen fields MAGEC accepts any valid, unambiguous format depending upon the edit type. For instance, in a type-$ field the operator may enter: 12345.5 or, **1,234.50 or, $1,234.50 etc. # Appendix D -- User Abend Sometimes you might wish to abend an online task issuing an error message to the operator. This is useful when you wish (cont.) to cause Transaction Backout to be invoked, or when you just want to stop processing because your program has sensed (cont.) error conditions beyond its capacity to deal with. This can be accomplished easily via the ABEND command which is handled in MAGEC's I/O module. To use the ABEND command, code: MOVE 'ABEND' TO TWA-DB-REQUEST.   MOVE xx TO TWA-DB-RETURN-CODE.   MOVE 'mmmmm' TO SCOMPL.   PERFORM AA840-CALL-MAGEC-IO THRU AA899-EXIT.   In the above example, xx is a two-character abend code which you may set. MAGEC will abend the task issuing a CICS (cont.) abend code of MUxx (MU is for MAGEC USER ABEND). The mmmmm is any 40-character message you would like (cont.) displayed. Note:** Control passes to the I/O module which aborts the task. Control does not return to your program. If an Abend (cont.) Handler program has been specified for either your MMP (refer to the definition of the "Screen Header" in the (cont.) Application Developer Tutorial) or for the User View (refer to the discussion of "Global Parameters" in the (cont.) *Installation Guide*), then the Abend Handler program will be invoked. Since you can code an Abend Handler program, it (cont.) might do anything you desired--including return control to any program you choose.