Table of Contents

Search

  1. Preface
  2. PowerExchange Navigator Introduction
  3. Data Maps
  4. Data Maps for Specific Data Sources
  5. Copybooks
  6. Registration Groups and Capture Registrations
  7. Extraction Groups and Extraction Maps
  8. Personal Metadata
  9. Database Row Test
  10. PowerExchange Navigator Examples
  11. Appendix A: PowerExchange Functions for User-Defined Fields
  12. Appendix B: User Access Method Programs
  13. Appendix C: Application Groups and Applications
  14. Appendix D: Data Map Properties
  15. Appendix E: Record, Field, and Table Properties
  16. Appendix F: DTL__CAPXTIMESTAMP Time Stamps
  17. Appendix G: Trace for Creating a Memory Map When Importing a COBOL Copybook

Navigator User Guide

Navigator User Guide

User Access Method Programs Overview

User Access Method Programs Overview

Create a user access method program written in Assembler, C, or PL/I to process data in a data map.
You call the user access method program by defining a data map with the USER access method and specifying the attributes of the user access method program, including the name of the compiled user access method DLL or shared library, parameters to pass to the program, and the full path and name of the associated data file.
A user access method program has a single entry point. PowerExchange calls the user access method program repeatedly to process the data in the associated data file until all the data is processed.
The following table lists the calls that PowerExchange makes to a user access method program and describes the actions that the program might take in response to a call:
Call
Possible User Access Method Program Actions
OPEN
Open the data file and perform initialization, as follows:
  • Allocate storage.
  • Validate and save any passed parameters.
  • Initialize counters.
  • verify that the data file exists.
  • Open the data file.
  • If the target is to be replaced, delete the output file.
  • Return a success or error code to the PowerExchange Navigator.
READ
Start or continue sequential reading, as follows:
  • Read the data file to get the next record, using any SQL statement passed from the PowerExchange Navigator to get the appropriate record.
  • Pass the data back to the PowerExchange Navigator by setting the record pointer to point to the data, and setting the value in the record_len field to the length of the data being returned.
  • Return a success, end-of-file, or error code to PowerExchange.
WRITE
Start or continue sequential writing, as follows:
  • Get the data to write by using the record pointer and the length set in the record_len field.
  • Write the specified data.
  • Return a success or error code to the PowerExchange Navigator.
CLOSE
Perform clean-up operations, as follows:
  • Close the data file.
  • Release allocated storage.
  • Commit the database.
  • Return a success or error code to the PowerExchange Navigator.
  • If an error occurs, place message text in the message buffer. The message buffer holds a 79-character message.
  • Pass control back to the calling program.
PowerExchange passes the user access method program a parameter structure with every call. The parameter structure includes the parameters that you define in the user access method data map.
The user access method passes a return code back to the PowerExchange Navigator to indicate the success or failure of the call, or to indicate that the end of the data file was reached.

0 COMMENTS

We’d like to hear from you!