This statement validates data against predefined values or edit rules.
This statement has the following format:
&CONTROL SHRVARS=(field name,$VM)
-EXEC $CACALL OPT=ACTION
ACTION=VALIDATE
CLASS=DATA
PARMS=‘[APPL=application id]
FIELD=field name
[LIST=n]
[TEXT={YES | NO}]
[ACTIVE={YES | NO | ANY}]
DESC=description
EDITS=edit number 1,edit number 2,...
[IMSYS=system name]
[PROMPT={YES | NO}]’
(Optional) (required only for EDITS=17) Specifies the application identifier.
Specifies the name of the field that is to be validated. This field name must also be included in the SHRVAR= operand.
(Optional) (required only for EDITS=18) Specifies the number of valid values supplied using the &$VMFULLnnn variables. The &$VMABBRnnn and &$VMDESCnnn variables can also be defined. The range is 1 through 999.
(Optional) (applicable only for EDITS=17) Specifies whether the text fields associated with the selected or supplied field value are to be returned.
Default: NO
(Optional) (applicable only for EDITS=17) Specifies which entries from the table defined for the field in FIELD are to be considered as valid values. Valid values are as follows:
Only active table entries are to be considered as valid values. This is the default.
Only inactive table entries are to be considered as valid values.
All table entries are to be considered as valid values.
(Optional for EDITS=17) Specifies the description of the field for use in selection list headings, help panels and error messages.
Specifies the edit numbers that indicate how the field is to be validated (multiple numbers can be specified, separated by commas). Valid values are as follows:
YES/NO—The field can only contain YES (or a string beginning with Y) or NO (or a string beginning with N). If the length parameter (l) is coded, the field is set to that length. For example, 1(1) returns Y or N only.
Unsigned Integer—The field can only contain a positive number with no sign or decimal point.
Date—The field can only contain the date format dd-mmm-yyyy or a shorthand date format.
Time—The field can only contain the time format hh.mm or a shorthand time format.
Hexadecimal—The field can only contain values in expanded hexadecimal.
Signed Numeric—The field can contain a signed or unsigned number with no decimal point.
Real Numbers—The field can only contain real numbers. This includes (signed and unsigned) integers, numbers containing a decimal point, and numbers expressed in scientific notation within the range -1E-70 to +1E+70.
Name—The field can only contain numbers, alphabetic characters (upper case), and the characters @, #, and $. The first character in the field cannot be a number.
Range—The field can only contain a value within the defined range, where l is the lowest valid value and h is the highest. If l is omitted, the value is only checked for being less than or equal to h; if h is omitted, the value is only checked for being greater than or equal to l, for example:
Alphanumeric—The field can only contain numbers and alphabetic characters. Lower case characters are converted to upper case.
Alphabetic—The field can only contain alphabetic characters. Lower case characters are converted to upper case.
National—The field can only contain numbers, alphabetic characters, and the characters @, # and $. Lower case characters are converted to upper case.
Data Set Name—The field can only contain a valid data set name, with no quotes. Lower case characters are converted to upper case.
No Embedded Blanks—The field cannot contain any imbedded blanks.
Length Of The Field—The length of the field must be within the defined range, where l is the lowest possible length and h is the highest. If l is omitted, the length is only checked for being less than or equal to h; if h is omitted, the length is only checked for being greater than or equal to l. The default value for l is 1.
Scroll Amounts—The field value must be one of the following valid scroll amounts:
Table—The field is validated against the values held in the table defined for the field in FIELD.
List—The field is validated against the values given in &$VMFULLnnn, &$VMABBRnnn, and &$VMDESCnnn.
NCL Keyword—The field must not contain an NCL keyword.
Time—The field can only contain the time format hh.mm.ss or a shorthand time format.
Hexadecimal Characters—The field can only contain hexadecimal characters, that is, 0–9 and A–F.
IP Address—The address must be a valid IP address, in the format A.B.C.D, where each of A, B, C, and D have a valid range of 0 to 255.
Time—The field must contain the time format hh:mm:ss or a shorthand time format. The returned string is in the format hh:mm:ss.
Time—The field can only contain the time format hh:mm or a shorthand time format. The returned string is in the format hh:mm.
(Optional) (required for EDITS=17 where the table type is IMFLD or IMREC) Specifies the CA SOLVE:InfoMaster name.
(Optional) (applicable only for EDITS=17 or 18) Specifies whether a list of valid values is to be displayed if the field value contains a question mark character (?). Specifying NO lets values be defined which contain a question mark (?), and also lets validation occur from a non-full screen environment.
This statement contains the following input variables:
The data to be validated
The full values of the values (up to 20 characters) against which the field is to be validated (applicable only for EDITS=18). Up to 999 full values can be specified.
The abbreviations of the values (up to eight characters) against which the field is to be validated (applicable only for EDITS=18). Up to 999 abbreviations can be specified.
The descriptions of the values (up to 38 characters) against which the field is to be validated (applicable only for EDITS=18). Up to 999 descriptions can be specified.
This statement contains the following return variables:
The validated data.
The abbreviated value of the selected value (applicable only for EDITS=17 or 18).
The description of the selected value (applicable only for EDITS=17 or 18).
The text associated with the value (applicable only for EDITS=17 and returned only if TEXT=YES).
System message. Contains the error message (for return code 8).
If a return code of 8 is set, then additional information is available as one of the following feedback codes, set in &$CAFDBK:
Processing error
Nesting level exceeded
The following statements validate the &PCODE field against edit numbers 2 (unsigned integer) and 9 (range). The value of &PCODE must be an unsigned integer in the range 1 through 10. In the example, because &PCODE has a value of 12, an error message is returned in &SYSMSG.
&PCODE = 12 &DESC = &STR Priority Code &CONTROL SHRVARS=(PCODE,$VM) -EXEC $CACALL OPT=ACTION ACTION=VALIDATE CLASS=DATA PARMS='APPL=$ML FIELD=PCODE DESC=&DESC EDITS=2,9(1:10)'
| Copyright © 2008 CA. All rights reserved. |
|