VsamEx Service Pack    
HomePage Products News Sellers Order

Get The Update

VsamEx[treme] Service Pack 03/28/11

The following fixes are cumulative and
include all fixes from previous Service Packs

Please Call Software Source for matching updates to VService!







General Maintenence release Updates to some generic support functions like Rebuild..

Addition of Dictionary List processing functions




List processing functions where records are written  as format free Keyed strings.



Certain Sharing access will result in missing keys during a read with nodata at the end of file (dataset). The Data is intact but the software will not find all keys during a readnext operation.



Modified the access to the Map validation routine to determine if a new copy is required before the readnext operation.




Compound Fields access could cause memory exceptions in special cases



Used the proper value for the size of the return buffer passed to the function.




Rebuilt Datasets do not update the Xref record counts properly.



Included code to update the xref counters properly during VsamRebuild




Datasets fail to rebuild under certain circumstances. The VsamRebuild function returns an inappropriate error.



The VsamRebuild function automatically calls the VsamMakeMap function to guarantee that the dataset is properly sequenced so that complete access to all primary records is possible. Part of the process is to pass an encryption key if required. Otherwise a NULL is required or a pointer to a null string. VB.net is not consistent about how it passes NULL strings to external DLL's.


We added several newer methods for checking for valid NULL strings so we don't use un-initialized memory pointers passed by VB.net.




VsamDelete fails to collapse group properly under certain circumstances.

This can lead to unpredictable results and may result in two primary records having the same key. This will interfere with the searching mechanism and some records may not be accessible until a rebuild is done.


The fix involved removing an erroneous return from the internal collapse group function.



VsamPut may fail to properly update the first record in a dataset if it is the only record. This could lead to corruption of the Dataset's format definition record under certain circumstances.

Additionally, the VsamRebuild function would have a hard time determining proper records for the new dataset when rebuilding the corrupted dataset.


The fix involved initializing an un-initialized return code from the software section dealing with a dataset shrinking. It would incorrectly return a random error when only one record was left in the dataset. All other events correctly returned proper values.



VsamRebuild fails to rebuild all records in the dataset.


The first thing that VsamRebuild does is to rebuild the dataset group  map. We found that this process was including groups that had been previously released but not yet removed from the end of the dataset. Fixing this fixed the sympton of failing to rebuild a particular record. It turns out that re-mapping the invalid group created a sequencing error in the dataset such that some records would be viewed as "out of sequence".




Under very heavy load with many access to the same group, the system would return error 2005 but the file was valid.


After much investigation, it was determined that there are conditions when the low level I/O routines will return a "complete" block of data that has only been partially updated by another thread. This means that the system write routines are not atomic and may be interrupted in the middle of a write operation. We now retry several times, with appropriate yelding of execution, before giving up when a group does not validate.




Failure to return a record when doing an XNEXT, if the text filter character case was different from the key for the first record in a Group.


Fixed by changing the string compare funciton to case insensitive.



When the dataset fills up, it corrupts the last record updated in some instances.

Repaired by moving the check for free space higher up in the sequencing to account for the complete record.



When VsamFetchFieldAsString determines that the destination buffer is too small, it fails to return the buffer length needed.

Fixed by returning proper size of required buffer.



Calling VsamGet or VsamReadDict without initalizing the Search Key or Data block pointer each time will generate an exception in .net

Fixed a bug caused by freeing valid memory that was not a valid BSTR. The Record block is freed before a new Record block is assigned. We now use Try/Catch around the SysFreeString call to guarantee that even though the memory pointed to is valid memory, it must also be a valid BSTR, otherwise SysFreeString throws an exception!



XNEXT & XPREVIOUS fail to retrieve the correct record when using Vservice.

Fixed a bug in the Client portion of VsamEx that communicates with the Vservice module. The current Index cursor position was not being properly updated. Additional checks for selection filter end points were added.



Rebuild needs to be able to salvage good records from a corrupted  dataset

Changes to VsamRebuild now include more comprehensive checks for valid record data. As a consequence, data that is corrupted beyond normal recognition is easily identified and skipped. Xref generation now contains beter data and boundary checks. This results in recovery of more good records.



Validate and Rebuild crash with various encrypted datasets.

Some of these issues were fixed by allocating the proper buffer sizes for error return reports. In addition, VsamRebuild will now automatically call VsamMakeMap before rebuilding. This required a fix to VsamMakeMap to work properly with encrypted datasets. This also required a change to work with converted datasets that had a mixture of VB/ISAM style and VsamEx style records.

A change was made to detect bad groups and avoid trying to process garbage data.



The Rebuild function rebuilds some indexes out of sort sequence.

Fields that are indexes with binary 0x02 or 0x03 characters would not be sorted properly. Xref Keys may now contain any binary data except 0x00 & 0x01. While they may contain  0x0b &  0x0e characters, those xref keys will not rebuild properly. 0x02 & 0x03 now work properly.



VsamEx Client side had inadequate buffer size for Vservice response to VsamOpen with over 300 fields defined.

Increased the receive buffer size to accommodate the maximum possible fields in a response to VsamOpen.



VsamEx was executing an internal message pump that would allow multiple executions with the same open dataset control blocks on the same thread.

Changed  all Message pump calls for the same thread to Sleep(0), eliminating the possibility that the same thread can make multiple calls to the same VsamEx function.



VsamReadDict fails on Dictionary elements containing binary data converted from the VB/ISAM form when retrieved through Vservice.

Repaired the Code to properly return the Binary data and correctly report required buffer size. NOTE: VsamWriteDict will not accept binary data so, VB/ISAM dictionary records should be converted to a ascii form.



VsamFetchField does not return the correct value for a field length when the specified buffer is to small.

It now returns the field length value as retrieved from the dataset as originally intended.



Rebuild fails with certain datasets that have been "converted" from VB/ISAM format.

Corrected processing of the old format string in the Rebuild module.



File name specifications with Dots ('.') in the path for subdirectories would prevent datasets from being located.

Corrected the test for file name extensions. The algorithm did not account for periods in a file path and failed when there was no file extension in the dataset name specification.



VsamEx when used with Vservice would cause Vservice use too much CPU when 1000+ users were attached.

VsamEx Keep-alive requests were coming too often. Modified Vservice to request Keep-alive depending on load balance.



VsamExplorer scrolling scrolls two records at a time when the up/down arrows are selected on the scroll bar.

Fixed the scrolling accelerator reset to reset to 0 instead of 1.



VsamEx uses up system resources too fast when a lot of datasets are open at the same time. This limits the number of simultaneous open datasets to about 1600 on systems with only 512MB of main memory.

Adjusted the size of the data definition control block to fit the actual size of the data definition instead of a default of 65k bytes. This reduced the memory required from 65MB to 1 MB per 1000 datasets.



Rebuild will not record the total number of records properly. 

Adjusted the internal counters to keep up with the highspeed rebuild functions.



In certain circumstances, field insertion would insert some garbage info into the record. 

Fixed the internal memory re-alloc function that creates memory blocks modulo 16 bytes.



In non-shared modes, VsamPut will sometimes return error 1014. This is a special error indicating that the in-memory hash tables are returning an invalid value 

Re-established the table counter (removed by mistake). Optimized memory allocation routines were changed to inappropriately zero this counter.



VsamEx is now compatible with all Windows OS versions starting with Win98 through Windows XP and Windows 2K3 Server

Modified some internal API calls to remove OS dependencies.



VsamEx fails to reconstruct Large records (>GroupSize/2) from datasets converted from VB/ISAM datasets.

Fixed the record assembly code to properly check for new/old record type.


VsamVal function fails in logical mode when run against converted VB/ISAM versions of the VsamEx dataset.

Corrected the test for new and old format low level records.



Under certain obscure circumstances, field updates/replacements will expand the low level record size causing the dataset to accumulate extreme amounts of wasted space.

Corrected the process of expanding and contracting a low level record.



Record updates that cause the dataset to exceed its maximum size will create a corrupted dataset that requires a rebuild to correct the problem.

Properly detect the database full condition and properly return the VIS_NO_ROOM error code.


Large records that included large string fields or string fields with binary zeros would create unusual datasets that could expand the dataset size by a factor of 10

Corrected certain calculations to use unsigned arithmetic instead of signed arithmetic.


Rebuild fails to properly rebuild datasets with a mixture of old VB/ISAM record formats and new Vsam record formats.

Rebuild was fixed to properly rebuild datasets with a mixture of old VB/ISAM record formats and new Vsam record formats.


Auto conversion from VB/ISAM datasets to Vsam was enhanced to utilize a ".isc" file that if present will predefine Vsam Field definitions as follows:

1. The first text line defines the Key.

2. Each subsequent text lines define other fields in sequence as found in the Format String from the VB/ISAM dataset.

The line format is comma delimited:

[Field Name, Display Width, Display-Justification]



 Included in this release.



The system would not rebuild Xref Indexes properly if they contained just a LF ("\n") without the CR ("\r")

Modified the Sort/Insert to check for CR and LF characters as separate elements as well as CRLF pairs.


VsamSetFieldAttribute would fail to remove a non-protected field attribute when the field data was NULL.

Properly handle the NULL case.


The system does not generate an error when creating indexes in fields above 150 - per documentation. This results in odd behaviour when searching through xref's.

Added additional checks to return an appropriate error code if the user asks to create an index in a field > 150.


VsamExplorer functionality allow the user to have too much control over an existing dataset. Additionally, it includes test functionality that would be better in a separate Tools module

We split the old Explorer into two parts. The first is an explorer that will allow the user to explore datasets without many of the extended features like Rebuild. The Second part is called VsamTool and it contains all of the functionality and test utilities useful to the Application developer.


After the initial conversion of a VB/ISAM DataSet to the VsamEx form, VsamRead/Previous fails.

Modified the next and previous routines to properly handle mixtures of old and new records.


VsamExplorer fails to handle compound keys properly

Added Compound key features to the EditField and Addfield modules.


An instance of a field could be changed but it could never be set to NULL or removed from the record.

Allow Null field instance in VsamStoreField to remove the instance of a field. This allows records to be written with no field data. In other words a record with no data at all!  For each type,  VsamStoreField is called with a 0 (NULL) pointer to the field data.

For VsamPut,  if the Record Pointer is NULL (0), VsamEx will write a "NULL" record.


Data definitions becomes corrupted by making a field attribute value shorter. Deleting indexed fields leaves invalid data definition information around.

Corrected Data definition manipulation. Added two new functions for Exporting and Importing Data definition strings. This allows the Application programmer to create backups of good Data definition records. This is useful for distribution of updated Data definitions to customers.


Deleting field definitions would subsequently report errors while fetching records and/or re-displaying field definitions

Fixed VsamEx[plorer] and VsamEx[treme] to account for deleted fields that have not yet been completely removed. Fixed a bug in Data definition manipulation causing junk to remain inside the data definition record.


VsamDeleteField fails to remove a field definition from the dataset. Rebuild will re-instate a deleted field

Properly check for deleted field definitions in VsamOpen. Modified the VsamRebuild function to purge deleted fields from remaining records and then remove the field definition marked as deleted.


Multi User fails to lock the map properly and compromises the DataSet integrity.

Proper locking technique implemented for the low level routines

 Software Source P.O. Box 23306, San Jose, California 95153 408-887-7367 - Email: software_src@earthlink.net