[Company Logo Image] 

[Home][What's New][Feedback][Documentation]

Freedom Data enhancement RFP #98/04/16

Part 1)  Machine$("CONV-AUTOCORRECT=argument")

Provides automatic range correction in place of 726 errors on READ/WRITE/REWRITE statements.

The "argument" given has the following options:

<empty-string> Returns the current control state for saving.
"Off" Turns off correction.
"On" Turns on correction.  Default is "Min,Max,Zero" (see below)
<minspec>,<maxspec>,<badspec> Turns on correction with specified behavior on
underflow/overflow/bad data.

The "minspec" and "maxspec" parameters apply to writing data and the "badspec" applies to reading data.  The possible "minspec", "maxspec" and "badspec" values are:

Min Set the value to the minimum legal value.
Max Set the value to the maximum legal value.
Zero Set the value to zero.
Ignore Do not change the value already in the data record.
(Can not be used in "badspec")
Conv Generate the 726 conversion error trap.

LBASIC "knows" the full details of the data conversion type being performed and can compute the appropriate min and max allowed values based on the conversion type specified.

For example, BU conversions would have a min value of 0 while B conversions would have a value of negative 2^(8*FieldSize-1).  PD's and PIC's would have a minimum value of negative all-nines-digits.

 

Part 2)  Logging of Conv-Autocorrect events

Operation:

Whenever a conversion error is detected and processed by the Conv-Autocorrect enhancement specified above, LBASIC must write out a log report indicating the event.   The following information should be included:

  1. The current date and time
  2. The WSID of the workstation performing the write.
  3. The program name and line number.
  4. The CNT parameter for the data value being written.
  5. The file being written.
  6. The primary key of the active record (if the file is a keyed file) in escaped format.
  7. The primary key of the active record (if the file is a keyed file) in hex dump (DEBUG) format.
  8. The record number and byte range being written.
  9. The conversion specification being used.
  10. Event type detected (min, max or bad data)
  11. The original data in the record being changed in escaped format.
  12. The original data in the record being changed in hex dump (DEBUG) format.
  13. The data value specified to be written and the new value to which it was changed.

Output Format:

Comma separated, quoted escaped text fields in CRLF separated records.

Each loggable event would cause a log information line to be appended to the log file.  The line would consist of comma separated quoted fields.

Some data (the primary key field and the overwritten old data field) would be provided in both an escaped format (identical to that used by the C language with non-printable characters encoded as "\xnn" as hex-codes) as well as a hex dump format similar to that used by the Dos DEBUG program. The string represented by the expression CHR$(4) & "AB\C""" & CHR$(131) would be represented as:

Escaped format: \x04AB\\C\"\x83
Hex dump format: 04 41 42 5C 43 22 83    .AB\C".

The hex dump format will contain enough two-digit hex values to identify all characters in the field followed by 4 spaces and a "dotted" representation of the text (dots for non-printable characters).

Control Interface:

Logging would start in the "ON" state by default.   The logging performed can be adjusted by means of the following requests:

MACHINE$("CONV-LOG=")

To return current setting

MACHINE$("CONV-LOG=ON")

To use "standard" default log (currently defined to be   LIBRA1\LBERR.LOG)

MACHINE$("CONV-LOG=OFF")

To supress logging

MACHINE$("CONV-LOG=logfilename.ext")

To create and/or use a log named "logfilename.ext" in the same directory as the data file

MACHINE$("CONV-LOG=logfilename.ext/dirpath")

To create and/or use a log named "logfilename.ext" in the directory path specified by "/dirpath" in LBASIC format.

Accessing the Log:

LBASIC functions will be provided to access the generated log files. Since we really don't want to lose any log entries in a multiuser situation, the logfiles should be opened for exclusive access when an event is being logged.  This implies that logfile processing should be done in an exclusive maintenance program that locks out all simultaneous access to potential logfile updaters or that the logfiles should be renamed first and then processed using their new names.

FN_CONV_LOGFILE_SCAN returns a count of logfile events for a specified logfile.
FN_CONV_LOGFILE_PARSE_EVENT returns information about a specified event parsed
into specified data variables.

 

[Home][What's New][Feedback][Documentation]

Send mail to CompanyWebmaster with questions or comments about this web site.
Last modified: May 05, 1998