In this section:
Reference: |
Before you can use any commands that write to an Adabas data source, you must make the following edits to the Master and Access Files:
In the Master File:
Tip: For best performance, you can change ACTUAL format Z to ACTUAL format P in the Master File. In this case, you must also change the ALIAS attribute to contain the length and data type. If the ALIAS was ff, and the field length is lll, the ALIAS attribute should be coded as:
ALIAS = 'ff,lll,P'
For example, consider the following field declaration:
FIELD = LEAVE_DUE ,ALIAS = AU ,USAGE = P2 ,ACTUAL = Z2 ,$
You would edit this declaration as follows:
FIELD = LEAVE_DUE ,ALIAS = 'AU,2,P' ,USAGE = P2 ,ACTUAL = P2 ,$
(FOC4565) IGNORED ATTEMPT TO CHANGE NONUPDATABLE FIELD
In the Access File:
UNQKEYNAME=name
where:
Is the name of the elementary or group field to be used as the unique key.
The UNQKEYNAME attribute does not necessarily define the key described in the Adabas FDT (option UQ). The adapter uses it to decide which rules to apply in a NEXT, INCLUDE, DELETE, or UPDATE command. If the UNQKEYNAME attribute does not correspond to the key described with option UQ in the Adabas FDT, Adabas and the adapter may not agree on whether a segment instance is unique. This can affect the results of INCLUDE commands, as described in Effect of UNQKEYNAME on INCLUDE Actions for Segments With ACCESS=ADBS.
If this attribute is not present, the adapter uses the rules for modifying a segment with a non-unique key. If it is present, the adapter uses the rules for modifying a segment with a unique key. Subsequent sections describe these rules.
Note: For modifying Adabas data sources with Maintain, the UNQKEYNAME attribute in the Access File is required. Otherwise you can use only commands that do not change the data source (such as TYPE) and can only issue requests against single-segment data sources.
We recommend the use of CALLTYPE=FIND instead of CALLTYPE=RL.
You can use AUTOADBS to create a Read version of the Master File. To convert it to a Write version, change the SEGTYPE value in all segments to S0.
When using the Write adapter, the adapter automatically sets the values of the following two options:
Reference: |
For both MODIFY and Maintain, certain types of fields listed in the Master File cannot be updated. In some cases, the update commands are ignored, and in some cases they generate errors. The following sections contain a detailed explanation.
In a Master File, two or more field declarations can refer to the same Adabas field. Each duplicate field declaration after the first is called a synonym. Synonyms can be used in commands that print, but cannot be used in commands that change the data source. The following actions occur as a result of using synonyms in INCLUDE/UPDATE commands:
An UPDATE command was used against a nonupdatable field, i.e. - field described in AFD as SUB/SUPERDESCRIPTOR or part of it; - field that refers in MFD to the same DB field (ALIAS) as another field (synonym case).
In MODIFY, update commands for the following types of fields are ignored:
In MODIFY, update commands for the following types of fields generate an error:
Maintain generates an error in response to update commands for the following types of fields:
The Dialogue Manager status return variable &RETCODE indicates the status of FOCUS requests. You can use it to test Adabas return codes. The &RETCODE variable contains the last return code resulting from an executed report request or MODIFY request.
In a Dialogue Manager request, you can use a -IF statement to test the &RETCODE value against a specified Adabas return code. Then, you can take corrective actions based on the result of the -IF test. An Adabas return code of zero (0) indicates a successful execution, a non-zero return code indicates an error.
Another useful Dialogue Manager variable, &FOCERRNUM, stores the last FOCUS or adapter (not Adabas) error number generated by the execution of a FOCEXEC. See your FOCUS documentation for information about &FOCERRNUM and other statistical variables.
Information Builders |