|
|
|
|
Ohio Educational Computer Network System (OECN)
|
| Previous | Contents |
Enter the value NU (for numeric) and press the [Return] key. The following screen should appear with the cursor at the "Prompting Text" field.
______________________________________________________________________________ | | | Rpw: REPORT2 REPORT DEFINITION MODIFICATION View: PRSPAY | | | |EMPLOYEE # LASTNAME DEPT. # WAGE CLASS SALARY | |********** *************** ******* ********** *********** | | | | 00-000 XXXXXXXXXXXXXXX 9999 9 $999,999.99 | | | | | | | | Input Fields: 0 INPUT FIELD DEFINITION | | | Input Field Name Type Prompting Text | | | | 1 IN_DEPTNO NU _____________________________________ | | | | | | | | DEFINE <PF2> help <PF4> finished | | | |____________________________________________________________________________| |
The "Prompting Text" is the text that will be displayed at generate time. The text entered here should be meaningful to the user generating this report. For this lesson, we want the user to enter the highest department number to be processed, therefore enter the text as illustrated next.
______________________________________________________________________________ | | | Input Fields: 0 INPUT FIELD DEFINITION | | | Input Field Name Type Prompting Text | | | | 1 IN_DEPTNO NU Enter the highest Department Number to process: | | | | | | | | DEFINE <PF2> help <PF4> finished | | | |____________________________________________________________________________| |
After the prompting text is entered, press the [Return] key. The cursor will go to the next line and prompt for another Input Field name. Since you are defining only one input field, press the [PF4] key to indicate that you are finished with this screen.
The following screen should appear:
______________________________________________________________________________ | | | Rpw: REPORT2 REPORT DEFINITION MODIFICATION View: PRSPAY | | | |EMPLOYEE # LASTNAME DEPT. # WAGE CLASS SALARY | |********** *************** ******* ********** *********** | | | | 00-000 XXXXXXXXXXXXXXX 9999 9 $999,999.99 | | | | | | | | Input Fields: 1 INPUT FIELD DEFINITION | | Input Field Name Type Prompting Text | | | | 1 IN_DEPTNO NU Enter the highest Department Number to process: | | | | | | | | | | | | INPUT FIELDS MENU <PF3> cancel <PF4> finished | | | | ADD an Entry REVIEW the Entries CANCEL | | INSERT an Entry CLEAR all Entries FINISHED | | CHANGE an Entry EXAMINE Format TOP | | DELETE an Entry | |____________________________________________________________________________| |
This screen allows you to make any changes to the input fields, including adding additional input fields or deleting input fields. These changes may be done at this point or at a later time.
3.4.3 Define CALCULATED Fields
Since no changes are to be made, press the [PF4] key
to indicate that you are finished. The following INPUT/CALC
MENU will be displayed.
_________________________________________________________________________________________ | | | Rpw: REPORT2 REPORT DEFINITION MODIFICATION View: PRSPAY | | | |=======================================================================================| |DD-MMM-YY HH:MN XM REPORT2 PAGE 9999| | Lesson 2 Report | | Data definition (PRSPAY) | |=======================================================================================| |EMPLOYEE # LASTNAME DEPT. # WAGE CLASS SALARY | |********** *************** ******* ********** *********** | | | | 00-000 XXXXXXXXXXXXXXX 9999 9 $999,999.99 | | | | | | | | | | | | | | | | INPUT/CALC MENU <PF4> finished | | | | Define an INPUT Field EXAMINE Format FINISHED | | Define a CALCULATED Field | |_______________________________________________________________________________________| |
You are now to define several calculated fields in order to do the following calculations for budget planning purposes:
For UDMS, you will use the following format:
CA_RAISE EQ CUR_SALARY * .07 WHEN
DEPTNO EQ 10 ELSE
EQ CUR_SALARY * .06
|
Thus, the calculated raise, CA_RAISE will be equal to the current value of CUR_SALARY times 7%, when the current value of DEPTNO is 10; otherwise, CA_RAISE will be equal to the current value of CUR_SALARY times 6%. The condition of DEPTNO equals 10 qualifies the value of the variable, CA_RAISE.
Select the option to "Define a CALCULATED Field".
Then select the "USER-DEFINED Calculated Fields" option as illustrated below.
_________________________________________________________________________________________ | | | DEFINE CALC FIELDS <PF3> cancel | | | | USER-DEFINED Calculated Fields <==== CANCEL | | LOAD Input Fields from existing Def TOP | | | |_______________________________________________________________________________________| g |
The CALCULATED FIELD DEFINITION screen now displays, prompting for the "Calc Field Name" as shown next.
_________________________________________________________________________________________ | | | Rpw: REPORT2 REPORT DEFINITION MODIFICATION View: PRSPAY | |....:...10....:...20....:...30....:...40....:...50....:...60....:...70....:...80....:..| |EMPLOYEE # LASTNAME DEPT. # WAGE CLASS SALARY CA_RAISE | |********** *************** ******* ********** *********** ********* | | | | 00-000 XXXXXXXXXXXXXXX 9999 9 $999,999.99 $9,999.99 | | | | | | | | Calc Fields: 0 CALCULATED FIELD DEFINITION Columns Avail: 19 | | Calc Field Name Typ Mask Field1 Opr Constant/Expr Field2 Cond | | | | 1 ___________... | | | | | | | | DEFINE <PF2> help <PF4> finished | | | | Enter a unique NAME, up to 32 characters in length, that will contain the | | resusltant claculated value of the associated definition. User-defined | | calcuations may be performed against constants, fields, functions or | | synonyms -- conditionally or unconditionally. | |_______________________________________________________________________________________| g |
In order to differentiate between fields selected from the data definition and new calculated fields defined for the report, it is customary to use a prefix of "CA" for the calculate fields.
Enter CA_RAISE for the calculated field name, and press [Return] to move to the "Typ" field.
The cursor prompts for "Typ", allowing you to indicate the field type which is to result from the calculation. You can specify one of the following types:
| Type | Calculated Value Requirements |
|---|---|
| NU | numeric string; any numeric character is valid. |
| AN | alphanumeric; causes the result to be any character (alphabetic or numeric). |
| TS | time stamp; includes date and/or time. The format used is YYYYMMDD_HR:MN:SS. |
| ET | elapsed time; uses the format DDDDD_HR:MN:SS.CC. |
In this case you want a numeric variable, so accept the default NU. If you press the [PF2] (HELP) with the cursor on this field, the following screen will appear.
_________________________________________________________________________________________ | | | Rpw: REPORT2 REPORT DEFINITION MODIFICATION View: PRSPAY | |....:...10....:...20....:...30....:...40....:...50....:...60....:...70....:...80....:..| |EMPLOYEE # LASTNAME DEPT. # WAGE CLASS SALARY CA_RAISE | |********** *************** ******* ********** *********** ********* | | | | 00-000 XXXXXXXXXXXXXXX 9999 9 $999,999.99 $9,999.99 | | | | | | | | Calc Fields: 0 CALCULATED FIELD DEFINITION Columns Avail: 19 | | Calc Field Name Typ Mask Field1 Opr Constant/Expr Field2 Cond | | | | 1 CA_RAISE NU | | | | | | | | DEFINE <PF2> help <PF4> finished | | | | Enter the DATA TYPE for | NU Numeric | | this Calc field: | TS Time Stamp | | | ET Elapsed Time | | | AN Alphanumeric | |_______________________________________________________________________________________| g |
Now press the [Return] key. The cursor will now prompt for the "Mask" that will be applied to the Calc field, CA_RAISE. To mask a numeric field, you will use a 9 for each significant digit you expect from the data and incorporate any other special characters desired (such as a dollar sign, comma, etc.) As you enter the mask, if the number of characters exceeds the displayed size of the field, a pop-out window will appear to accomodate the full entry.
Type in the value, $9,999.99 , for the mask. Note the pop-out window appears as is shown in the next screen.
_________________________________________________________________________________________ | | | Rpw: REPORT2 REPORT DEFINITION MODIFICATION View: PRSPAY | |....:...10....:...20....:...30....:...40....:...50....:...60....:...70....:...80....:..| |EMPLOYEE # LASTNAME DEPT. # WAGE CLASS SALARY | |********** *************** ******* ********** *********** | | | | 00-000 XXXXXXXXXXXXXXX 9999 9 $999,999.99 | | | | | | | | Calc Fields: 0 CALCULATED FIELD DEFINITION Columns Avail: 26 | | Calc Field Name Typ Mask Field1 Opr Constant/Expr Field2 Cond | | | | 1 CA_RAISE NU $9,999.9 | | |сссссссссссссссссссссссссссссссссссссссссссссссс| | | | $9,999.99 | | | | | | | |сссссссссссссссссссссссссссссссссссссссссссссссс| | | | | ADD <PF2> help <PF3> cancel <PF4> finished | |_______________________________________________________________________________________| g |
Now press the [Return] key to accept the entry.
The cursor will now prompt for "Field1", (the data field against which the arithmetic computation will take place.) The field listed here must already be included in the Report Field list. In PRSPAY, the field containing the salary amount is called, CUR_SALARY. If you forget the name of the field, you can press the [PF1] key to show a list of the available fields and can select the field from there.
Type in the field name, CUR_SALARY, and press [Return]. The cursor now prompts for the "Opr". There are several operators available. Press the help key, [PF2] to bring up a list of operators as shown in the next screen.
_________________________________________________________________________________________ | | | Rpw: REPORT2 REPORT DEFINITION MODIFICATION View: PRSPAY | |....:...10....:...20....:...30....:...40....:...50....:...60....:...70....:...80....:..| |EMPLOYEE # LASTNAME DEPT. # WAGE CLASS SALARY | |********** *************** ******* ********** *********** | | | | 00-000 XXXXXXXXXXXXXXX 9999 9 $999,999.99 | | | | | | | |Calc Fields: 0 CALCULATED FIELD DEFINITION Columns Avail: 26 | | Calc Field Name Typ Mask Field1 Opr Constant/Expr Field2 Cond | | | | 1 CA_RAISE NU $9,99... CUR_SALARY *_ | | | | | | | | | | | | DEFINE <PF1> select <PF2> help <PF3> cancel | | | | Enter an appropriate | * multiplication | concatenation (AN only) | | Operator for the type | / division ^ exponential | | of calculation to be | + addition | | performed: | - subtraction | |_______________________________________________________________________________________| g |
| Previous | Next | Contents |