In: Computer Science
3 Company XYZ has four corporate functions: manufacturing, marketing, financial, and administrative. Each function in turn has several departments, as shown:
Function Departments
MANUFACTURING 10, 12, 16-30, 41, 56
MARKETING 6-9, 15, 31-33
FINANCIAL 60-62, 75
ADMINISTRATIVE 1-4, 78
Establish condition-name entries so that, given a value of EMPLOYEE-DEPARTMENT, you can determine the function. Include an 88-level entry. VALID-CODES, to verify that the incoming department is indeed a valid department. (Any department number not in the list is invalid.
COBOL
1). ANSWER:
GIVEN THAT:
Level-number 88 designates a condition-name entry. Level 88s are used to assign names to values at execution time. Thus, a condition-name is not the name of an item, but rather the name of a value. A level 88 doesn't reserve any storage area.
Each level 88 must be associated with a data item and must immediately follow that item in the Data Division. The associated data item is called a condition-variable. A level 88 may name a specific value, a set of values, or a range of values. For example:
EMPLOYEE-DEPARTMENT Departments 00 MANUFACTURING value
10, 12, 16-30, 41, 56 01 MARKETING value 6-9, 15, 31-33 02
FINANCIAL value 60-62, 75 03 ADMINISTRATIVE value 1-4, 78
This format associates a value, values, or ranges of values with a
condition-name. Each such condition-name requires a separate
level-88 entry. Level-number 88 and the condition-name are not part
of the format-2 VALUE clause itself. They are included in the
format only for clarity.
Format 2: condition-name value
condition-name-1
A client determined name that connects an incentive with a restrictive variable. In the event that the related contingent variable requires addendums or files, each procedural reference to the condition-name must be subscripted or listed as needed for the restrictive variable.
Condition-names are tried procedurally in condition-name conditions (see Conditional articulations).
literal-1
Associates the condition-name with a single value.
The class of literal-1 must be a valid class for assignment to the associated conditional variable.
literal-1 THROUGH literal-2
Partners the condition-name with in any event one scope of qualities. At the point when the THROUGH expression is used, literal-1 must be less than literal-2. For subtleties, see Rules for condition-name passages.
exacting 1 and literal-2 must be of a similar class. The class of literal-1 and literal-2 must be a substantial class for task to the related contingent variable.
When literal-1 and literal-2 are DBCS literals, the scope of DBCS esteems indicated by the THROUGH expression depends on the twofold grouping succession of the hexadecimal estimations of the DBCS characters.
When literal-1 and literal-2 are public literals, the scope of public character esteems determined by the THROUGH expression depends on the paired examining succession of the hexadecimal estimations of the public characters spoke to by the literals.
On the off chance that the related contingent variable is of class DBCS, literal-1 and literal-2 must be DBCS literals. The allegorical steady SPACE or the metaphorical consistent ALL DBCS-literal can be determined.
On the off chance that the related restrictive variable is of class national, literal-1 and literal-2 must be either both public literals or both alphanumeric literals for a given condition-name. The allegorical constants ZERO, SPACE, QUOTE, HIGH-VALUE, LOW-VALUE, symbolic-character, ALL national-strict, or ALL literal can be indicated.