═══ 1. RexxBase The dBase Database For Rexx ═══ RexxBase and "The dBase Database for Rexx" are trademarks of American Coders, LTD. OS/2 is a registered trademark of the International Business Machines Corporation. dBase and dBase III are trademarks of Borland Corporation. Other trademarks are the trademarks of their respective trademark owners. Contacts: American Coders, LTD. Post Office Box 97462 Raleigh, NC 27624 (919) 846-2014 CompuServe ID: 74150,2370 Internet(USENET) ID: joe@usacoder.rtp.nc.us Sept 1994 Edition. Version 1.33. Copyright 1993-94 American Coders LTD Raleigh NC USA ═══ 1.1. Rights and Limitations ═══ American Coders, LTD makes no warranties as to the information in this guide. Additionally, American Coders Ltd is not responsible or liable for any loss or damage of any kind resulting from use of this product. The Software is protected by the copyright laws of the United States of America, as well as by the copyright laws of many other countries pursuant to international treaties. All rights reserved. No part of the RexxBase computer program, documentation or related files may be reproduced photocopied, stored on a retrieval system, or transmitted except as provided by U. S. copyright law. ═══ 1.2. System Overview. ═══ RexxBase is a REXX external function DLL to be used by your command files to access dBase files. RexxBase offers database access functions to Rexx command procedures. By using the RexxBase functions, Rexx programs gain access to tens of thousands of database files written, primarily, for the PC/MS Dos environment. RexxBase generates dBase field names and values that are available directly to a Rexx program. The Rexx program can change this data and update dBase files directly. Also database file control information is available to the Rexx program. This information includes such data as last date the database was updated, number of records on file, field names, etc. RexxBase is distributed using the Shareware system. Every shareware copy of the program comes with a 30 day trial offer. If after 30 days the user finds the RexxBase product acceptible they are expected to register and pay $95.00 plus shipping/handling/taxes. Registered users of the product receive a free upgrade to the current release, 90 days free support on CompuServe and 30 days free telephone support. The product is being marketed through the shareware distribution method to determine market demands of the product and future needs and enhancements. If the product proves to be marketable, meaning more than 100 units are registered within any 30 day period, then the product will be sold and distributed through retail channels. ═══ 1.3. How To Register Your Copy ═══ We have several methods for you to register your copy of RexxBase. o Registration Form. o Faxing or 800 Number and Credit Cards. o Immediate BBS Download via Credit Card. o CompuServe SWREG. There is also a shipping and handling charge. For U.S. and Canada registrations it is $10.00. Fo all other international orders $15.00. If you are planning to order ten (10) or more copies use the SITELICE.DOC in your package. ═══ 1.3.1. Registration Form. ═══ Print out the file REGISTER.FRM. Attach a check and mail to us using the address on the form (or see above). ═══ 1.3.2. 800 Number and Credit Cards. ═══ American Coders is using the services of PsL "Public (software) Library". They provide a service for all shareware authors, for a small fee they will take credit card orders through their 800 number and Fax. Once PsL has notified us of your order, we will ship it within two days. PsL does NOT handle question or inquiries. RexxBase Psl item/product number is 11174. CREDIT CARD ORDERS ONLY - You can order with MC, Visa, Amex, or Discover from Public (software) Library by calling 800-2424-PsL or 713-524-6394 or by FAX to 713-524-6398 or by CIS Email to 71355,470. You can also mail credit card orders to PsL at P.O.Box 35705, Houston, TX 77235-5705. THE ABOVE NUMBERS ARE FOR ORDERS ONLY. Any questions about the status of the shipment of the order, refunds, registration options, product details, technical support, volume discounts, dealer pricing, site licenses, etc, must be directed to 919-846-2014 or write American Coders at our address. To insure that you get the latest version, PsL will notify you the day of your order and we will ship the product directly to you. ═══ 1.3.3. Another Credit Card Method And Faster Too. ═══ Peter Norloff's OS2SHAREWARE Bulletin Board will allow you to register. OS2SHAREWARE accepts MC/Visa orders. Once the order has been placed you immediately receive your copy of the register package. While this copy may be the fully registered version, you'll want to let us know you are out there. Inside the package there is a I AM REGISTERED form. Fill it out and mail to us. This will guarantee you receive the free upgrade you're due. Call (In VA. USA) 1-703-385-4325. Follow the directions from the main menu for Registering shareware. ═══ 1.3.4. CompuServe SWREG. ═══ CompuServe offers a service to register shareware software. GO SWREG and follow the directions. RexxBase SWREG number is 1953. Charges are billed to your CompuServe account. Any questions about the status of the shipment of the order, refunds, registration options, product details, technical support, volume discounts, dealer pricing, site licenses, etc, must be directed to 919-846-2014 or write American Coders at our address. ═══ 1.4. Version and Requirements. ═══ Version 1.34 RexxBase runs under o OS/2 2.0 or higher o requires a minimum of 6 megabytes of RAM. o requires 500k of disk space. ═══ 1.5. Version History. ═══ The following is a basic history of changes for each version and release. ═══ 1.5.1. Version 1.34 Sept 1994 (Bug fix) ═══ Reindex didn't reindex the first index file in the open list. ═══ 1.5.2. Version 1.33 Aug 1994 (Bug fix). ═══ Minor changes to indexing routines. ═══ 1.5.3. Version 1.32 July 12, 1994 (Bug fix) ═══ Character Fields were stored right justified. ═══ 1.5.4. Version 1.31 June 23, 1994 (Bug fix) ═══ Memo Fields were not updated in DBT file correctly. Write, Update, and Pack routines would only process first memo field of a record. Improved Pack function. Recompiled with C Set++ Version 2.1 compiler. ═══ 1.5.5. Version 1.30 May 27, 1994 ═══ Major enhancement that will change the way you use MEMO fields in RexxBase. Each MEMO field is now stored as a single REXX variables. The previous versions of RexxBase stored MEMO fields in a stem variable (array-like) structure. Added logic to update index pointers when RexxBase_GotoRecord function used TOP or BOTTOM options. RexxBase_FindRecord is used against a database with no records created a system error SYS3175. RexxBase_SortDBF added an extra byte to header. Data fields off by 1. Added a new functions to registered version: Rexxbase_ChangePrimaryIndex, used to reset the Primary index to one of the predefined secondary indexes. Rexxbase_SummarizeDBF function. This sorts and summarizes a database file on all of the sort fields. Summary is on all of the numeric fields in the database. It also adds two fields SUMMARYCNT and SUMMARYFLD to the sorted file. Rexxbase_Soundex function. This is the ubiquitous SOUNDEX fucntions that will return a four byte string based on a string passed to it. ═══ 1.5.6. Version 1.23 Mar 15, 1994 ═══ Forgot to define Rexxbase_ShutDown for LINKER in shareware.DEF file. Caused function not found condition. Forgot to define Rexxbase_ShutDown, Rexxbase_FilterDBF, Rexxbase_ScanForRecord and Rexxbase_JoinDBF for LINKER in registered .DEF file. Caused function not found condition. When opened with an index, if ReadDBF done first, function returned second record in index. Sort routine checked Join connection too soon. No sorts would work. Delete and Undelete functions were creating index records. An invalid value for not-delete in the delete indicator. Corrected error in CreateDBF function. NUM FIELDS with DECIMAL POSITIONS were rejected. Corrected error in field truncation. NUM fields with sizes > 9 and no DECIMAL POSITIONS were limited to about 2 billion. Any field with lengths greater than 9 were truncated to values lessr than 2B. Still some rounding errors for fields with sizes greater 17 and with decimal positions. This may be a limitation of REXX because the numbers store correctly in the DBF. ═══ 1.5.7. Version 1.22 Mar. 1, 1994 ═══ Prevented Rexxbase_UpdateDBF from executing when the record pointer is at TOF or BOF. Corrected Rexxbase_CloseDBF function. The database name passed was not being freed from the list. Added new function to shareware version: o Rexxbase_ShutDown. Added new functions to registered version: o Rexxbase_FilterDBF o Rexxbase_ScanForRecord o Rexxbase_JoinDBF Added new control variable Rexxbase.UpdateHeaderCounter and logic that updates the dbase header record based on the counter. Added the option TOP to the Rexxbase_GotoRecord function. Added the option BOT or BOTTOM to Rexxbase_GotoRecord function. ═══ 1.5.8. Version 1.21 Feb. 15, 1994 ═══ FindRecord parameter 3 was misspelled. Added Create Index function to get field names in a quoted string. Indexing control variable too small, limitted record counts to < 128. Problem when passing an empty string i.e. RexxBase_FindRecord('dbf','') REXXBASE.RECORDNUMBER was misspelled in DLL. Rexxbase_ReadPrev would go back two records. Rexxbase_GotoRecord abended when run right after Rexxbase_CreateIndex ═══ 1.5.9. Version 1.20 Jan. 31. 1994 ═══ Added the EXACT option to the Rexxbase_FindRecord function. For shareware distributed version, can open up to DBF's five(5) at a time and up to 2(two) indexes. Added date routines to registered version: o Rexxbase_FormatDate o Rexxbase_InternalDate o Rexxbase_DaysDifference o Rexxbase_DateCalc. Added import/export file functions to registered version. o Rexxbase_ExportDBF o Rexxbase_ImportDBF ═══ 1.5.10. Version 1.18 Final Beta Jan 20, 1994 ═══ Bug fixes. ═══ 1.5.11. Version 1.17 Beta Jan 10, 1994 ═══ Added record locking with the following functions: o Rexxbase_ReadAndLockDBF o Rexxbase_ReadAndLockPrevDBF o Rexxbase_UnlockDBF o Rexxbase_SetLockTimeout Corrected bug that did not allow mulitple database processing. Corrected numeric key field length - was too small. Added logic to prevent creating keys greater than 100 bytes. Updated documentation. ═══ 1.5.12. Version 1.16 Beta Jan 3, 1994 ═══ Correct field alignment in dbf file. You will have to recreate your files due to this error. Logical fields not stored correctly. Removed zero padding from numeric fields. Numeric fields not stored correctly (i.e. NUM 4.2 could store 10.5 when 0.50 is the correct value). ═══ 1.5.13. Version 1.15 Beta Dec 22, 1993 ═══ Last update field not set correctly, mainly effected create functions. Invalid date field should be set to spaces not zeroes. Corrected errors in updating numeric fields Corrected record alignment Corrected documentation. ═══ 1.5.14. Version 1.14 Beta Dec 15, 1993. ═══ Numeric fields not stored in correctly. Corrected documentation. ═══ 1.5.15. Version 1.13 Beta Dec 7, 1993. ═══ Not released. Bug fixes to indexes. ═══ 1.5.16. Version 1.12 Beta Dec 1, 1993. ═══ Corrected CreateDBF and CreateFromDBF functions, database names were not being added to (internal) active database list. Index files - date field WAS being created floating point like dBase iii. Now it's character. Index files - failed to allow mismatch field types. Corrected documentation. ═══ 1.5.17. Version 1.11 Beta Nov. 22, 1993. ═══ Added national language support date function. Corrected CreateDBF and CreateFromDBF functions. Corrected documentation. ═══ 1.5.18. Version 1.10 Beta Nov. 15, 1993 ═══ Multi file access Index access and other functions Create functions Modify structures Improved Initialization Routine Improved error reporting Improved documentation ═══ 1.5.19. Version 1.02 Alpha Oct. 15, 1993 ═══ Bug fix. ═══ 1.5.20. Version 1.01 Alpha Sep 1, 1993 ═══ Initial release. ═══ 1.6. American Coders Ltd. ═══ American Coders, LTD. Post Office Box 97462 Raleigh, NC 27624 (919) 846-2014 CompuServe ID: 74150,2370 Programming Solutions For Your Business ═══ 1.7. How To Install ═══ The program does not have an automatic installation routine. You will have to unzip the files into any existing directory. Make sure to have the DLL located in a directory that is specified in your systems LIBPATH. ═══ 2. RexxBase File Structures. ═══ Every attempt has been made to keep the RexxBase DBF, DBT and NDX files similar. But due to the inherent differences between DOS, OS2, REXX and PRG files we could not keep the contents of a NDX file similar. ═══ 2.1. File Naming. ═══ RexxBase does not use default file extensions. This due to the inherent nature of HPFS files with its flexible file names. When opening and creating files be sure to use a fully qualified name. ═══ 2.2. Database (DBF) File. ═══ There should be no difference between RexxBase DBF files and other xBase DBF. If you feel that you found an inconsistency with RexxBase DBF files, please notify us immediately. ═══ 2.3. Memo (DBT) File. ═══ THIS IS A MAJOR CHANGE FROM OLDER VERSIONS OF REXXBASE. DBT files used to store MEMO field data, look like regular variables to Rexx. With our testing, we have stored fields up to 262144 bytes in length. The theoritical limit is 2^32 - 1. Please refer to the Memo section for more information. ═══ 2.4. Index (NDX) File Field Differences. ═══ The ability to use index files is an integral part of any good database system. We have introduced, what we feel, is an improved, yet limited, form of file structures to RexxBase. ┌──────────┬─────────────────────────────────────────────┐ │Difference│Description │ ├──────────┼─────────────────────────────────────────────┤ │Simple │RexxBase does not use xBase functions within │ │Data Types│index functions. Nor does it use inverse │ │ │definitions, i.e. using a minus sign to move│ │ │in a reverse key scan. │ ├──────────┼─────────────────────────────────────────────┤ │Mixing │RexxBase allows the mixing of Character, │ │Data Types│Numeric and Date data types. All data in │ │ │this format are treated as Character by │ │ │RexxBase. │ ├──────────┼─────────────────────────────────────────────┤ │Date Data │Date data types are treated as Character data│ │Types │and stored in the index in the native format.│ │ │Date data types can be concatenated together │ │ │with other data types. Some xBase products │ │ │store date in the index in a floating point │ │ │format. By removing the floating point │ │ │format you should see a improvement in index │ │ │file accessing for data types. │ ├──────────┼─────────────────────────────────────────────┤ │Numeric │Numeric data types are stored in a floating │ │Data Types│point format. When a key is defined as │ │ │numeric all of the fields are summed │ │ │together. │ ├──────────┼─────────────────────────────────────────────┤ │Accessing │The only time you may access NDX files from │ │xBase NDX │other xBase programs is if the dBase index │ │files. │file is strictly Character or Numeric fields │ │ │ONLY. Indexes using xBase functions are not │ │ │supported by RexxBase. │ └──────────┴─────────────────────────────────────────────┘ See also Rexxbase.Unique. ═══ 3. How Initialize REXX For RexxBase Functions. ═══ Before calling any RexxBase functions your REXX command file must register the RexxBase DLL. To do this use the REXX command RXFUNCADD. You need to register only one RexxBase function - Rexxbase_Init. Rexxbase_Init, when called, will register all of the other RexxBase routines. Since Rexxbase_Init cannot register itself, your Rexx program must register it. Use RXFUNCADD to register the Rexxbase_Init function. Once registered, RexxBase will not have to be registered until the next time you restart OS/2. If you want your REXX program can register the RexxBase functions. The format of the command is RXFUNCADD(function, dll, procedure) function is the name of the RexxBase routine as your procedure will call it. dll is the name of the RexxBase DLL file. (Unless you rename it, it will always be REXXBASE). procedure is the name of the function internal to the RexxBase DLL. Your program should contain the following: /* REXX */ ret = rxfuncadd(rexxbase_init,Rexxbase,"Rexxbase_Init") ret = rexxbase_init() ═══ 3.1. Example of Dropping a RexxBase Function. ═══ When your procedure is done with the RexxBase functions it can drop the RexxBase functions. This may help reduce memory requirements and free up system resources. Once dropped, a function will have to be re-registered if it is to be used again. rxfuncdrop(rexxbase_opendbf,Rexxbase,"Rexxbase_OpenDBF") Return codes most likely to be returned are: o 0 - ok. o 40 - function not found. For more information about return codes from Rexx, refer to the IBM documentation. ═══ 4. The RexxBase Functions. ═══ This release of RexxBase offers several functions to read, write and update your database records. Also available are functions to create database, modify database structures and to sort databases. ═══ 4.1. Rexxbase_OpenDBF. ═══ Description. Prior to processing a database file, the file must be opened. When your procedure opens the database file several activities occur. o The database file is opened. o RexxBase creates database related stem variable concerning system and file status. o RexxBase creates a stem variable containing field names, types and sizes. o If indexes are specified then these files are opened. Purpose. To open the database for processing. Format. rexxbase_opendbf("dbfname"[,index1[,index2[,...]]]) Parameters. dbfname The REXX variable contains the name of your database as it is known to the operating system. index1 The master index file name as it is known to the operating system. Unlike the dbfname, which is the REXX Variable name passed within quotes. The index file name is the OS/2 filename. You can use a REXX variable to pass the name, just don't put it in quotes. THIS IS AN OPTIONAL PARAMETER. index2 ... The alternative index file names as they are known to the operating system. Like the master index file name, they are the OS/2 filenames. You can use a REXX variable to pass the name, just don't put it in quotes. THIS IS AN OPTIONAL PARAMETER. You must set the database name in the variable prior to use. And you must pass the variable name in a string. For example. myfilename = 'c:\xbase\machines.dbf' ret = rexxbase_opendbf('myfilename') Return Value Description "". Normal No Rexx DBF Name specified The first parameter of function call is missing. Bad Variable Name The variable name passed to the routine is not a valid REXX Name No File Name Assigned To Variable. The variable was not assigned a value. Database Name Already In Use. The name passed is already assigned to another opened database. Can't open. Operating System error. File and system errors are written to the console, printer or rexxbase.error stem variable. Can't open index, Database File opened. The RexxBase could not open any one of the index files specified. Depending on which file failed, any index files specified after it will not be opened. For multi-user access refer to the following RexxBase variable: o Rexxbase.Read o Rexxbase.Write o Rexxbase.Share Sample Without An Index File /* REXX */ dbf = c:\users\net.dbf ret = rexxbase_opendbf('dbf') if ret \= '' then do say ret exit end Sample With An Index File /* REXX */ dbf = c:\users\net.dbf ret = rexxbase_opendbf('dbf',c:\users\net.ndx) if ret \= '' then do say ret exit end ═══ 4.2. Rexxbase_CloseDBF. ═══ Description. When your procedure is done using the database file it should be closed. This allows your program to update the file correctly. Purpose. To close the database. Format. rexxbase_closedbf("dbfname") Parameters. dbfname The REXX variable contains the name of your database as you defined it in the Rexxbase_OpenDBF function. The name of the database is defined in a REXX variable. You must pass the variable name in a string. For example. myfilename = 'c:\xbase\machines.dbf' ret = rexxbase_closedbf('myfilename') Return Value Description "". Normal No Rexx DBF Name specified The first parameter of function call is missing. Unknown Database Name. The name found, in the passed parameter, is not the same used to open a database. Sample. /* REXX */ dbf = c:\users\net.dbf ret = rexxbase_opendbf('dbf') if ret \= '' then do say ret exit end ret = rexxbase_closedbf('dbf') if ret\= '' then do say ret exit end say the number of dbf record(s) are dbf.recordcount ═══ 4.3. Rexxbase_CloseAllDBF. ═══ Description. When your procedure is done using all of the database files they should be closed. This allows your program to update the files correctly. Purpose. To close all opened databases. Format. rexxbase_closealldbf() Parameters. N/A N/A The function does not use any parameters. For example, rexxbase_closealldbf() Return Value Description "". Normal Even though there are no other return values. The internal processing errors may be found in the rexxbase.error stem variable. Sample. /* REXX */ dbf = c:\users\net.dbf ret = rexxbase_opendbf('dbf') if ret \= '' then do say ret exit end dbf2 = c:\users\addr.dbf ret = rexxbase_opendbf('dbf2',addr.ndx) if ret \= '' then do say ret exit end ret = rexxbase_closealldbf) if ret \='' then do say ret exit end ═══ 4.4. Rexxbase_ReadDBF. ═══ Description. Read the database fields into the REXX variables. This commands reads the next record in the file. Purpose. To read the next sequential record in the database. If the database was opened with an index, then the next record in the index list is read. Format. rexxbase_readdbf("dbfname") Parameters. dbfname The REXX variable contains the name of your database as you defined it in the Rexxbase_OpenDBF function. The name of the database is defined in a REXX variable. You must pass the variable name in a string. For example. /* rexx */ myfilename = 'c:\xbase\machines.dbf' rexxbase_readdbf('myfilename') Return Value Description "". Normal No Rexx DBF Name specified The first parameter of function call is missing. BOF. End of file condition. No record is read. Record field values remain unchanged. Unknown Database Name. The name found in the passed parameter is not the same used to open the database. Unable to read file rc = XX. Record area could not be read. Where XX is a return code from OS/2. If XX is equal to 5 then the operating system is denying access to that area. If XX is equal to 33 then the record area has been locked. For other values you can type on the command line "HELP XX" to find the values for XX. Sample. /* REXX */ dbf = c:\users\net.dbf ret = rexxbase_opendbf('dbf') if ret \= '' then do say ret exit end ret = rexxbase_readdbf('dbf') if ret = BOF then do say end of file reached end ═══ 4.5. Rexxbase_ReadAndLockDBF. ═══ Description. Read the database fields into the REXX variables and prevent other functions within OS/2 from accessing these fields. This commands reads the next record in the file. Contrary to its name the record area is locked first and then read. The record area is unlocked by executing one of four functions: o updating the record with a Rexxbase_UpdateDBF o reading and locking with another Rexxbase_ReadAndLockDBF o reading and locking with a Rexxbase_ReadAndLockPrevDBF o unlocking with a Rexxbase_UnlockDBF. If left open, the record area is unlocked when the RexxBase DLL is dropped. Purpose. To gain sole access to the next sequential record in the database. If the database was opened with an index, then the next record in the index list is read. Format. rexxbase_readandlockdbf("dbfname") Parameters. dbfname The REXX variable contains the name of your database as you defined it in the Rexxbase_OpenDBF function. The name of the database is defined in a REXX variable. You must pass the variable name in a string. For example. /* rexx */ myfilename = 'c:\xbase\machines.dbf' rexxbase_readandlockdbf('myfilename') Return Value Description "". Normal No Rexx DBF Name specified The first parameter of function call is missing. Unable to lock record area. Record area is already locked by another process. BOF. End of file condition. No record is read. Record field values remain unchanged. Unknown Database Name. The name found in the passed parameter is not the same used to open the database. Sample. /* REXX */ dbf = c:\users\net.dbf ret = rexxbase_opendbf('dbf') if ret \= '' then do say ret exit end ret = rexxbase_readandlockdbf('dbf') if ret <> "" then do say record area already locked end else do dbf.time = time() rc = rexxbase_updatedbf('dbf') end rc = rexxbase_closedbf('dbf') ═══ 4.6. Rexxbase_UnlockDBF. ═══ Description. The command will unlock a record locked by a Rexxbase_ReadAndLockDBF or Rexxbase_ReadAndLockPrevDBF command. Purpose. To unlock a locked record in the database. Format. Rexxbase_UnlockDBF("dbfname") Parameters. dbfname The REXX variable contains the name of your database as you defined it in the Rexxbase_OpenDBF function. The name of the database is defined in a REXX variable. You must pass the variable name in a string. For example. /* rexx */ myfilename = 'c:\xbase\machines.dbf' rexxbase_unlock('myfilename') Return Value Description "". Normal No Rexx DBF Name specified The first parameter of function call is missing. Unknown Database Name. The name found in the passed parameter is not the same used to open the database. Sample. /* REXX */ d bf = c:\users\net.dbf ret = rexxbase_opendbf('dbf') if ret \= '' then do say ret exit end ret = rexxbase_readandlockdbf('dbf',dbf.recordcount) if dbf.date = date() then ret = rexxbase_unlockdbf('dbf') else do dbf.date = date() ret = rexxbase_updatedbf('dbf') end ret = rexxbase_closedbf('dbf') ═══ 4.7. Rexxbase_SetLockTimeout. ═══ Description. The command will set a lock timeout value, in milliseconds, for all record locking functions. Purpose. To allow a minimum amount time for testing record locks. The default value is zero. If an incorrect value is specified then the default is used. Format. rexxbase_setlocktimeout(timeinmillisec) Parameters. timeinmillisec Timeout limit in milliseconds. rexxbase_setlocktimeout(100) Return Value Description "". Normal No Lock Time Specified The only parameter to this function is the lock test timeout value. If none specified then the default value of zero will be used. Sample. /* REXX */ /* set locking time out test to 1000 milliseconds. */ ret = rexxbase_setlocktimeout(1000) ═══ 4.8. Rexxbase_GoToRecord. ═══ Description. The command will position at a specified record and read it. Purpose. To read a particular record in the database. Format. rexxbase_gotorecord("dbfname",recordnumber) Parameters. dbfname The REXX variable contains the name of your database as you defined it in the Rexxbase_OpenDBF function. recordnumber The record number to read, or the following words TOP - to go to the top of the database. BOT or BOTTOM - to go to the bottom of the database. The name of the database is defined in a REXX variable. You must pass the variable name in a string. For example. myfilename = 'c:\xbase\machines.dbf' rexxbase_gotorecord('myfilename',1) Return Value Description "". Normal No Rexx DBF Name specified The first parameter of function call is missing. No Record Number Specified. You did not pass a record number in the second argument. Unknown Database Name. The name found in the passed parameter is not the same used to open the database. Bad Record Number. You passed a record number that is invalid or is less than one. No record is read. BOF. You passed a record number that is greater than the number on the file or used the BOT or BOTTOM option. No record is read. Record field values remain unchanged. BOF is a good return code if you used the BOT or BOTTOM option. TOF. You used the TOP option in the record number field. This is a good return code. Sample. /* REXX */ /* assume the database has a field name AMOUNT. */ /* this example will get the last AMOUNT on file*/ dbf = c:\users\net.dbf ret = rexxbase_opendbf('dbf') if ret \= '' then do say ret exit end ret = rexxbase_gotorecord('dbf',dbf.recordcount) if ret = '' then say dbf.amount ret = rexxbase_closedbf('dbf') ═══ 4.9. Rexxbase_ReadPrevDBF. ═══ Description. Read the database fields into the REXX variables. This commands reads the previous record in the file. Purpose. To read the previous sequential record in the database. If the database was opened with an index, then the previous record in the index list is read. Format. rexxbase_readprevdbf("dbfname") Parameters. dbfname The REXX variable contains the name of your database as you defined it in the Rexxbase_OpenDBF function. The name of the database is defined in a REXX variable. You must pass the variable name in a string. For example. myfilename = 'c:\xbase\machines.dbf' rexxbase_readprevdbf('myfilename') Return Value Description "". Normal No Rexx DBF Name specified The first parameter of function call is missing. Unknown Database Name. The name found in the passed parameter is not the same used to open the database. Unable to read file rc = XX. Record area could not be read. Where XX is a return code from OS/2. If XX is equal to 5 then the operating system is denying access to that area. If XX is equal to 33 then the record area has been locked. For other values you can type on the command line "HELP XX" to find the values for XX. TOF. Top of file condition. No record is read. Record field values remain unchanged. Unknown Database Name. The name found in the passed parameter is not the same used to open the database. Sample. /* REXX Read the 10th and 9th records*/ dbf = c:\users\net.dbf ret = rexxbase_opendbf('dbf') if ret \= '' then do say ret exit end ret = rexxbase_gotorecord('dbf',10) ret = rexxbase_readprevdbf('dbf') ret = rexxbase_closedbf('dbf') ═══ 4.10. Rexxbase_ReadAndLockPrevDBF. ═══ Description. Read the database fields into the REXX variables and prevent other functions within OS/2 from accessing these fields. This commands reads the previous record in the file. Contrary to its name the record area is locked first and then read. The record area is unlocked by executing one of four functions: o updating the record with a Rexxbase_UpdateDBF o reading and locking with another Rexxbase_ReadAndLockDBF o reading and locking with a Rexxbase_ReadAndLockPrevDBF o unlocking with a Rexxbase_UnlockDBF. If left open, the record area is unlocked when the RexxBase DLL is dropped. If the database was opened with an index, then the previous record in the index list is read. Purpose. To gain sole access to the previous sequential record in the database. If the database was opened with an index, then the next record in the index list is read. Format. rexxbase_readandlockprevdbf("dbfname") Parameters. dbfname The REXX variable contains the name of your database as you defined it in the Rexxbase_OpenDBF function. The name of the database is defined in a REXX variable. You must pass the variable name in a string. For example. myfilename = 'c:\xbase\machines.dbf' rexxbase_readandlockprevdbf('myfilename') Return Value Description "". Normal No Rexx DBF Name specified The first parameter of function call is missing. Unable to read file rc = XX. Record area could not be read. Where XX is a return code from OS/2. If XX is equal to 5 then the operating system is denying access to that area. If XX is equal to 33 then the record area has been locked. For other values you can type on the command line "HELP XX" to find the values for XX. TOF. Top of file condition. No record is read. Record field values remain unchanged. Unknown Database Name. The name found in the passed parameter is not the same used to open the database. Sample. /* REXX Read the 10th and 9th records*/ dbf = c:\users\net.dbf ret = rexxbase_opendbf('dbf') if ret \= '' then do say ret exit end ret = rexxbase_gotorecord('dbf',10) ret = rexxbase_readprevdbf('dbf') ret = rexxbase_closedbf('dbf') ═══ 4.11. Rexxbase_FindRecord. ═══ Description. The command will position at a specified record using the master index file. Purpose. To read a particular record in the database using the index file. Format. rexxbase_findrecord("dbfname","string",[EXACT]) Parameters. dbfname The REXX variable contains the name of your database as you defined it in the Rexxbase_OpenDBF function. string The index key string used for searching. EXACT Optional indicator to tell RexxBase to find the exact 'string' in the index. This would cause a Hard Find. If not specified then RexxBase would execute a Soft Find. The name of the database is defined in a REXX variable. You must pass the variable name in a string. For example. myfilename = 'c:\xbase\machines.dbf' ret = rexxbase_findrecord('myfilename',"LASER 11") Return Value Description "". Normal No REXX DBF Name No argument was passed to the routine. No Locate String Specified Second parameter of function is missing. Unknown Database Name. The name found in the passed parameter is not the same used to open the database. Index file not opened When the database was opened, no index files were specified. Record Not Found (when EXACT is specified) You passed a string that is not on the master index. No record is read. Record Not Found (when EXACT is not specified) The string entered is higher than any on the index. Sample. /* REXX */ /* this example copies the first record of the database to the end */ dbf = c:\users\net.dbf ndx = 'c:\xbase\net.ndx' ret = rexxbase_opendbf('dbf',ndx) if ret \= '' then do say ret exit end ret = rexxbase_findrecord('dbf',"USA001') if ret \= '' then do say find failed with ret exit end say Network Disposition For USA001 is dbf.dispo ret = rexxbase_closedbf('dbf') if ret \ = '' then do say close failed with ret exit end ═══ 4.12. Rexxbase_WriteDBF. ═══ Description. This will add a new record to the end of the database. Purpose. To add records to the database. Format. rexxbase_writedbf("dbfname") Parameters. dbfname The REXX variable contains the name of your database as you defined it in the Rexxbase_OpenDBF function. The name of the database is defined in a REXX variable. You must pass the variable name in a string. For example. /* */ myfilename = 'c:\xbase\machines.dbf' ret = rexxbase_opendbf('myfilename') rexxbase_writedbf('myfilename') ret = rexxbase_closedbf('myfilename') Return Value Description "". Normal No Rexx DBF Name specified The first parameter of function call is missing. Unknown Database Name. The name found in the passed parameter is not the same used to open the database. Sample. /* REXX */ /* this example copies the first record of the database to the end */ dbf = c:\users\net.dbf ret = rexxbase_opendbf('dbf') if ret \= '' then do say ret exit end ret = rexxbase_readdbf('dbf') if ret \= '' then do say read failed with ret exit end ret = rexxbase_writedbf('dbf') if ret \ = '' then do say write failed with ret exit end ret = rexxbase_closedbf('dbf') if ret \ = '' then do say close failed with ret exit end ═══ 4.13. Rexxbase_UpdateDBF. ═══ Description. This function will rewrite data at the current record position. Purpose. To update a record. Format. rexxbase_updatedbf("dbfname") Parameters. dbfname The REXX variable contains the name of your database as you defined it in the Rexxbase_OpenDBF function. The name of the database is defined in a REXX variable. You must pass the variable name in a string. For example. myfilename = 'c:\xbase\machines.dbf' ret = rexxbase_updatedbf('myfilename') Return Value Description "". Normal No Rexx DBF Name specified The first parameter of function call is missing. Unknown Database Name. The name found in the passed parameter is not the same used to open the database. "Invalid Record Position" The current record pointer is either at TOF or BOF. It is not pointing to any particular record. Sample. /* REXX */ /* this example update the field AMOUNT on the first record of the database*/ dbf = c:\users\net.dbf ret = rexxbase_opendbf('dbf') if ret \= '' then do say ret exit end ret = rexxbase_readdbf('dbf') if ret \= '' then do say read failed with ret exit end dbf.AMOUNT = dbf.AMOUNT * 2 ret = rexxbase_updatedbf('dbf') if ret \ = '' then do say update failed with ret exit end ret = rexxbase_closedbf('dbf') if ret \ = '' then do say close failed with ret exit end ═══ 4.14. Rexxbase_PackDBF. ═══ Description. This function removes logically deleted records from the database. Purpose. To remove deleted records. If the file has been opened with indexes, then the index will be rebuilt. If the database has associated index files and they are not opened during the packing process the indexes will be incorrect. Format. rexxbase_packdbf("dbfname") Parameters. dbfname The REXX variable contains the name of your database as you defined it in the Rexxbase_OpenDBF function. The name of the database is defined in a REXX variable. You must pass the variable name in a string. For example. myfilename = 'c:\xbase\machines.dbf' ret = rexxbase_packdbf('myfilename') Return Value Description "". Normal No REXX DBF Name No argument was passed to the routine. Unknown Database Name. The name found in the passed parameter is not the same used to open the database. Sample. /* REXX */ dbf = c:\users\net.dbf ret = rexxbase_opendbf('dbf') if ret \= "" then do say ret exit end ret = rexxbase_packdbf('dbf') ═══ 4.15. Rexxbase_SortDBF ═══ Description. This will sort a database file by fields names and create a new database file. Prior to calling the RexxBase Sort function you must specify the sort fields and the sort order for each field. You do this by creating field names using the database variable name concatenated with the SORTFIELD string. ┌──────────┬───────────────┬───────────────┬───────────────┬──────────┐ │Sort Field│*.SORTFIELD.0 │The number of │ │ │ │Count │ │fields to be │ │ │ │ │ │used for sort │ │ │ │ │ │criteria. │ │ │ ├──────────┼───────────────┼───────────────┼───────────────┼──────────┤ │Sort Field│*.SORTFIELD.1 │The primary │*.SORTTYPE.1 │Use a │ │Name 1 │ │sort field. │ │value of │ │ │ │ │ │"-" (minus│ │ │ │ │ │sign) to │ │ │ │ │ │sort this │ │ │ │ │ │field in │ │ │ │ │ │descending│ │ │ │ │ │order. │ │ │ │ │ │Any other │ │ │ │ │ │value will│ │ │ │ │ │sort the │ │ │ │ │ │field in │ │ │ │ │ │ascending │ │ │ │ │ │order. │ ├──────────┼───────────────┼───────────────┼───────────────┼──────────┤ │... │... │ │ │ │ ├──────────┼───────────────┼───────────────┼───────────────┼──────────┤ │Sort Field│*.SORTFIELD.n │The last sort │ │ │ │n │ │field in │ │ │ │ │ │priority. The │ │ │ │ │ │value of n │ │ │ │ │ │should be equal│ │ │ │ │ │to the value │ │ │ │ │ │specified in │ │ │ │ │ │dbname.SORTFIEL│ │ │ └──────────┴───────────────┴───────────────┴───────────────┴──────────┘ Purpose. To sort a database. Format. rexxbase_sortdbf("dbfname",sortfilename) Parameters. dbfname The REXX variable contains the name of your database as you defined it in the Rexxbase_OpenDBF function. sortfilename The sorted output file name as it will be known to the operating system. The name of the database is defined in a REXX variable. You must pass the variable name in a string. For example. myfilename = 'c:\xbase\machines.dbf' ret = rexxbase_sortdbf('myfilename','c:\xbase\machsort.dbf') Return Value Description "". Normal No Rexx DBF Name specified The first parameter of function call is missing. No Sort DBF Name specified The second parameter of function call is missing. Unknown Database Name. The name found in the passed parameter is not the same used to open the database. Sort Field Count Not Found The REXX variable containing the field count is missing. See *.SORTFIELD.0 above. Can't Find "fieldname" The field name used then the SORTFIELD stem variables is not part of this database. Not Enough Memory For Sorting RexxBase uses the ram and virtual ram space to perform the sort. The database to be sorted is too large for this process. Can't Open Sort DBF File. OS/2 returned a error code that indicates some type of error has occurred while opening the output database. Can't Write To Sort DBF File. OS/2 returned a error code that indicates some type of error has occurred while writing the output database. Unable To Write Fields To File. OS/2 returned a error code that indicates some type of error has occurred while writing the output database. Unable To Read File. The database to be sorted has an error. Sample. /* REXX */ /* sort on field name location (descending)*/ dbf = c:\users\net.dbf ret = rexxbase_opendbf('dbf') if ret \= '' then do say ret exit end dbf.sortfield.0 = 1 dbf.sortfield.1 = location dbf.sorttype.1 = '-' ret = rexxbase_sortdbf('dbf',c:\users\sortloc.dbf) NOTE: MEMO fields for the original file are valid with the SORTED file. BUT these MEMO fields can be corrupted with either file changes or adds a MEMO field. THEREFORE, if you want to use the DBT (MEMO file) with the sorted file, you should copy the DBT file using the SORTED file name. dbf = 'presort.dbf' call rexxbase_opendbf 'dbf' call rexxbase_sortdbf 'dbf' 'sorted.dbf' "COPY presort.dbt sorted.dbt" sdbf = 'sorted.dbf' call rexxbase_opendbf 'sdbf' ═══ 4.16. Rexxbase_DeleteRecord. ═══ Description. Marks the current record as deleted. Purpose. To logically delete a record. Format. rexxbase_deleterecord("dbfname") Parameters. dbfname The REXX variable contains the name of your database as you defined it in the Rexxbase_OpenDBF function. The name of the database is defined in a REXX variable. You must pass the variable name in a string. For example. ret = rexxbase_deleterecord('myfilename') Return Value Description "". Normal No Rexx DBF Name specified The first parameter of function call is missing. Unknown Database Name. The name found in the passed parameter is not the same used to open the database. No Record Read. The procedure must do a record read before deleting a record. Sample. /* REXX */ /*mark the last record on file as undeleted */ dbf = c:\users\net.dbf ret = rexxbase_opendbf('dbf') if ret \= '' then do say ret exit end ret = rexxbase_gotorecord('dbf',dbf.recordcount) if ret = '' then ret = rexxbase_deleterecord('dbf') ═══ 4.17. Rexxbase_UndeleteRecord. ═══ Description. Marks the current record as not deleted. Purpose. To logically undelete a record. Format. rexxbase_undeleterecord("dbfname") Parameters. dbfname The REXX variable contains the name of your database as you defined it in the Rexxbase_OpenDBF function. The name of the database is defined in a REXX variable. You must pass the variable name in a string. For example. rexxbase_undeleterecord('myfilename') Return Value Description "". Normal No Rexx DBF Name specified The first parameter of function call is missing. Unknown Database Name. The name found in the passed parameter is not the same used to open the database. No Record Read. The procedure must do a record read before undeleting a record. Sample. /* REXX */ /*mark the last record on file as not deleted */ dbf = c:\users\net.dbf ret = rexxbase_opendbf('dbf') if ret \= '' then do say ret exit end ret =rexxbase_gotorecord('dbf',dbf.recordcount) if ret = '' then ret = rexxbase_undeleterecord('dbf') ═══ 4.18. Rexxbase_CreateDBF ═══ Description. This will create a new database file. Prior to calling the RexxBase Create function you must specify the fields and the characteristics for each field. You do this by creating field names using the database variable name concatenated with the FIELD string. ┌──────────┬───────────────┬───────────────┬───────────────┬──────────┐ │Database │*.FIELDCOUNT │The number of │ │ │ │Field │ │fields to be │ │ │ │Count │ │used for │ │ │ │ │ │creating the │ │ │ │ │ │database. │ │ │ ├──────────┼───────────────┼───────────────┼───────────────┼──────────┤ │Field Name│*.FIELDNAME.1 │The first field│Any valid dBase│ │ │1 │ │name. │field name. │ │ ├──────────┼───────────────┼───────────────┼───────────────┼──────────┤ │*."field │The first field│Specify C for │ │ │ │name │type │character, L │ │ │ │1".TYPE │ │for Logical, M │ │ │ │ │ │for Memo, N for│ │ │ │ │ │Numeric and D │ │ │ │ │ │for date. Any │ │ │ │ │ │other value │ │ │ │ │ │will cause the │ │ │ │ │ │create function│ │ │ │ │ │to fail. │ │ │ ├──────────┼───────────────┼───────────────┼───────────────┼──────────┤ │*."field │The first field│Specify the │ │ │ │name │size or length.│field length. │ │ │ │1".LENGTH │ │For Logical, │ │ │ │ │ │Memo and Date │ │ │ │ │ │field the size │ │ │ │ │ │field is │ │ │ │ │ │ignored and │ │ │ │ │ │RexxBase uses │ │ │ │ │ │the default │ │ │ │ │ │values. For │ │ │ │ │ │Character │ │ │ │ │ │fields specify │ │ │ │ │ │a value from 1 │ │ │ │ │ │to 254. For │ │ │ │ │ │Numeric fields │ │ │ │ │ │specify the │ │ │ │ │ │length in the │ │ │ │ │ │format of │ │ │ │ │ │length.decimal,│ │ │ │ │ │where length is│ │ │ │ │ │a value from 1 │ │ │ │ │ │to 19 and │ │ │ │ │ │decimal (no of │ │ │ │ │ │decimal │ │ │ │ │ │positions) is 0│ │ │ │ │ │to 9 (one less │ │ │ │ │ │than the │ │ │ │ │ │length). │ │ │ │ │ │Numeric │ │ │ │ │ │accuracy is │ │ │ │ │ │valid to 15 │ │ │ │ │ │integer digits │ │ │ │ │ │and 9 decimal │ │ │ │ │ │places. │ │ │ ├──────────┼───────────────┼───────────────┼───────────────┼──────────┤ │... │... │ │ │ │ ├──────────┼───────────────┼───────────────┼───────────────┼──────────┤ │Field n │*.FIELDNAME.n │The last field │ │ │ │ │ │in the │ │ │ │ │ │database. The │ │ │ │ │ │value of n │ │ │ │ │ │should be equal│ │ │ │ │ │to the value │ │ │ │ │ │specified in │ │ │ │ │ │dbname.FIELDCOU│ │ │ └──────────┴───────────────┴───────────────┴───────────────┴──────────┘ Purpose. To create a database. Format. rexxbase_createdbf("dbfname") Parameters. dbfname The REXX variable contains the name of the database similar in function to the database field in the Rexxbase_OpenDBF function. The name of the database is defined in a REXX variable. You must pass the variable name in a string. For example. myfilename = 'c:\xbase\newmachn.dbf' rexxbase_createdbf('myfilename') Return Value Description "". Normal No Rexx DBF Name specified The first parameter of function call is missing. Bad Variable Name Variable used to pass database name is not a valid REXX variable name. No Filename Assigned To Variable. Variable used to pass database name is empty or unassigned. Database name already In Use. Database name passed is already in use. Create failed refer to the following: Unknown Field Type Use C, D, L, M, and N only for field types. Invalid field size For character fields use a size from 1 through 249. For numeric fields use a size of specification of xx.yy where xx is a value from 1 to 19 and yy is from 0 to 9 and yy is one less than xx. All other field type length specifications default to: 8 for D, 1 for L and 10 for M. Too many fields. Only 128 fields are allowed per database. Record size too large Records sizes are limited to 4000 bytes. To prevent unwanted destruction of a database file refer to the RexxBase variable Rexxbase.Safety. Sample. /* REXX */ dbf.fieldcount = 4 dbf.fieldname.1 = location dbf.location.type = 'c' dbf.location.length = '10' dbf.fieldname.2 = inuse dbf.inuse.type = 'l' dbf.fieldname.3 = startuse dbf.startuse.type = 'd' dbf.fieldname.4 = prchcost dbf.prchcost.type = 'n' dbf.prchcost.length = '9.2' ret = rexxbase_createdbf('dbf') ═══ 4.19. Rexxbase_CreateFromDBF ═══ Description. This will create a new database file structure only. No data is added to the file. No structure modifications may be made. Purpose. To create a database structure. Format. rexxbase_createfromdbf("dbfname","newdbfname") Parameters. dbfname The REXX variable contains the name of the database similar in function to the database field in the Rexxbase_OpenDBF function. newdbfname The REXX variable contains the name of the new database. The name of the database is defined in a REXX variable. You must pass the variable name in a string. For example. oldfilename = 'c:\xbase\machn.dbf' newfilename = 'c:\xbase\newmachn.dbf' rexxbase_createfromdbf('oldfilename','newfilename') Return Value Description "". Normal No Rexx DBF Name specified The first parameter of function call is missing. Unknown Database Name. The name found in the passed parameter is not the same used to open the database. No DBF Name To Copy Structure To This functions expects a second paramter which contains the name of the file to be created. Bad Variable Name Variable used to pass database name is not a valid REXX variable name. No Filename Assigned To Variable. Variable used to pass database name is empty or unassigned. Database Name Already In Use. Database name passed is already in use. No Filename Assigned To Variable. Variable used to pass database name is empty or unassigned. Database In Use. Database name passed is already in use. CreateFrom Failed Refer to the rexxbase.error stem variable.: To prevent unwanted destruction of a database file refer to the RexxBase variable Rexxbase.Safety. Sample. /* REXX */ parse arg olddbf newdbf ret = rexxbase_opendbf('olddbf') ret = rexxbase_createfromdbf('olddbf','newdbf') ═══ 4.20. Rexxbase_ModifyDBF ═══ Description. This will modify the structure of a database file that is currently open. When a database is opened the database fields descriptions are loaded into REXX Variables. By changing the values in these REXX variables you can alter the characteristics of a database field, remove a database field and add new database fields. ┌──────────┬───────────────┬───────────────┬───────────────┐ │Database │*.FIELDCOUNT │The number of │ │ │Field │ │fields in the │ │ │Count │ │database. │ │ │ │ │Increase the │ │ │ │ │count of this │ │ │ │ │field when │ │ │ │ │adding new │ │ │ │ │records. If │ │ │ │ │you decrease │ │ │ │ │the count, the │ │ │ │ │trailing fields│ │ │ │ │will be │ │ │ │ │removed. To │ │ │ │ │remove fields │ │ │ │ │in the │ │ │ │ │beginning and │ │ │ │ │the middle of │ │ │ │ │the field │ │ │ │ │change the │ │ │ │ │field type "P".│ │ ├──────────┼───────────────┼───────────────┼───────────────┤ │Field Name│*.FIELDNAME.1 │The first field│ │ │1 │ │name. │ │ ├──────────┼───────────────┼───────────────┼───────────────┤ │*."field │The first field│Specify C for │ │ │name │type. │character, L │ │ │1".TYPE │ │for Logical, M │ │ │ │ │for Memo, N for│ │ │ │ │Numeric and D │ │ │ │ │for date. │ │ ├──────────┼───────────────┼───────────────┼───────────────┤ │*."field │The first field│Specify the │ │ │name │size or length.│field length. │ │ │1".LENGTH │ │For Logical, │ │ │ │ │Memo and Date │ │ │ │ │field the size │ │ │ │ │field is │ │ │ │ │ignored and │ │ │ │ │RexxBase uses │ │ │ │ │the default │ │ │ │ │values. For │ │ │ │ │Character │ │ │ │ │fields specify │ │ │ │ │a value from 1 │ │ │ │ │to 254. For │ │ │ │ │Numeric fields │ │ │ │ │specify the │ │ │ │ │length in the │ │ │ │ │format of │ │ │ │ │length.decimal,│ │ │ │ │where length is│ │ │ │ │a value from 1 │ │ │ │ │to 19 and │ │ │ │ │decimal (no of │ │ │ │ │decimal │ │ │ │ │positions) is 0│ │ │ │ │to 9 (one less │ │ │ │ │than the │ │ │ │ │length). │ │ │ │ │Numeric │ │ │ │ │accuracy is │ │ │ │ │valid to 15 │ │ │ │ │integer digits │ │ │ │ │and 9 decimal │ │ │ │ │places. │ │ ├──────────┼───────────────┼───────────────┼───────────────┤ │... │... │ │ │ ├──────────┼───────────────┼───────────────┼───────────────┤ │Field n │*.FIELDNAME.n │The last field │ │ │ │ │in the │ │ │ │ │database. The │ │ │ │ │value of n │ │ │ │ │should be equal│ │ │ │ │to the value │ │ │ │ │specified in │ │ │ │ │dbname.FIELDCOU│ │ └──────────┴───────────────┴───────────────┴───────────────┘ Purpose. To modify a database. Format. rexxbase_modifydbf("dbfname") Parameters. dbfname The REXX variable contains the name of the database similar in function to the database field in the Rexxbase_OpenDBF function. The name of the database is defined in a REXX variable. You must pass the variable name in a string. For example. myfilename = 'c:\xbase\machn.dbf' rexxbase_modifydbf('myfilename') Return Value Description "". Normal No Rexx DBF Name specified The first parameter of function call is missing. Unknown Database Name. The name found in the passed parameter is not the same used to open the database. Modify Failed refer to the following: Unknown Field Type Use C, D, L, M, and N only for field types. Invalid field size For character fields use a size from 1 through 249. For numeric fields use a size of specification of xx.yy where xx is a value from 1 to 19 and yy is from 0 to 9 and yy is one less than xx. All other field type length specifications default to: 8 for D, 1 for L and 10 for M. Too many fields. Only 128 fields are allowed per database. Record size too large Records sizes are limited to 4000 bytes. Sample. /* REXX */ dbf = 'c:\xbase\newmachn.dbf' rexxbase_opendbf('dbf') dbf.fieldcount = 4 dbf.fieldname.1 = location dbf.type.1 = 'c' dbf.location.length = '10' dbf.fieldname.2 = inuse dbf.inuse.type = 'l' dbf.fieldname.3 = startuse dbf.startuse.type = 'd' dbf.fieldname.4 = prchcost dbf.prchcost.type = 'n' dbf.prchcost.length = '9.2' ret = rexxbase_modifydbf('dbf') ═══ 4.21. Rexxbase_CreateIndex ═══ Description. This will create an index for an currently open database. The call the RexxBase Create Index function requires 3 parameters: Open Database Name, Index file name (FAT or HPFS format) and the string defining the index. Purpose. To create an index for an open database. Format. rexxbase_createindex("dbfname",index file name,index string) Parameters. dbfname The REXX variable contains the name of the database similar in function to the database field in the Rexxbase_OpenDBF function. index file name Any valid file name in FAT or HPFS format. index string A string of characters used to specify the index. See REXXBASE.UNIQUE more information. See ndx definition more information. The name of the database is defined in a REXX variable. You must pass the variable name in a string. For example. myfilename = 'c:\xbase\newmachn.dbf' myindexname = 'c:\xbase\newmachn.ndx' rexxbase_opendbf('myfilename') rexxbase_createindex('myfilename',myindexname,num+dept) Return Value Description "". Normal No REXX DBF Name Specified No argument was passed to the routine. Unknown Database Name. The name found in the passed parameter is not the same used to open the database. No Index File Name Specified This procedure expects a second argument containing the new index file name. No Index Field Names Specified This procedure expects a third argument containing the index key. Index Not Built. A runtime error occurred. Review error message in rexxbase.error stem variable. Unknown field type Use C, D, L, M, and N only for field types. Invalid index size Indexes are limited to 100 bytes. Too many fields. Only 100 fields are allowed per index. Data Type Mismatch You can't mix numeric, character or date fields together Invalid Data Type Memo fields and logic fields are not allowed to be used as indexes. Sample. /* REXX */ dbf = 'c:\xbase\machn.dbf' ret = rexxbase_opendbf('dbf') ret = rexxbase_createindex('dbf','machn.ndx',machnum) ═══ 4.22. Rexxbase_ReindexDBF ═══ Purpose. To rebuild all open indexes for an open database. Format. ret = rexxbase_reindexdbf(dbfname) Parameters. dbfname The REXX variable contains the name of the database similar in function to the database field in the Rexxbase_OpenDBF function. Description. This will rebuild all the indexes that are opened for a database file. When a database has been changed without its associated indexes, the index pointers will be incorrect. This function will reindex the file. Also, use this function when many updates have been applied to a database, even with the index opened. This will maintain the indexes for efficiency. myfilename = 'c:\xbase\machn.dbf' rexxbase_reindexdbf('myfilename') Return Value Description "". Normal No REXX DBF Name Specified No argument was passed to the routine. Unknown Database Name. The name found in the passed parameter is not the same used to open the database. Sample. /* REXX */ dbf = 'c:\xbase\newmachn.dbf' rexxbase_opendbf('dbf',c:\xbase\newmachn.ndx) ret = rexxbase_reindexdbf('dbf') say newmachn.ndx has been reindexed ret = rexxbase_closedbf('dbf') ═══ 4.23. Additional functions. ═══ The following funcitons are available with the registered user package: o Rexxbase_ExportDBF o Rexxbase_ImportDBF o Rexxbase_FormatDate o Rexxbase_InternalDate o Rexxbase_DaysDifference o Rexxbase_DateCalc o Rexxbase_FilterDBF o Rexxbase_ScanForRecord o Rexxbase_JoinDBF o Rexxbase_SummarizeDBF o Rexxbase_ChangePrimaryIndex o Rexxbase_Soundex ═══ 5. RexxBase Fields and Database Fields. ═══ RexxBase uses REXX Stem and Compound variables extensively to allow your procedure to use your database files. ═══ 5.1. RexxBase Fields. ═══ RexxBase offers several fields for controlling your database. All field names are associated with your database by using the stem variable name you pass to the RexxBase Functions. Also, RexxBase provides a stem variable for system errors. The field name is rexxbase.error . Refer to the section on error processing for more information and a list of potential error messages. Name Description. "database name".RECORDCOUNT Number of record on the file. Where database name is the name your program passes to RexxBase. "database name".RECORDNUMBER The current record number. Where database name is the name your program passes to RexxBase. "database name".FILESTATUS TOF - Top of file, BOF - End of file, or null. "database name".RECORDSTATUS DELETED - current record is deleted, or null. "database name".LASTUPDATE Last day file was updated. "database name".FIELDCOUNT Number of fields on the database. database name".FIELDNAME.# Field names on the database. Where # is any number from 1 to the number of fields as specified in FIELDCOUNT. "fieldname".TYPE The database type for the respective field, see FIELDNAME.#. "fieldname" is the name of the field in the database. "fieldname".LENGTH The length of the respective field, see FIELDNAME.#. "fieldname" is the name of the field in the database. Numeric fields will have in the value in the format of xx.yy where xx is the length of the field and yy is the number of decimal positions. Memo fields are always 10. Logical fields are always 1. "database name".INDEXCOUNT Number of index files open for the database. database name".INDEXFIELDNAME.# Field names used for indexing. Where # is any number from 1 to the number of fields as specified in INDEXCOUNT. "fieldname".INDEXFILENAME.# Operating System file names for the open index files. Where # is any number from 1 to the number of fields as specified in INDEXCOUNT. ═══ 5.1.1. Field Naming Convention. ═══ With the exception of RexxBase database names, all database field names are prefixed by the Rexx variable you use to specify the database. For example if you used the REXX variable DNAME as the database name the field count variable name would be DNAME.FIELDCOUNT. Database field names are directly accessible by the field name in the database. For example if your database had three fields defined as NAME, CITY, ZIP, then your REXX procedure will be able to read from and write to these fields by using the name directly. The database name is not prefixed to the fields names. To find out the field names in a database use the following example: /* REXX */ parse arg dbfname do i = 1 to dbfname.fieldcount k = "say dbfname.fieldname.i " k = k || " dbfname."dbfname.fieldname.i".type" k = k || " dbfname."dbfname.fieldname.i".length" interpret k end /* do */ say dbfname do i = 1 to dbfname.recordcount say dbfname.recordstatus say reading is rexxbase_readdbf("dbfname") do j = 1 to dbfname.fieldcount k = "say dbfname.fieldname.j " k = k || " is dbfname." || dbfname.fieldname.j interpret k /* don't let the quoted field name fool you */ /* the first dbfname.fieldname.j will appear as the field name after interpretation*/ /* the second will have the value appear after interpretation */ end /* do */ end /* do */ say rexxbase_closedbf("dbfname") return ═══ 5.1.2. Your Program Changing a RexxBase Field Value. ═══ In most cases if you change a RexxBase field value, like FIELDCOUNT there will be no effect internally to RexxBase or the actual database file. ═══ 5.2. Database Fields. ═══ Database field name are accessible by concatenating the database variable name, your procedure assigns when opening the database, with the field name in the database. For example if your database had three fields defined as NAME, CITY, ZIP, and your REXX procedure opened the database as ADDRESS then your REXX procedure will be able to read from and write to these fields by using the names ADDRESS.NAME, ADDRESS.CITY AND ADDRESS.ZIP. The database name is prefixed to the fields names. ═══ 5.2.1. Example of Field Naming. ═══ Unlike RexxBase field names, database field are never prefixed with the database name when used as a function parameter or in field definitions. For example when sorting on a field, you must specify what field to sort using the databasename.SORTFIELD.# construct. The field name you put into the assignment is simply the field name as defined to the dBase database. /* to sort on field ZIP in database ADDRESS */ address.sortfield.0 = 1 address.sortfield.1 = zip /* wrong */ /* address.sortfield.1 = address.zip */ /* this will assign the value of address.zip to address.sortfield.1 */ /* which will only work if the value of address.zip is zip */ ═══ 5.3. Field Verification. ═══ The following field verifications and edits are used. ═══ 5.3.1. Date Fields ═══ Dates are validated based on two parameters. First, is the RexxBase Variable RexxBase.FormatDate. Second, is the Country Code, as defined by OS/2 NLS. RexxBase.FormatDate takes precedence. If it is turned "OFF" then all date fields are assumed to be in the following 8 numeric-character format: CCYYMMDD. CC - century. YY - year. MM - month. DD - day. If you need to use dates that go past 1999/12/31 then you should always use this format. This is because the default century for the other formats is "1900." If RexxBase.FormatDate is "ON", the default value, then date fields are formatted based on the Country Code. As follows: (all are 8 bytes long with separators). MM/DD/YY, slashes or some other separator is required DD/MM/YY, slashes or some other separator is required YY/MM/DD, slashes or some other separator is required Edits are performed on all 4 types of date fields. Century is ignored and defaults to 19. Year is any numeric value from 00 to 99. Month is any numeric value from 01 to 12. Day is any numeric value from 01 to last day of month. h3.Numeric Fields Numeric field verification skips over white space characters until an alphanumeric character is found. If the first non-white space character is alphabetic then the value is stored as zero - NOTE: there is no error message. Field values larger than the defined length (and/or decimal count) are truncated. ═══ 5.3.2. Logical fields ═══ Logical fields are tested and verified for correctness as follows: ┌────────────────────┬───────┬──────────────────────────────┐ │First Byte of │Stored │ │ │Logical Field Value │As │ │ ├────────────────────┼───────┼──────────────────────────────┤ │T, t, Y, or y │T │ │ ├────────────────────┼───────┼──────────────────────────────┤ │F, f, N, or n │F │ │ ├────────────────────┼───────┼──────────────────────────────┤ │Any other value │F │Look for error message on │ │ │ │rexxbase.error stem variable.│ └────────────────────┴───────┴──────────────────────────────┘ ═══ 5.3.3. MEMO Fields. ═══ Memo field names follow the same field naming convention as other field names. ═══ 6. When You Are Done. ═══ After using the RexxBase functions your REXX command file may drop the RexxBase functions. This can be accomplished by using the Rexxbase_ShutDown function or issuing the Rexx command RXFUCNDROP for each fucntion. While the IBM documentation recommends dropping functions. we feel that it is an unnecessary exercise. Do this only if you have literally thousands of functions registered. The space requirements are minimal, but the search time, for thousands of functions, may be significant. ═══ 6.1. Rexxbase_ShutDown. ═══ There may be a time when you want to drop all of the RexxBase functions from the Rexx function pool. To do this use the RexxBase command RexxBase_ShutDown. ShutDown function is to issue a Rexx Function Drop for each of the RexxBase functions. It is pretty much performs the opposite utility of the RexxBase_Init command. RexxBase_ShutDown() There are no parameters. There is no return code. ═══ 6.2. Dropping Individual RexxBase Functions. ═══ The format of the command is RXFUNCDROP(function) function is the name of the RexxBase routine as your procedure defined it. rxfuncdrop(rexxbase_opendbf) Return codes most likely to be returned are: o 0 - ok. o 40 - function not found. ═══ 7. Returned Values and Internal Errors. ═══ The following two sections are lists of return values and internal error messages. ═══ 7.1. Return Values and Functions ═══ The following is a list of possible return values and associated function names: o Bad Record Number Rexxbase_GoToRecord o Bad Variable Name. Rexx Rtn is %2.2x\0 Rexxbase_OpenDBF o Bad Variable Name; rc is %2.2x\0 Rexxbase_CreateDBF Rexxbase_CreateFromDBF o BOF Rexxbase_GoToRecord Rexxbase_ReadAndLockDBF Rexxbase_ReadDBF Rexxbase_ScanForRecord o Can't Create Area For Join Rexxbase_JoinDBF o Can't Find filename Rexxbase_SortDBF o Can't Open filename Rexxbase_OpenDBF o Can't Open Index File, Database Is Open Rexxbase_OpenDBF o Can't Open Sort DBF File Rexxbase_SortDBF o Can't Write To Sort DBF file Rexxbase_SortDBF o Create Failed Rexxbase_CreateDBF o CreateFrom Failed Rexxbase_CreateFromDBF o Database Name Already In Use Rexxbase_CreateDBF Rexxbase_CreateFromDBF Rexxbase_OpenDBF o Database Tied To A Join Rexxbase_CloseDBF Rexxbase_CreateFromDBF Rexxbase_CreateIndex Rexxbase_DeleteRecord Rexxbase_ExportDBF Rexxbase_FindRecord Rexxbase_GoToRecord Rexxbase_ImportDBF Rexxbase_ModifyDBF Rexxbase_PackDBF Rexxbase_ReadAndLockDBF Rexxbase_ReadAndLockPrevDBF Rexxbase_ReadDBF Rexxbase_ReadPrevDBF o Database Tied TO A Join Rexxbase_ReindexDBF o Database Tied To A Join Rexxbase_ScanForRecord Rexxbase_SortDBF Rexxbase_UndeleteRecord Rexxbase_UpdateDBF Rexxbase_WriteDBF o Export Function Failed Rexxbase_ExportDBF o First Database Name Unknown Rexxbase_JoinDBF o First Date Is Not Valid Rexxbase_DateCalc Rexxbase_DaysDifference o First date Is Not Valid Rexxbase_DaysDifference o First Joined DBF Name Not Specified Rexxbase_JoinDBF o Import Function Failed Rexxbase_ImportDBF o Index File Not Opened Rexxbase_FindRecord o Index Limit Reached Rexxbase_OpenDBF o Index Not Built Rexxbase_CreateIndex o Internal File Processing Error Rexxbase_ReadDBF Rexxbase_ScanForRecord Rexxbase_SortDBF o Invalid Condition Found Rexxbase_FilterDBF Rexxbase_JoinDBF Rexxbase_ScanForRecord o Invalid Field Specification Found Rexxbase_JoinDBF o Invalid Record Position Rexxbase_UpdateDBF o Join Database Name Already In Use Rexxbase_JoinDBF o Missing Index File Name, Database is open. Rexxbase_OpenDBF o Modify Failed Rexxbase_ModifyDBF o No Conditions Specified Rexxbase_ScanForRecord o No Date Specified Rexxbase_FormatDate Rexxbase_InternalDate o No Dates Specified Rexxbase_DateCalc Rexxbase_DaysDifference o No DBF Name To Copy Structure To Rexxbase_CreateFromDBF o No Export File Name Specified Rexxbase_ExportDBF o No Filename Assigned To Variable Rexxbase_CreateDBF o No Filename Assigned To Variable Rexxbase_CreateFromDBF Rexxbase_OpenDBF o No Import File Name Specified Rexxbase_ImportDBF o No Index Field Names Specified Rexxbase_CreateIndex o No Index File Name Specified Rexxbase_CreateIndex o No Joining Condition Specified Rexxbase_JoinDBF o No Joining Fields Specified Rexxbase_JoinDBF o No Locate String Specified Rexxbase_FindRecord o No Lock Time Specified Rexxbase_SetLockTimeout o No Record Number Specified Rexxbase_GoToRecord o No Record Read Rexxbase_DeleteRecord Rexxbase_UndeleteRecord o No Rexx DBF Name Specified Rexxbase_CloseDBF Rexxbase_CreateDBF Rexxbase_CreateFromDBF Rexxbase_CreateIndex Rexxbase_DeleteRecord Rexxbase_ExportDBF Rexxbase_FilterDBF Rexxbase_FindRecord Rexxbase_GoToRecord Rexxbase_ImportDBF Rexxbase_ModifyDBF Rexxbase_OpenDBF Rexxbase_PackDBF Rexxbase_ReadAndLockDBF Rexxbase_ReadAndLockPrevDBF Rexxbase_ReadDBF Rexxbase_ReadPrevDBF Rexxbase_ReindexDBF Rexxbase_ScanForRecord Rexxbase_SortDBF Rexxbase_UndeleteRecord Rexxbase_UnlockDBF Rexxbase_UpdateDBF Rexxbase_WriteDBF o No Rexx Joined DBF Name Specified Rexxbase_JoinDBF o No Sort DBF Name Specified Rexxbase_SortDBF o Not Enough Memory For Sorting Rexxbase_SortDBF o Number Of Days Is Missing Rexxbase_DateCalc o Record Not Found Rexxbase_FindRecord o Second Database Name Unknown Rexxbase_JoinDBF o Second date Is Missing Rexxbase_DaysDifference o Second Date Is Not Valid Rexxbase_DaysDifference o Second Joined DBF Name Not Specified Rexxbase_JoinDBF o Sort Field Count Not Found Rexxbase_SortDBF o TOF Rexxbase_GoToRecord Rexxbase_ReadAndLockPrevDBF Rexxbase_ReadPrevDBF o Unable To Write Fields To File; rc = %3.3d Rexxbase_SortDBF o Unknown Database Name Rexxbase_CloseDBF Rexxbase_CreateFromDBF Rexxbase_CreateIndex Rexxbase_DeleteRecord Rexxbase_ExportDBF Rexxbase_FilterDBF Rexxbase_FindRecord Rexxbase_GoToRecord Rexxbase_ImportDBF Rexxbase_ModifyDBF Rexxbase_PackDBF Rexxbase_ReadAndLockDBF Rexxbase_ReadAndLockPrevDBF Rexxbase_ReadDBF Rexxbase_ReadPrevDBF Rexxbase_ReindexDBF Rexxbase_ScanForRecord Rexxbase_SortDBF Rexxbase_UndeleteRecord Rexxbase_UnlockDBF Rexxbase_UpdateDBF Rexxbase_WriteDBF ═══ 7.2. Internal Errors. ═══ The following is a list of internal errors. At a later release there will be a full discussion of these errors. o All other data ignored after DBF name o All other data ignored after Sort DBF name o alloc error o Bad date found, changed to all spaces. o Bad field type when getting field value o Can't allocate memo space o Can't make logical field part of a key o Can't make memo field part of a key o can't position at end of memo file o Data type mismatch o Data Type Mismatch o Field delimiter character not found. Import stops. o Field truncated o Field truncated. o Invalid expression o Invalid expression - data type mismatch o Invalid expression - invalid logic connector o Key length too long o Key length too short o logic field value invalid, value set to 'F' o Memo field missing field delimiter, Import stops. o Memo field missing start field delimiter, Import stops. o Memo fields not allowed in conditions o Not enough memory for index sorting o Numeric field expected, not found on input file. Import stops. o passed bad memopointer to write memo o Read record size does not match o Third parameter must be EXACT. Parameter ignored o Too many files opened o Unable to change memo file size. o Unknown delimiter character found. Import stops o Unknown field name in field list o Unknown field specified in key file define o Unknown field specified in key file open o Unknown name in expression o Unknown operator type in parse expression logic o Would add duplicate o Written record size does not match ═══ 8. Control Variables. ═══ The following is a description of RexxBase error, file, and date handling and extended control facilities. ═══ 8.1. RexxBase Errors ═══ Errors are reported in two different ways, return codes and the error stem variable. If the RexxBase function returns a value other than "" then the function did not complete successfully. ═══ 8.1.1. Where To Find Internal Error Messages ═══ Whether a function failed or not, there maybe other types of errors and warning messages that are useful to your program. These messages are found in the RexxBase error stem variable. All internal system and control errors are directed to a stem variable named REXXBASE.ERROR. The zeroth element is a counter This element contains them number of errors in the stem variable. Each time you call a RexxBase function the counter is reset to zero. Your procedure should check what is returned from the function call. For a further description of stem variables refer to your Rexx documentation. ═══ 8.1.2. Internal Error List. ═══ The following is a list of errors and a brief explanation. Error Description All other data ignored after Sort DBF name More parameters were specified than are required Logic field value invalid, value set to 'F' The value of a logic field, which will be adding to or updating a database record contained an invalid value. Can't position at end of memo file There is a severe error with a DBT file. Bad field type when getting field value Internal error - A field type has changed Bad date found, changed to all spaces. The value of a date field, which will be added to or updating a database record contained an invalid value. All other data ignored after DBF name More parameters were specified than are required Dos open error ### for file @@@@@@@@@@ Operating system error, value found in ###, while trying to open file @@@@@@@@@@@ Dos read anchor error #### for file @@@@@@@@@@ Operating system error, value found in ###, while trying to read file @@@@@@@@@@@ Unknown field specified in key file open A field name specified in an index build is not part of the database Can't make memo field part of a key A field name specified in an index build is a memo field. Memo fields can not be part of an index. Can't make logical field part of a key A field name specified in an index build is a logical field. Logical fields can not be part of an index. Unknown field specified in key file define A field name specified in an index build is not in the database. Key length too short Internal error, the calculated length for a key is less than one (1). Would add duplicate Writing a new record to database creates a duplicate key. Unique key value is FALSE. Dos write anchor error #### for file @@@@@@@@@@ Operating system error, value found in ###, while trying to write file @@@@@@@@@@@ Not enough memory for index sorting. Not enough internal memory space to create temporary sort file for indexing function. Can't rename file for modify Modify Structure function attempts to rename the old file. Failure probably caused by duplicate name. Can't rebuild, old file not open Internal error. Somehow the file has been closed. Can't rebuild, new file not created Modify Structure function attempted to create the new file. Old file has been renamed but ...failure probably caused by duplicate name or lack of disk space. Unable to allocate temp file memory ## Not enough internal memory space to create file space. Operating system error value is ## Dos open error ### for text file @@@@@@@@@@@ Operating system error, value found in ###, while trying to open DBT file @@@@@@@@@@@ Field Not Defined Create function error - can not find variable. Bad Field Count Field count for Create is either less than 1 or greater than 128 Field Name Not Okay Field name does not satisfy naming convention. Field Type Not Defined Create function needs to know the field type(characteristics) Field Type Not Valid Field type specified is not C, D, L, N or M. Field Type Not Valid Create function needs to know the field length Field Length Not Defined Correctly The field length requested does not satisfy the length limitations for its type. Record Size Too Large Calculated record length is greater than 4000. 4000 is maximum allowed. ═══ 8.2. File Control Variables ═══ RexxBase offers several control variables to enhance control over your database files. ═══ 8.2.1. REXXBASE.UPDATEHEADERCOUNTER. ═══ You can control how often the database header record gets updated. You change the RexxBase.UpdateHeaderCounter. This sets an internal counter indicating how often after every RexxBase_WriteDBF command the header record is updated. The higher the number the less often the header record is updated. But if the header record is not updated and there is a system crash then the header record will not contain accurate information. The default value is one. A value of zero indicates that the header record is only updated when the database is closed. The value is only set when a database is opened. Therefore changing the value after a database has been opened has no affect on that database. ═══ 8.2.2. Safety - Preventing File Deletion ═══ REXXBASE.SAFETY allows for a level of protection from destroying, deleting or overwriting database and index files. When your routine sets REXXBASE.SAFETY to "ON", anytime RexxBase opens a file, in a creation function (i.e. sort output file, create index, etc.) the function will fail. Check both the return code from the function and/or the rexxbase.error stem variable. When REXXBASE.SAFETY is set to "OFF" then any routine can destroy a file. There may be information in the rexxbase.error stem variable but the return code, even if successful, will be "". The default value is "OFF". If set incorrectly the default value will be used. ═══ 8.2.3. REXXBASE.READ ═══ When REXXBASE.READ is set to "OFF" then the Rexxbase_OpenDBF will open the file for NO read access. This means any routine that reads a file, that was opened when set REXXBASE.READ was set to "OFF", will fail. The default value is "ON". If set incorrectly the default value will be used. ═══ 8.2.4. REXXBASE.WRITE ═══ When REXXBASE.WRITE is set to "OFF" then the Rexxbase_OpenDBF will open the file for NO write access. This means any routine that writes to a file, that was opened when set REXXBASE.READ was set to "OFF", will fail. The default value is "ON". If set incorrectly the default value will be used. ═══ 8.2.5. REXXBASE.UNIQUE ═══ When REXXBASE.UNIQUE is set to "ON" then the Rexxbase_CreateIndex creates an index file with unique keys. This prevents duplicate keys from being added to the index file. When REXXBASE.UNIQUE is set to "OFF" then the Rexxbase_CreateIndex creates an index file without unique keys. This prevents duplicate keys from being added to the index file with Rexxbase_ReadDBF and Rexxbase_UpdateDBF functions. The default value is "OFF". If set incorrectly the default value will be used. ═══ 8.2.6. REXXBASE.SHARE ═══ Rexxbase offers a facility for file sharing your databases. When REXXBASE.SHARE is set to "OFF" then the Rexxbase_OpenDBF will open the file NO OTHER external program file access. This will prevent any other program in the system from accessing the file. Also, if the file is already opened, by another program, your routine will fail. This is file locking. When REXXBASE.SHARE is set to "READ" then the Rexxbase_OpenDBF will open the file for read only sharing. This will allow any other program in the system to read your open database file. Also, if the file is already opened by another program for no read sharing, your routine will fail. When REXXBASE.SHARE is set to "WRITE" then the Rexxbase_OpenDBF will open the file for write only sharing. This will allow any other program in the system to have write access the file, not read access. Also, if the file is already opened by another program for no write sharing, your routine will fail. When REXXBASE.SHARE is set to "READWRITE" then the Rexxbase_OpenDBF will open the file for read and write sharing. This will allow any other program in the system to have access the file. Also, if the file is already opened by another program for no sharing, your routine will fail. The default value is "OFF". If set incorrectly the default value will be used. You may set REXXBASE.SHARE at anytime and as often as you like. But it is only used when the database is opened with a Rexxbase_OpenDBF. ═══ 8.3. Controlling Date Format. ═══ RexxBase offers a way to control the format of dates. By turning the format control on and off dates are presented in either internal xBase format or in a display format. ═══ 8.3.1. REXXBASE.FORMATDATE. ═══ When RexxBase.FormatDate is turned "OFF" then all date fields are in the following 8 numeric-character format: CCYYMMDD. CC - century. YY - year. MM - month. DD - day. If RexxBase.FormatDate is "ON", the default value, then date fields are formatted based on the Country Code. as follows: (all are 8 bytes long with separators). MM/DD/YY, slashes or some other separator is required DD/MM/YY, slashes or some other separator is required YY/MM/DD, slashes or some other separator is required The default value is "ON". If set incorrectly the default value will be used. ═══ 9. Next Releases. ═══ The following is a list of the next planned releases. This is a statement of direction. In any event, American Coders may, at anytime, decide not to complete any or all of these releases. Also, this does not guarantee the these releases will be completed in this order. ═══ 9.1. dBase IV file structures. ═══ Will allow acces to dBase IV: DBF, DBT and MDX files. ═══ 9.2. SOM/DSOM Interface To The Database Routines. ═══ Gain access to the database, outside the realm of Rexx, using C/C++ class libraries through objects. ═══ 10. Suggestions and Bugs. ═══ Please call or write to us at our address with suggestions or to report bugs. You can reach us through CompuServe by contacting Joe McVerry at 74150,2370 ═══ 11. Shareware Software ═══ DEFINITION OF SHAREWARE SOFTWARE Shareware Software distribution gives users a chance to try software before buying it. If you try a Shareware software program and continue using it, you are expected to register. Individual programs differ on details -- some request registration while others require it, some specify a maximum trial period. With registration, you get anything from the simple right to continue using the software to an updated program with printed manual. ═══ 11.1. Copyright ═══ Copyright laws apply to both Shareware and commercial software, and the copyright holder retains all rights, with a few specific exceptions as stated below. Shareware software authors are accomplished programmers, just like commercial authors, and the programs are of comparable quality. (In both cases, there are good programs and bad ones!) The main difference is in the method of distribution. The author specifically grants the right to copy and distribute the software, either to all and sundry or to a specific group. For example, some authors require written permission before a commercial disk vendor may copy their Shareware software. ═══ 11.2. Distribution. ═══ Shareware software is a distribution method, not a type of software. You should find software that suits your needs and pocketbook, whether it's commercial or Shareware software. The Shareware software system makes fitting your needs easier, because you can try before you buy. And because the overhead is low, prices are low also. Shareware software has the ultimate money-back guarantee -- if you don't use the product, you don't pay for it. ═══ 12. Disclaimer ═══ DISCLAIMER - AGREEMENT Users of RexxBase must accept this disclaimer of warranty: "REXXBASE IS SUPPLIED AS IS. AMERICAN CODERS DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE WARRANTIES OF MERCHANTABILITY AND OF FITNESS FOR ANY PURPOSE. AMERICAN CODERS LTD. ASSUMES NO LIABILITY FOR DAMAGES, DIRECT OR CONSEQUENTIAL, WHICH MAY RESULT FROM THE USE OF REXXBASE." ═══ 13. Sharing RexxBase ═══ RexxBase is a "Shareware software program" and is provided at no charge to the user for evaluation. Feel free to share it with your friends, but please do not give it away altered or as part of another system. The essence of "user-supported" software is to provide personal computer users with quality software without high prices, and yet to provide incentive for programmers to continue to develop new products. If you find this program useful and find that you are using RexxBase and continue to use RexxBase after a reasonable trial period of 30 days, you must make a registration payment of $95.00 to American Coders, Ltd. The $95.00 registration fee will license one copy for use on any one computer at any one time. You must treat this software just like a book. An example is that this software may be used by any number of people and may be freely moved from one computer location to another, so long as there is no possibility of it being used at one location while it's being used at another. Just as a book cannot be read by two different persons at the same time. ═══ 13.1. Commercial Users ═══ Commercial users of RexxBase must register and pay for their copies of RexxBase within 30 days of first use or their license is withdrawn. Site-License arrangements may be made by contacting American Coders, Ltd. ═══ 13.2. Distributing ═══ Anyone distributing RexxBase for any kind of remuneration must first contact American Coders, Ltd. at our address below for authorization. This authorization will be automatically granted to distributors recognized by the (ASP) as adhering to its guidelines for shareware distributors, and such distributors may begin offering RexxBase immediately (However American Coders, Ltd. must still be advised so that the distributor can be kept up-to-date with the latest version of RexxBase.). ═══ 13.3. Pass Along ═══ You are encouraged to pass a copy of RexxBase along to your friends for evaluation. Please encourage them to register their copy if they find that they can use it. All registered users will receive a copy of the latest version of the RexxBase system.