9.42 DELETE_CHECKS
Deletes standard DICTIONARY or FILE level validation checks from a nominated field for subsequent replacement by PUT_XXXXXXX validation check Built-In Functions.
When deleting FILE level validation checks from a field, the file involved must have been previously placed into an edit session by the START_FILE_EDIT Built-In Function.
Normal authority and task tracking rules apply to the use of this Built-In Function.
This is a Specialized Built-In Function for use in a Development Environment only.
Arguments
No | Type | Req/ Opt | Description | Min Len | Max Len | Min Dec | Max Dec |
|---|---|---|---|---|---|---|---|
1 | A | Req | Level of validation checks that are to be deleted. D = Dictionary level F = File level | 1 | 1 | ||
2 | A | Req | Name of field in dictionary or file from which validation rules are to be deleted. | 1 | 10 | ||
3 * | N | Req | Sequence number to control deletion. Only checks with a sequence number greater than or equal to this value are deleted. If this argument is not specified, a value of zero (0) is assumed, so all checks will match this control value. | 1 | 3 | 0 | 0 |
4 * | A | Req | Generic description of check used to control deletion. Only checks which have a description generically matching this value will be deleted. If this value is not specified, a default value of blanks is assumed, so all checks will match this control value. | 1 | 30 |
* The deletion control sequence number and description are related by an "AND" relationship. So if you pass values of 500 and IEW, only checks that have a sequence number greater than or equal to 500 and a description that starts with IEW will be deleted.
Return Values
No | Type | Req/ Opt | Description | Min Len | Max Len | Min Dec | Max Dec |
|---|---|---|---|---|---|---|---|
1 | A | Req | Return code OK = validation check defined ER = fatal error detected NR = no records found eligible for deletion In case of "ER" return code error message(s) are issued automatically. When a file edit session is involved it is ended automatically without commitment. | 2 | 2 |
Example
A user wants to delete validation checks for a specific field, without going through the LANSA options provided on the Field Control Menu that enables the user to delete validation checks.
********* Define arguments and lists
DEFINE FIELD(#LEVEL) TYPE(*CHAR) LENGTH(1) LABEL('Level')
DEFINE FIELD(#FIELD) TYPE(*CHAR) LENGTH(10) LABEL('Field')
DEFINE FIELD(#SEQNUM) TYPE(*DEC) LENGTH(3) DECIMALS(0)
LABEL('Sequence #')
DEFINE FIELD(#DESCR) TYPE(*CHAR) LENGTH(30) LABEL('Description')
DEFINE FIELD(#RETCOD) TYPE(*CHAR) LENGTH(2) LABEL('Return code')
GROUP_BY NAME(#VALCHK) FIELDS((#LEVEL) (#FIELD) (#SEQNUM) (#DESCR))
********* Request Validation check details
BEGIN_LOOP
REQUEST FIELDS(#VALCHK)
********* Execute built-in-function - DELETE_CHECKS
USE BUILTIN(DELETE_CHECKS) WITH_ARGS(#LEVEL #FIELD #SEQNUM
#DESCR) TO_GET(#RETCOD)
********* Deletion of validation checks was successful
IF COND('#RETCOD *EQ ''OK''')
MESSAGE MSGTXT('Deletion of validation check(s) was successful')
********* Deletion of validation checks failed
ELSE
IF COND('#RETCOD *EQ ''ER''')
MESSAGE MSGTXT('Deletion of validation check(s) failed')
********* No records found eligible for deletion
ELSE
IF COND('#RETCOD *EQ ''NR''')
MESSAGE MSGTXT('No Records found eligible for deletion')
ENDIF
ENDIF
ENDIF
END_LOOP