How Easytrieve can read a VSAM file using only a partial key
search cancel

How Easytrieve can read a VSAM file using only a partial key

book

Article ID: 55716

calendar_today

Updated On:

Products

Easytrieve Report Generator

Issue/Introduction

How Easytrieve can read a VSAM file using only a partial key?
The functionality of partial keys is not supported within the product.
See below for a workaround to this.

Environment

Easytrieve Plus Report Generator, release 6.4

Resolution

  1. Set up a full length key in working storage
  2. Use the partial key and fill the rest of the defined key with spaces
  3. Use the working storage field as the key in the POINT statement
  4. Check the status
  5. Do a GET using the same key


The above assumes that you understand your data and the consequences of using a partial key. Easytrieve does not recognize that a partial key is being used and, as with any programming language, the coding technique shown should be used with the understanding that partial keys are not supported with Easytrieve.

Example:
If a VSAM file key is defined as 26 and you want to read generically using the first 13 positions, then you must use a POINT with a 26 byte field with only the first 13 bytes filled in. Then, you would do a GET to obtain the record. You must test the first 13 bytes of that record obtained with the GET in order to make sure it is a match.