Version 8.2.3
 —  User's Guide  —

Working with the Worksheet

This section describes the Worksheet and how to use it.

This section covers the following topics:


What is the Worksheet?

The Worksheet is invoked when you add or modify a transaction. When you are adding a transaction, the Worksheet is empty when it first appears.

The Worksheet consists of columns. Different versions of the Worksheet appear according to the mode you are working in. For example, if you are using the report type TABLE, the Sequence column does not appear and the Option column only appears if you are adding or modifying certain types of data maintenance transaction.

Reference Columns

The following columns provide field information and are always displayed:

Input Columns

The following are input columns and may not always be displayed:

The number and type of columns which are displayed depend on the type of transaction you are adding or modifying.

Function Codes

You can enter two-letter function codes in all of the input columns except for the Field Name column and the Text Variable column.

If you are not sure what to enter in the columns, you can use the online help system to obtain information.

Start of instruction setTo obtain information on what to enter in a column

Column Protection - Columns "Closed"

When you have selected a field, the columns you can use in conjunction with it are opened. The input fields in the Worksheet columns open and close according to the entries you make on the Worksheet and elsewhere in Super Natural. Super Natural only allows you to make an entry where an entry is meaningful. For example, you cannot define a sort or control break for a group field and you cannot display a phonetic descriptor.

Top of page

Field Reference Column

The Reference (Ref) column contains two-letter field references from AA to ZZ given by Super Natural. The reference identifies the field's position within the file. You can always use a field reference instead of a field name.

The fields of the file or files you have chosen are given the first field references. When you create a transaction, the list of field references starts at the first undefined field. For example if you have chosen a file which contains 26 fields, the field reference list starts at the field reference BA.

Note:
The letters in the Reference column have nothing to do with database field references.

Top of page

Database Reference Column

The Database Reference (DB) column contains up to four one-character abbreviations which give you information on the fields selected.

The following tables show the abbreviations and their descriptions.

Position 1

The first position in the Database Reference column shows which file the field comes from.

Abbreviation Description

1 Primary File
2 Secondary File
L Lookup File

Position 2

The second position in the Database Reference column shows information on the type of field selected.

Abbreviation Description

No abbreviation Elementary field or multiple-value field
G Periodic group or group
H Hyperdescriptor (Adabas only)
I Input field
K Key field
N Non-database key field
P Phonetic descriptor (Adabas only)
S Super- or subdescriptor
U User field
V System variable
# Dynamic input field

For further information on field types, see Defining Fields.

Position 3

An asterisk (*) in the third position indicates that the field is a multiple-value field or a periodic group.

Position 4

The numbers in the fourth position indicate the level of the field as follows:

Level No Description

No number Field not contained in a group or periodic group
2 Part of group or periodic group
3 Part of group within a group or periodic group

Examples

DB Column Content Field Type Indicated

1_ _ _ Elementary field (primary file)
1K_ _ Elementary key field (primary file)
1_*_ Multiple-value field (primary file)
1_ _ 2 Elementary field in group (primary file)
1K _ 2 Key field in group (primary file)
2G*_ Periodic-group (secondary file)
2_ _3 Elementary field in group within group (secondary file)
1_ *3 Multiple-value field in group within group (primary file)
1G_ _ Group field (primary file)
1_*2 Multiple-value field in periodic-group (primary file)
1S_ _ Super- or subdescriptor (primary file)
2P_ _ Phonetic descriptor (secondary file)
L_ _ _ Elementary field (lookup file)

Top of page

Field Name Column

Use the Field Name column to select the fields you want to use. As well as database fields you can use user fields, and system variables. If you are adding a transaction with the transaction mode Data Selection WORK FILE or PC FILE, you use input fields. The different types of fields are described in detail in the section Fields. System variables are described in detail in System Variables.

Field Order

The fields which appear in the Field Name column are automatically sorted in order of their field references. Database fields are listed first, then user fields and then system variables.

Selecting Fields Directly

If you already know which database fields, input variables or system variables you want to use, you can select them directly.

Start of instruction setTo select fields directly

Selecting Database Fields Using the Field Selection List Window

If you do not know which fields the file contains, or if you want to save on typing, you can invoke the Field Selection List window.

For further descriptions on the DB column, see Database Reference Column

Start of instruction setTo select database fields using the Field Selection List window

  1.  15:50                      ***** Super Natural *****                 2000-06-21
     LIST                             - Worksheet -                           SN3011
                          !---------------------------------------------------------!
     Ref DB    Field Name !                   Field Selection List                  !
     AA  1K    PERSONNEL- !      Field Name                       Format DB    Info !
     AE  1K 2  NAME ..... !   _  FULL-NAME                               1G    __   !
     AH  1     SEX ...... !   _  FIRST-NAME                       A20    1  2  __   !
     AI  1K    BIRTH .... !   _  MIDDLE-I                         A1     1  2  __   !
     AM  1K 2  CITY ..... !   _  MIDDLE-NAME                      A20    1     __   !
     BL        __________ !   _  MAR-STAT                         A1     1     __   !
     BM        __________ !   _  BIRTHP                           P6     1K    __   !
     BN        __________ !   _  FULL-ADDRESS                            1G    __   !
     BO        __________ !   _  ADDRESS-LINE                     A20    1 *2  __   !
     BP        __________ !   _  ZIP                              A10    1  2  __   !
     BQ        __________ !   _  POST-CODE                        A10    1  2  __   !
     BR        __________ !   _  COUNTRY                          A3     1  2  __   !
     BS        __________ !   _  TELEPHONE                               1G    __   !
     BT        __________ !   _  AREA-CODE                        A6     1  2  __   !
                          !                                                         !
                          ! More:   +                                               !
                          !---------------------------------------------------------!
     Command ===>
     Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
           Help                          Flip          +                     Canc
    4A¦                                                                 06,026

    Enter an asterisk (*) in the first position of the Field Name column.

    Or:
    Issue the FIELDS command.

    The Field Selection List window displays a list of all the fields contained in the file or files you are using apart from those already displayed in the Field Name column.

  2. Mark the fields you require.

  3. Press Enter.

    The fields are transferred to the Field Name column.

Selecting All Fields

Start of instruction setTo select all the fields in the file(s) you are using

Selecting System Variables Using the Field Selection List Window

If you don't know which system variables Super Natural offers, or if you want to save on typing, you can invoke the Field Selection List window for system variables.

Start of instruction setTo select system variables using the Field Selection List window

  1. Enter two asterisks (**) in the Field Name column.

    The Field Selection List window for system variables appears.

    The Field Selection List window for system variables displays a list of all the system variables available to you apart from those already displayed in the Field Name column.

  2. Mark the system variables you require.

  3. Press Enter.

    The system variables are transferred to the Field Name column:

Note:
System variables are described in detail in System Variables.

Defining User Fields and Dynamic Input Fields

Start of instruction setTo define a user field

  1. Enter a unique name in the Field Name column.

    The user field name can have a minimum of three characters and must not already exist in the file(s) you are using.

     14:07                      ***** Super Natural *****                04.Jan.1998
     SN3011                           - Worksheet -                           Monday
                                                                                    
     Ref DB    Field Name      +-----------------Define User Field-----------------+
     AE  1K 2  NAME .......... ! Field: USERFIELD1                                 !
     AY  1K    DID-BUSINESS-CO !                                                   !
     BA        userfield1_____ ! Name or value .. USERFIELD1______________________ !
     BB        _______________ ! Format ......... _                                !
     BC        _______________ ! Length ......... ___                              !
     BD        _______________ ! Dec. places .... _                                !
     BE        _______________ ! Subfield of .... ________________________________ !
     BF        _______________ ! Offset ......... ___                              !
     BG        _______________ ! Dynamic input .. _                                !
     BH        _______________ !                                                   !
     BI        _______________ +---------------------------------------------------+
        
    

    You can change the user field name in the Name or Value field as long as the field is not in use.

  2. Change field name if required.

  3. Enter the format of the field in the Format field.

  4. Enter the length of the field in the Length field.

  5. Enter the number of decimal places (numbers after the decimal point) the field should have in the Dec. Places field (numeric fields only).

  6. If you want to make a user field out of all or part of an existing field, enter the name of that field in the Subfield Of field.

    An example is shown below.

  7. If you want the user field to use part of an existing field, enter the number of positions to skip before the new field starts in the Offset field.

Start of instruction setTo define a dynamic input field

  1. Mark the Dynamic Input field if you want the field you are defining to be a dynamic input field.

    For further information on dynamic input fields, see Defining Fields.

  2. Press Enter.

    The user field or dynamic input field is defined.

Example of Subfield using Offset

For example, the field BIRTH-DATE in the file E-SAG-TOURS-PERSON is made up of eight digits: digits one, two, three and four indicate year of birth, digits five and six indicate month of birth, and digits seven and eight indicate day of birth:

graphics/graphic123.gif

Start of instruction setTo define a new field called DAY OF MONTH

Field Name Column and the Report Manager

When a layout is generated for a report, the system variables contained in the standard title appear in the Field Name column. The standard title supplied with Super Natural contains the system variables *TIMX, *DATX, *PROGRAM and *PAGE-NUMBER but your administrator may change this. If you delete the layout element title, the system variables still appear in the Field Name column but may be deleted.

Top of page

Text Variable Column

This column only appears for reporting transactions of the Report Type CON-NECT and is described in the section Super Natural and Con-nect.

Top of page

Sequence Column

Use the Sequence (Seq) column to determine the following:

If you mark the Sequence column next to a group, all the fields belonging to the group already listed in the Field Name column are automatically numbered.

You must mark at least one field in the Sequence column in order to run or save the transaction.

You can number up to 99 fields in the Sequence column. If you want to display more than 99 fields, you can mark them with a column number and a sequence letter as described later in this section.

Note:
If your report has Destination WORK FILE, PC FILE or USER FILE, the first 99 fields which are marked in the Sequencecolumn (whether marked with just a column number or with both a column number and a sequence letter) are written to file.

Note:
For earlier versions: If you did not mark any fields in the Sequence column in Super Natural Version 2.4 or below, a record count was performed and the number of records which met the selection criteria was returned. You must now use the COUNT command to achieve this.

Horizontal Output - Column number

Start of instruction setTo display a field horizontally

Numbering All Fields in the Sequence Column

Start of instruction setTo number all the fields in the Sequence column

Removing All Numbers from the Sequence Column

Start of instruction setTo remove all the numbers from the Sequence column

Vertical Output - Column number and sequence letter

You can choose to display fields beneath each other in a column instead of next to each other in a row.

Start of instruction setTo display a field vertically

Text Output - T and sequence number

Start of instruction setTo display a field as text

Sequence Column and Natural Report Manager

When a layout exists for a report, the Sequence column is protected. If an "L" appears in the Sequence column next to a field it means that the field has been used in the Layout Editor. You can make no further entries in the Sequence column until both the layout elements list and header are deleted. When you have deleted the layout elements list and header, the entries you made in the Sequence column before invoking Natural Report Manager reappear.

Definitions made in the Layout Editor override those made in the Sequence column. For further information on the Layout Editor, see Working with Natural Report Manager.

Top of page

Sort/Control Column

You use the Sort/Control (S/C) column to define sort fields and control fields. The sort level determines in which order the records found are sorted.

Sort Field

When you define a field as a sort field, the records found are sorted according to the field's alphabetical or numeric order (whether the field is displayed or not).

Start of instruction setTo define a sort field

Performance Note for Adabas Users

If the sort criteria consist of only key fields and no more than three key fields are specified, Super Natural invokes the Adabas sort feature instead of an operating system sort. Unless the number of values for a given key field is extremely large, an Adabas sort is more efficient than an operating system sort.

Control Field

When you define a field as a control field, the records found are sorted as for a sort field. In addition, you can define system functions which are calculated when the value or part of the value of the control field changes. For further information, see Function Column.

Start of instruction setTo define a control field

Sort Order

You can choose to display the records in ascending or descending order.

Start of instruction setTo define ascending order

Start of instruction setTo define descending order

Sort Level

The sort level determines the order in which the sorts for sort and control fields are performed. The sort with the lowest number is performed first.

Start of instruction setTo define the level of a sort

Top of page

Option Column

The Option (Opt) column only appears for data maintenance transactions of the type ADD, UPDATE SINGLE and UPDATE MULTIPLE and is described in the section Data Maintenance.

Top of page

Function Column

Defining System Functions at Control Breaks

System functions (SF) / (Func) are statistical functions available at control breaks. A control break occurs when the value of the control field changes.

graphics/graphic133.gif

Using system functions, you can calculate the total, sum, average value, minimum value and maximum value of the field specified and display the number of records found between control breaks. You can choose to ignore fields which contain the value zero when you calculate average, minimum and count. You can specify system functions either for the control field itself or for any other field when the value of the control field changes. You can also specify system functions at the Grand level where the values of the fields in all the records found are used.

graphics/graphic134.gif

graphics/graphic135.gif

Start of instruction setTo define system functions

  1. Enter SF in the Function column next to the field for which you want to calculate statistics at a control break.

    The Specify System Functions window appears as in the following example:

     15:10                      ***** Super Natural *****                04.Jan.1998
     SN3011                           - Worksheet -                           Monday
                                                                                    
     +--------------------------Specify System Functions---------------------------+
     ! Field: MOTOR                                                                !
     !                                                                  N   N   N  !
     ! Level  Control Field                    Cnt Tot Sum Avg Max Min Cnt Avg Min !
     ! Grand  End of Report                     _   _   _   _   _   _   _   _   _  !
     !     1  ID-CH-BASE                        _   _   _   _   _   _   _   _   _  !
     !                                          _   _   _   _   _   _   _   _   _  !
     !                                          _   _   _   _   _   _   _   _   _  !
     !                                          _   _   _   _   _   _   _   _   _  !
     !                                          _   _   _   _   _   _   _   _   _  !
     !                                          _   _   _   _   _   _   _   _   _  !
     !                                          _   _   _   _   _   _   _   _   _  !
     !                                          _   _   _   _   _   _   _   _   _  !
     !                                          _   _   _   _   _   _   _   _   _  !
     !                                                                             !
     +-----------------------------------------------------------------------------+
    
    

    The Specify System Functions window contains the following fields and columns:

    Field/Column Description
    Field The name of the field about which statistical information is to be given.
    Level and Control Field The first entries in these columns are always "GRAND" and "End of Report". You can choose a system function which uses the values of the fields in all the records found and displays the result at the end of the report. Further entries show which fields are defined as control fields and at which level.
    CNT (Count) You can mark the Count column to display the number of records found between control breaks.
    TOT (Total) You can mark the Total column to display the cumulative sum of the field values across all control breaks up to the present one.
    SUM You can mark the Sum column if you want to know the sum of the values of a field between control breaks.
    MIN (Minimum) You can mark the Minimum column to display the minimum field value between control breaks.
    MAX (Maximum) You can mark the Maximum column to display the maximum field value between control breaks.
    AVE (Average) You can mark the Average column to display the average field value between control breaks.
    N CNT (Null Count) You can mark the Count column to display the number of records found between control breaks. Null values are ignored.
    N AVE (Null Average) You can mark the Average column to display the average field value between control breaks. Null values are ignored.
    N MIN (Null Minimum) You can mark the Minimum column to display the minimum field value between control breaks. Null values are ignored.
    OLD Only available in Natural Report Manager via the Extended Field Editing window.
    This system function displays the value of the field prior to a control break.

    Note:
    Null values are zero for numeric fields and blank for alphanumeric fields.

    Columns which are not relevant to the field type you have chosen are protected.

  2. Make your entries in the Specify System Functions window.

    Note:
    If you only want report data to be output after each control break, use the transaction mode Report Level SUMMARY. For further information, see Defining Transaction Modes for Reporting.

The following screen is part of the report generated by the sample transaction SAMPLE2 which is described in the Tutorial:

graphics/graphic137.gif

Interfield Arithmetic

The Interfield Arithmetic (IA) feature is recommended only for users of previous versions of Super Natural.

You can also use the Function column to perform arithmetic calculations using interfield arithmetic.

Start of instruction setTo define interfield arithmetic

  1. Enter IA in the Function column next to a field you want to use in a calculation.

    The Interfield Arithmetic window appears:

     16:32                      ***** Super Natural *****                 1998-01-04
     EXA2                             - Worksheet -                           SN3011
                                                                                    
     Ref DB    Field Name               +----------Inter-Field Arithmetic----------+
     AB  1K    YACHT-NAME ............. ! Field: BUNKS                             !
     AD  1K    ID-CH-BASE ............. !                                          !
     AJ  1     DRAFT .................. ! Used to define arithmetic calculations.  !
     AN  1     BUNKS .................. !                                          !
     AQ        ________________________ ! The operators '+,*,-,/,=' are available. !
     AR        ________________________ ! Up to 10 separate calculations can be    !
     AS        ________________________ ! indicated (number 0 through 9).          !
     AT        ________________________ !                                          !
     AU        ________________________ ! Enter arithmetic expression: ______      !
     AV        ________________________ !                                          !
     AW        ________________________ +------------------------------------------+
     AX        ________________________________   ___   ___   __   __   __   __     
    
    
  2. Enter the operator which you want to act on the field.

    The arithmetic operators +, *, - and / are available.

  3. Repeat the above two steps for as many operators and operands as necessary.

  4. Enter IA in the Function column next to the field you want to be the result field.

    The result field can either be a database field or a user field and can already have been defined as an operand.

  5. Enter an equals sign (=) in the Interfield Arithmetic window.

    The result field must be defined before you use it in a calculation. For information on how to define a user field, see Defining User Fields and Dynamic Input Fields.

Example:

The following table shows what you must enter in the Interfield Arithmetic window to add the field XXX to the field YYY with the result being placed in the field YYY:

Field Entry in Interfield Arithmetic window

XXX +
YYY +=

Multiple Calculations

You can indicate up to ten separate calculations. If you enter more than one calculation, you must identify each one with a number (from 0 through 9) following the operator.

Example:

The following table shows what you must enter in the Interfield Arithmetic window to perform the following calculations:

XXX + YYY = YYY     (calculation 1)
AAA - (BBB * XXX) = CCC   (calculation 2)
Field Entry in Interfield Arithmetic window

XXX +1*2
YYY +1=1
AAA +2
BBB -2
CCC =2

Special Break Conditions

Using special break conditions (CB), you can make control breaks occur when the first n characters in the control field change. For example, you may want a control break to occur each time the first two characters of the field YACHT-NAME change.

Start of instruction setTo define special break conditions

  1. Enter CB in the Function column next to a control break field.

    The Special Break Conditions window appears as in the following example:

     16:32                      ***** Super Natural *****                 1998-01-04
     EXA2                             - Worksheet -                           SN3011
                                                                                    
     Ref DB    Field Name              +---------Special Break Conditions----------+
     AB  1K    YACHT-NAME ............ ! Field: YACHT-NAME                         !
     AD  1K    ID-CH-BASE ............ !                                           !
     AJ  1     DRAFT ................. ! Format .. A                               !
     AN  1     BUNKS ................. ! Length .. 30                              !
     AQ        _______________________ !                                           !
     AR        _______________________ ! Perform control break after change of the !
     AS        _______________________ ! first 'n' field characters.               !
     AT        _______________________ ! Do not enter any value if the complete    !
     AU        _______________________ ! length should be taken.                   !
     AV        _______________________ !                                           !
     AW        _______________________ ! First 'n' characters: __                  !
     AX        _______________________ !                                           !
     AY        _______________________ +-------------------------------------------+
    
    
  2. Specify the number of characters which must change before a control break occurs.

Top of page

Field Definition Column

Use the Field Definition (Def) column to change the output definition of any field or the field definition of a user field.

Output Definition

Output definition (OD) determines how a field should be displayed in a report.

Start of instruction setTo change a field's output definition

The Define Field Output window contains the following fields:

Field Description

Fieldname You may not modify the name of a database field. Once a user field has been used, you cannot change its name and format.
Format/Length You may not modify the length/format of a database field.
Numeric Sign (numeric formats only) If you enter "Y", a sign position is reserved for the field and the character - is printed before each negative value of the field. An entry made for this field may be modified in the layout editor.
Output Length Use this field to determine the number of positions to appear in the report. For numeric fields, this is the number of positions left of the decimal point.
Dec. Places (numeric formats only) Use this field to determine the number of positions to the right of the decimal point to appear in the report.
Heading Use this field to define which heading is to appear above the field in the report you are creating. If you leave this field blank, the field name is used.
Edit Mask You can enter any valid Natural edit mask here. Edit masks defined here have priority over other entries in this window. If this field already contains an edit mask, you can overwrite it. You can use this field to define leading, floating and trailing characters. For further information on edit masks, see Edit Masks. The online help for this field gives you examples of edit masks and possible resulting output.
Suppress Identical Values If you specify "Y", identical values for the field are suppressed.
Print Zero Values (numeric formats only) If you enter "N", the field value is printed as blanks if the value is zero.
Occurrences Use this field to define the maximum number of occurrences (i.e., values) to be displayed for multiple-value fields and fields that are contained in a periodic group. For multiple-value fields which are contained in a periodic group, the entry for (1) applies to the periodic group and the entry for (2) applies to the multiple-value field. If it is only a multiple-value field, the entry for (1) applies.

Field Definition

The Field Definition (FD) option is only available for user fields which have not yet been used. The Define User Field window appears as described in Defining User Fields and Dynamic Input Fields.

Top of page

Information (Info) Column

Use the Information column to obtain information about field attributes, values for key fields, field usage and dictionary information.

Field Attributes

Field Attributes (AT) information tells you how the field is defined in the database.

Dictionary Information

Dictionary information (PI) gives you first comments if available and then an extended field description from the data dictionary Predict. This feature is only available at sites where Predict is installed.

Values for Key Fields

You can use the Values for Key Fields (VA) function to obtain a list showing how many records contain values within a certain range for a certain field.

You can only use the Value for Key Fields function with key fields.

When you select the Values for Key Fields function, the Values window appears in which you can define the range of values you want to see. When you press Enter, you are shown the values present, the number of records which contain each value and the total number of values found.

Start of instruction setTo print Values for Key Fields information

Field Usage Information

Field usage (US) information tells you where the field in question is used in your transaction e.g. as a sort field, or in the Selection editor, or in SQL statements. This information is particularly useful when you want to delete a field from the field list.

Top of page

Delete Column

Use the Delete (Del) column to delete fields from the Field Name column on the Worksheet.

Deleting Fields from the Field Name Column

Start of instruction setTo delete a field from the Field Name column

Start of instruction setTo obtain information on where a field has been used

Returning Deleted Fields to the Field Name Column

You can return deleted fields to the Field Name column in several ways.

Start of instruction setTo return deleted fields to the Field Name column

Top of page

Commands Available from the Worksheet

The following commands are specific to the Worksheet:

Note:
For a list of the default PF key functions, see Using Super Natural.

Note:
For a list of commands available from within transactions, see Using Reporting Transactions.

Command (Abbreviation) Description
ALL (AL) Selects all the fields contained in the file(s) you are using and enters them in the Field Name column of the Worksheet.
FIELDS (FIE) Invokes the Field Selection List window (also available from the Selection, Calculation and Logical Conditions Editors).
NOSEQUENCE (NOS) Removes all numbers from the Sequence column in the Worksheet.
PRINT (PRI) Prints the information found by the Value function (also available for printing reports and transaction and user file information).
SEQUENCE (SEQ) Gives each field entered in the Field Name column a number in the Sequence column. Fields are numbered in ascending order from the top of the Worksheet to the bottom of the last page.
TRANSACTION (TR) Invokes the List Transaction screen (also available from the Menu and Object List screens).

Top of page