DATA-X DATABASE MANAGEMENT SYSTEMBy Jeffrey A. Summers   DATAX.CTB is a full-featuredinformation processing system forAtari XL/XE computers with at least64K.  The program can handle fileswith up to 300 characters (lettersor digits) per field, 20 fields perrecord, 1,000 records per file, fora maximum of 600,000 bytes ofinformation.  The program performscertain mathematical manipulationsacross fields as well as the add,delete and update functions normallyfound in this type of program.  Withthe use of windows, no complicatedcommands need be learned.  TheXXXprogram prompts for all neededinformation to perform itsfunctions.   Like most current databasesystems, you create files that arearranged as groups of RECORDS.  Eachrecord contains a number of FIELDS,which contain the actualinformation.GETTING STARTED   Take a blank disk and format itwith DOS 2 or DOS 2.5.  (Be sure toWRITE DOS FILES to this disk.)  Now,copy the files RNTIME.OBJ andAUTORUN.CTB to this disk.  Finally,rename RNTIME.OBJ to AUTORUN.SYS.When you're done, you should haveXXXfour files on your disk:   DOS.SYS   DUP.SYS   AUTORUN.SYS   AUTORUN.CTB   To start, put this disk into yourdrive, hold down the [OPTION] keyand turn on the computer.  DATA-Xwill load and run automatically.USING DATA-X:THE FILES MENU   The FILES menu, the first menuyou'll see, has the followingoptions:XXXCREATE A FILE   First, decide how to arrange yourdata.  Each field can contain up to300 characters (although only 255 ofthese can be printed on the systemprinter).  The TOTAL number offields (total records times fieldsper record) in a file cannot exceed2,000, and the maximum number offields per record is 20 -- so youdefine your file for 100 recordswith 20 fields each, 1,000 recordswith two fields each, or anything inbetween.   Let's create a sample addressbook.  Press [C] at the main FILESXXXwindow to Create a file.  Whenprompted for a filename for yourdatabase, choose any legal filename(up to 11 alphanumeric characters,including an extender).   When asked for the number ofrecords you want in the file, youare setting the MAXIMUM number ofrecords.  Though you can extend thedatabase later, you should choose anadequate number of records to beginwith.  Here, enter 10.  At theprompt for the number of fields,enter seven: last name, first name,street address, city, state, ZIP andphone number.   When prompted, enter field labelsXXXand lengths.  In this case, enter:LAST, 20; FIRST, 10; STREET, 25;CITY, 15; STATE, 2; ZIP, 5; andPHONE, 10 (to include the areacode).  The program then creates thefile and displays the MAIN menu.DISK DIRECTORY   Typing D at the FILES menu liststhe files in drive 1 to a window.You are then asked to press [RETURN]again to go back to the FILES menu.EXIT   This option closes all files andreturns you to DOS.XXXREBOOT   This is equivalent to turning thecomputer off and back on again butcauses less wear on the electroniccomponents inside.  This option ismost useful when you're finishedwith DATA-X and wish to use anothercommercial program.OPEN A DATABASE   This opens a previously createddatabase for data entry, searches,sorts, etc.  Just type in a filenamewhen prompted.  (Drive 1 is thedefault.)  Then you'll return to theMAIN menu.XXXTHE MAIN MENUADD A RECORD   Pressing [A] lets you Addinformation (records) to thedatabase.  Since there is nothing inour sample database yet, you'llfirst need to add a few records.The program prints the labels forthe fields one at a time, promptingyou to make your entry.  Enter aname, address and phone number,pressing [RETURN] when you're donewith each field.  Use [DELETE] be asusual to delete typos.  After youenter a record, the program returnsXXXyou to the MAIN menu.  Just press Aagain to add more records.  For ourexample, make four or five entries.FIND RECORDS   This is one of the most powerfulfunctions in the program.  It letsyou search the database, selectingrecords for further processing.   Choosing this option brings up asub-menu.  Press [L] to list thefield labels in your file (in caseyou've forgotten their order).Press [R] to reset the flags.  Only"flagged" records are operated onwith most other options.  Thereforeresetting the flags reselects ALLXXXthe records (see below).  Pressing[E] exits to the MAIN menu, and [S]initiates a search.   When you start a session, allrecords are "flagged," or selected.This part of the program lets youeliminate the records you don't wantto work with.  The FIND routine letsyou include or exclude based on apattern match.   From the FIND sub-menu, press [S]to begin a search.  When promptedfor the field on which to search,press [1] and [RETURN] for ourexample, choosing the first field(last names).  When asked for asearch string, type part or all ofXXXone of the entries you made.   The program can search such thateither the BEGINNING of the field orthe ENTIRE field is checked.  Thefirst method will find the BUG inBUGBLATTER but not in LADYBUG.  Thesecond will find both.   Next you are presented with alist of logical operators -- AND,OR, XOR and NOT -- which control themanner in which the records areflagged or unflagged:   AND: if the field contains thestring and was previously flagged,it is again flagged.  All others areunflagged.  For example, if you wantXXXanyone named BEESON who lives inBUFFALO, you would first search onLAST NAME for BEESON using AND,which eliminates anyone who isn't aBEESON, and then search on the cityfield for BUFFALO, again using AND,which makes it only the BEESONs inBUFFALO.  You'll probably use ANDfor most of your searches -- itsimply eliminates all those recordsfrom the current group that don'tmatch.   OR: if the record is alreadyflagged OR if it contains the stringOR BOTH, then it is flagged.Unflagged records that do notcontain the string remain unflagged.XXX   XOR (exclusive OR): works thesame as OR but excludes records thatmeet both conditions.  Normally, ifyou wanted the BEESONs or anyoneelse from BUFFALO, you'd firstsearch the LAST NAME field for theBEESON using AND (so you get onlythe BEESONs at first), then the CITYfield for BUFFALO using OR.  If youwanted all the BEESONs as well aseveryone from BUFFALO, but NOT anyof the BEESONs IN BUFFALO, you'd useXOR for the second search.   NOT: similar to AND NOT.  If youwant the BEESONs who are NOT fromBUFFALO, search the LAST NAME fieldfor BEESON using AND.  Then searchthe CITY  field for BUFFALO usingXXXNOT.  Combining these logicaloperators enables you to do verycomplex searches easily.  Theprogram always tells you how manyrecords are flagged at the end ofyour search.PRINT AND DISPLAY   Currently flagged records can bedisplayed onscreen or printed on aprinter (or to a disk file)according to the format you choose.   For now, press D for DISPLAY tolook at the currently flaggedrecords.  If there aren't any, goback to the FIND menu and RESET theflags.  When you press D forXXXDISPLAY, the computer displays thefirst flagged record.  If the recordis long enough to go outside thewindow space allotted, the programasks you to press [RETURN].  Then itclears the window and continuesdisplaying the record.   After the record is displayed,you can press: [U] to unflag thatrecord and display the next; [M]returns you to the MAIN menu; or anyother key (including [RETURN]) todisplay the next flagged record.  Sobefore printing a set of records,you can preview and unflag any youdon't want printed.   Pressing [P] brings you to theXXXPRINT routine.  When asked where youwant output directed, enter afilename -- or simply press [RETURN]to direct output to the printer.You're then asked a repetitiveseries of questions about whichfield you want printed, where, andhow many characters per field.   If you want the whole fieldprinted, typing a number greaterthan 255 guarantees the entirefield.  (There is a limit of 255characters per field, however.)   In our example, you may want thefirst and last names on the sameline, the address on the next line,the city, state and ZIP code on theXXXthird line, and the phone numberignored.   To accomplish this, enter 2 forthe first field to be displayed, 1for the column and 1 for the row.(Press [RETURN] after each entry).This prints the first name first.   To add the last name to the sameline, enter 1 for the field, 12 forthe column and 1 for the row.  Theaddress can be indented by using 5for the column, but remember thisshould now be row 2.  Row 3 wouldcontain the city, state and ZIP,using starting columns of 5, 20 and25, respectively.XXX   Although entering the positionsand lengths for all of the fieldscan be tedious, it gives you a greatdeal of flexibility.  To end yourlist, type 0 for the field number.You'll be prompted to check youroutput device, then press a key tostart printing.  If you want extralines between records, the easiestway is to have the lines at the top.SORTING A DATABASE   The SORT option lets you arrangeand rearrange your data to suit yourcurrent needs.  After choosing thisoption, you're asked for the fieldXXXon which to base the, then whetheryou want the sort in ascending ordescending order.   In our example, it would makesense to sort by last name whenprinting out the address book or ifmaking up a set of nametags, but ifyou are bulk-mailing newslettersfrom the same list, these must beorganized by ZIP code.  So, to sortby last name you'd enter 1 for thefield and then A for an ascending(alphabetical) sort.  To sort by ZIPcode, enter 6 for the field and A orD for the order of the sort.   You can also sort your databaseon more than one field, withXXXdifferent fields having priority.For example, to sort names in strictalphabetical order, sort thedatabase first on the first names,THEN by last name.  The most recentsort will take priority.   NOTE: upon exiting the programthe order of the data returns to theoriginal.  To make the sortpermanent, use the COPY databasefunction.   Another important point is thatONLY FLAGGED RECORDS ARE SORTED.This lets you sort only certainrecords in the database, but be sureif you want the ENTIRE databasesorted to RESET the flags throughXXXthe FIND option.   One last point regarding thesorting routines.  Fields are sortedby the ATASCII values of thecharacters.  Therefore, numbers comebefore the letters, uppercase comesbefore lowercase, and spaces comebefore everything.  For numbers tobe sorted properly, make surethey're right- justified within thefield.   The only complication here isthat the first character of thefirst field of any record cannot bea space.  Therefore, don't use afield that's likely to contain anumber as the first field in aXXXrecord.DELETE RECORDS   This is easy.  Simply flag therecords using the SEARCH functionand press [D] at the MAIN menu.When the program asks if you reallywant these records eliminated, press[Y] if that's what you want.  Ifnot, press [N].   NOTE: the space occupied bydeleted records is NOT freed up forfurther entry.  To clean up adatabase after deleting records,using the COPY database function.UPDATING RECORDSXXX   To change the data within afield, press [U] on the MAIN menu.The program then cycles through theflagged records, displaying thefirst field of each.   You are asked whether that recordrequires updating.  Because onlyflagged records are displayed, youdon't have to go through the entiredatabase looking for the record toupdate; you can select the recordswith FIND and the update only theones you wish.   If you press [Y] at the promptfor updating the displayed record,the program lists each field inXXXorder.  You can make changes to thefield, and pressing [RETURN]re-enters the field.  If you don'twant to make changes, press [RETURN]to proceed to the next field.  Afterthe record has been updated theprogram then continues to list thefirst field of each flagged record.MATH   The program can perform a numberof mathematical functions.  Bypressing [M] at the MAIN menu andthen entering an appropriate fieldnumber, a series of values aredisplayed onscreen: the sum of thefield, the average of the field, thesum of the flagged records in theXXXfield, the average of the flaggedrecords in the field, the percentageof records flagged, and thepercentage of the VALUES of theflagged records as a fraction of thetotal.   Thus it's easy to flag a group ofrecords to see whether that groupcontributes proportionately to thetotals (for example, a business canhave multiple divisions or areasthat contribute to the profit).   Non-numerical values are excludedfrom consideration.  If a resultwould cause an error (for example,if no records are flagged, or thecalculation of flagged records wouldXXXinvolve dividing by zero) the resultis skipped.COPY   This utility lets you copy all orpart of a database.  It also letsyou clean up a database that hasbeen cluttered by deleted records.   After pressing [C] at the MAINmenu, you are asked for the outputfile.  Type the complete filename.Next, you're asked if you want theentire database copied or just theflagged records.  Either way, thedata will be written out to the newfile in the order of the currentsort.XXX   If you choose to copy the entiredatabase, it will remain the samesize, but deleted records will becleared out, making more room foradditions.  If you choose to copyjust the flagged records, the newdatabase will only be as long as thenumber of flagged records.  To addmore records to the database, usethe XTEND option from the MAIN menu.EXTENDING A DATABASE   In case you've underestimated thenumber of records you needed in adatabase, this option lets youextend it (keeping in mind the 2,000total field limit).  After choosingXXXthis option from the MAIN menu, youare asked how many records you wantto add.  (Keep in mind that wheneveryou extend the database you wastesome disk space.)  This optionreverses any sorting you had done,so be sure to use the COPY functionto save your sorted database beforeusing this option.EXIT   This option closes the databaseproperly and returns you to theFILES menu so you can work onanother file.