Why does a VsamStoreField fail for the Primary Key field?
Remember when you write a record with VsamPut (after storing all fields except the primary) the Primary key is specified as a parameter to the VsamPut function. We have had discussions as to whether this should be wrapped into the record but we chose to support legacy systems (VB/ISAM) that use the concept that the Key is separate from the record, and thus passed as a separate parameter. While the actual key data is stored in the same location as the record, to be consistent, VsamStoreField fails on the Primary key field. Because of this, you can create a record in memory and clone it in the DataSet under different Primary Key names without changing the actual record (Just the Key). This is a good way to initialize a subset of records to the same set of field values.