VSAM - Example: using dynamic access with VSAM files - www.cadcobol.com.br



Desenvolvido por DORNELLES Carlos Alberto - Analista de Sistemas - Brasília DF. - cad_cobol@hotmail.com

Example: using dynamic access with VSAM files

Enterprise COBOL for z/OS, Version 4.2, Programming Guide


Suppose that you have an indexed file of employee records, and the employee's hourly wage forms the record key.

If your program processes those employees who earn between $15.00 and $20.00 per hour and those who earn $25.00 per hour and above, using dynamic access of VSAM files, the program would:

  1. Retrieve the first record randomly (with a random-retrieval READ) based on the key of 1500.
  2. Read sequentially (using READ NEXT) until the salary field exceeds 2000.
  3. Retrieve the next record randomly, based on a key of 2500.
  4. Read sequentially until the end of the file.

Related tasks


© Copyright IBM Corp.