FA API Changes (V9.0)
FA: File Access (Without File Handling)
This API can be used to retrieve an individual field from a specific record in a file without specifying the file in the program and without opening and closing the file. In its simplest form, one can, for example, retrieve a specific customer’s name in a single RD API call. Using more API options and multiple API calls, one can list all the customer names in the file. This API is only available for the files that are available using DDF names.
The changes displayed in bold below are changes to the API for V9.0.
Screen Parameters: FA,RD,id,rc - Read file and return field value
Input:
Id = package id (optional, SY is default)
rc = Return pointer to record
Passing-Note-File-Name = file, e.g., ARCUSFIL
Passing-Note-File-Ref-Number = primary key, e.g., 000100
Screen-Alpha-Field = DDF field name, e.g., CUS_NAME
Output:
Screen-Alpha-Field = field value if successful and field is not numeric
Screen-Numeric-Field = field value if successful and field is numeric
Screen-Answer = “Y” if successful, “N” if not
If not successful, Screen-Alpha-Field contains the file status code.
Note: If the file is not already opened by a FA,OP call, it will be opened and closed automatically.
Screen Parameters: FA,OP,id,md - Open the file
Input:
Id = package id (optional, SY is default)
md=Mode (optional, Input is default, IO is supported)
Passing-Note-File-Name = file, e.g., ARCUSFIL
Output:
Screen-Answer = “Y” if successful. “N” if not
If not successful, Screen-Alpha-Field contains the file status code.
Screen Parameters: FA,RW (New) - Rewrite a record
Input:
Passing-Note-File-Name = file, e.g., ARCUSFIL
Screen-Ptr =Address of record to be updated
Output:
Screen-Answer = “Y” if successful, “N” if not
If not successful, Screen-Alpha-Field contains the file status code.
Note:
An OP with IO for the mode is required before this call can be made. An
RD (read), RN (read next) or RP (read previous) is required before this call
can be made.
CLS