Use a Criteria block to specify a test that will result in a true/false condition. A test is established by including FIELD statements in this block. If a true condition prevails, the interface populates the InfoMan record with information from other FIELD statements, found in the Populate block.
When no test is specified in the Criteria block, a true condition is assumed to exist, and the Populate block FIELD statements are executed automatically.
Criteria blocks are (Optional) One Criteria block is allowed per Label block.
The syntax is:
CRITERIA;
FIELD statements
IFYES/IFNO statements
ECRITERIA;
The following describes the components of this syntax:
(Required) CRITERIA must be the first word in a Criteria block, and must be followed by a semicolon.
FIELD statements establish the conditions for populating InfoMan records. FIELD statements are described in a later section.
Valid only in Criteria block FIELD statements. Used to specify processing when the test established in the FIELD statement is true (IFYES) or false (IFNO). IFYES/IFNO statements are described in a later section.
(Required) ECRITERIA must be the last word in a Criteria block, and must be followed by a semicolon. If you want to populate an InfoMan record at this exit point without testing any fields, you must code a null Criteria block. A null Criteria block looks like this:
CRITERIA; ECRITERIA;
When coding Criteria blocks, keep in mind that the interface supports storing information only in InfoMan X-type records (freeform text) and R-type records (Response records). Of these two record types, the interface allows you to retrieve for scanning only the R-type records. This means that FIELD statements in Criteria blocks should examine only InfoMan fields that contain R-type records.
Note: For more information about X-type records and R-type records, see your InfoMan documentation.
Example (No Criteria)
Here is an example when there is no criteria, but the user wants to populate an InfoMan record. This use of the CRITERIA statement is common within a Label block associated with a NOTFOUND statement, as shown below.
USE (ARCHIVE, BEFORE, STANDALONE);
NOTFOUND (CREATE,ARC0010);
FOUND (ARC0020);
LABEL ARC0010; /* CHANGE RECORD NOT FOUND: CREATE ONE */
CRITERIA;
ECRITERIA;
POPULATE;
FIELD PANEL(BLG6REQN) INDEX(S0B59) VALUE(=USER);
FIELD PANEL(BLG6STAT) INDEX(S0BEE) VALUE('OPEN');
FIELD PANEL(BLG6DSAB) INDEX(S0E0F)
VALUE('API CREATE CHG RECORD');
EPOPULATE;
RC(0);
ELABEL;
Example (FIELD statements in both the Criteria and Populate blocks)
Here is an example of FIELD statements in both the Criteria and Populate blocks.
LABEL CFM0010; /* SHIP CONFIRM AFTER - LOG SECTION */
CRITERIA;
FIELD (=PECBSFNM) VALUE ('CONFIRM ');
ECRITERIA;
POPULATE;
/***************************************
* PREQDEST: SHIP DESTINATION *
* PREQSCNF: SHIP CONFIRMATIN TYPE *
* PREQSRES: SHIP CONFIRMATION RESULTS *
* PREQSRCV: SHIP CONFIRM RC VALUE *
****************************************/
FIELD PANEL(BLG0C010) INDEX(S0E01)
TEXT ('SHIP: DESTINATION =PREQDEST CONFIRM TYPE =PREQS CNF') -
(' CONFIRMATION RESULTS =PREQSRES =PREQSRCV');
EPOPULATE;
ELABEL;
Example (IFYES/IFNO conditions in the Criteria block, in addition to FIELD statements)
Here is an example that includes IFYES/IFNO conditions in the Criteria block, in addition to FIELD statements.
LABEL RET0022; /* STATUS NOT OPEN - CHECK FOR INITIAL */
CRITERIA;
FIELD PANEL(BLG6STAT) INDEX(S0BEE) VALUE('INITIAL');
IFNO;
RC (8);
MSG ('INVALID STATUS - MUST BE INITIAL OR OPEN');
EIF;
ECRITERIA;
POPULATE;
EPOPULATE;
ELABEL;
|
Copyright © 2013 CA.
All rights reserved.
|
|