Sample 1: Basic Transaction

Task: Find the start and destination harbors of cruises with yachts of type ATLANTIC 29.

For this transaction, all you need to define are a primary file, display fields and selection criteria. These are the minimum requirements for a transaction.

Transaction Specification

Primary File SAG-TOURS-E-CRUISE
Display Fields 1: CRUISE-ID
2: START-HARBOR
3: DESTINATION-HARBOR
Selection Criteria CHARTER-YACHT-TYPE = 'ATLANTIC 29'

This section covers the following topics:


Create the Transaction SAMPLE1

Start of instruction setTo add a transaction

  1. Select Transaction from the Main Menu.

    Or:
    Issue the TRANSACTION command.

    The Transaction List screen appears. The Transaction List screen is an object list screen. For further information on object list screens, see Choosing an Object in Starting Up in the User's Guide.

  2. Type "SAMPLE1" in the Add field.

    Or:
    Issue the ADD TRANSACTION SAMPLE1 command.

    You can abbreviate this command to AD TR SAMPLE1.

    The Add Transaction window appears with the transaction name already entered in the Transaction ID field.

  3. Type the description "Basic Transaction" in the Description field (optional).

Start of instruction setTo Choose File

The report requires data from the file SAG-TOURS-E-CRUISE.

  1. Type an " asterisk (*)" in the File Name field.

  2. Press Enter.

    The File Selection List appears as in the following example:

     14:12                      ***** Super Natural *****                 1993-02-10
                                  - Transaction List -                        SN1110
                                                                                    
     Cmd  Name     Descript + +----------------File Selection List-----------------+
          *______           ! !     File Name                         Access  Info !
      __  CRUI     (93-02-0 ! !  _  SAG-TOURS-E-CH-PRICES               R      _   !
      __  CRUISE   (93-02-0 ! !  _  SAG-TOURS-E-COMPANY                 R      _   !
      __  CRUI2    (93-02-0 ! !  _  SAG-TOURS-E-CONTRACT                R      _   !
      __  DATE     (93-02-0 ! !  _  SAG-TOURS-E-CRUISE                  R      _   !
      __  PRICE    cruise p ! !  _  SAG-TOURS-E-PERSON                  R      _   !
      __  SAG-PER  93-01-27 ! !  _  SAG-TOURS-E-YACHT                   R      _   !
      __  SAMPLEX  simple t ! !  _                                             _   !
      __  SAMPLE2  ex3-02-0 ! !  _                                             _   !
      __  SAMPLE3  (92-12-1 ! !  _                                             _   !
      __  TRAN3    (93-02-0 + !  _                                             _   !
      __           __________ !  _                                             _   !
      __           __________ !  _                                             _   !
     Add  sample1             !  _                                             _   !
                              !                                                    !
     Cmd(s): Modify, Execute, +----------------------------------------------------+
     
    
  3. Mark SAG-TOURS-E-CRUISE either with any non-blank character or with the cursor position.

  4. Press Enter.

    The file name appears in the Add Transaction window as follows:

     14:12                      ***** Super Natural *****                 1993-02-10
                                  - Transaction List -                        SN1110
                                                                                    
     Cmd  Name     Descript +-------------------Add Transaction--------------------+
          *______           !                                                      !
      __  CRUI     (93-02-0 ! Transaction ID .... SAMPLE1                          !
      __  CRUISE   (93-02-0 ! Description ....... basic transaction_____________   !
      __  CRUI2    (93-02-0 !                     ______________________________   !
      __  DATE     (93-02-0 !                                                      !
      __  PRICE    cruise p ! File name ......... SAG-TOURS-E-CRUISE______________ !
      __  SAG-PER  93-01-27 !                                                      !
      __  SAMPLEX  simple t ! Modify modes ...... _                                !
      __  SAMPLE2  ex3-02-0 ! Data maintenance .. N (Y/N)                          !
      __  SAMPLE3  (92-12-1 !                                                      !
      __  TRAN3    (93-02-0 +------------------------------------------------------+
      
    

    You can also type the file name SAG-TOURS-E-CRUISE directly in the File Name field.

  5. Press Enter.

    The Worksheet appears.

Start of instruction setTo Choose Fields

The report requires data stored in the fields CRUISE-ID, START-HARBOR and DESTINATION-HARBOR.

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

    The Field Selection List window appears:

     14:11                      ***** Super Natural *****                 1993-02-01
     SAMPLE1                          - Worksheet -                           SN3011
                                                                                    
     Ref DB    Field Name     +----------------Field Selection List----------------+
     BE        ______________ !     Field Name                        Format  Info !
     BF        ______________ !  _  CRUISE-ID                         N8      __   !
     BG        ______________ !  _  CRUISE-TYPE                       A1      __   !
     BH        ______________ !  _  CRUISE-STATUS                     A1      __   !
     BI        ______________ !  _  START                             *G1     __   !
     BJ        ______________ !  _  START-DATE                        N8      __   !
     BK        ______________ !  _  START-TIME                        N6      __   !
     BL        ______________ !  _  END                               *G1     __   !
     BM        ______________ !  _  END-DATE                          N8      __   !
     BN        ______________ !  _  END-TIME                          N6      __   !
     BO        ______________ !  _  START-HARBOR                      A20     __   !
     BP        ______________ !  _  DESTINATION-HARBOR                A20     __   !
     BQ        *_____________ !  _  ID-YACHT                          N8      __   !
     BR        ______________ !  _  ID-PREDECESSOR                    N8      __   !
                              !                                                    !
                              +More:   +-------------------------------------------+
     
    
  2. Mark the fields CRUISE-ID, START-HARBOR and DESTINATION-HARBOR.

  3. Press Enter.

    The fields appear in the Field Name column and the Worksheet columns next to them are open. The fields are displayed in order of field reference. For further information on field references, see Field Reference (Ref) Column in Working with the Worksheet in the User's Guide.

    You can also enter the names directly into the Field Name column.

Start of instruction setDetermine Display Sequence

CRUISE-ID is to be displayed first, START-HARBOR second and DESTINATION-HARBOR third in the report.

  1. Type "1" in the Sequence column next to the field CRUISE-ID.

  2. Type" 2" in the Sequence column next to the field START-HARBOR.

  3. Type "3" in the Sequence column next to the field DESTINATION-HARBOR.

    The Worksheet now has the following entries:

     11:32                      ***** Super Natural *****                 1993-02-01
     SAMPLE1                          - Worksheet -                           SN3011
                                                                                    
     Ref DB    Field Name                         Seq   S/C  Func Def  Info Del     
     AA  1K    CRUISE-ID ......................   1__   ___   __   __   __       
     AJ  1K    START-HARBOR ...................   2__   ___   __   __   __        
     AK  1K    DESTINATION-HARBOR .............   3__   ___   __   __   __        
     BE        ________________________________   ___   ___   __   __   __   __     
     BF        ________________________________   ___   ___   __   __   __   __     
     BG        ________________________________   ___   ___   __   __   __   __     
     BH        ________________________________   ___   ___   __   __   __   __     
     BI        ________________________________   ___   ___   __   __   __   __     
     BJ        ________________________________   ___   ___   __   __   __   __     
     BK        ________________________________   ___   ___   __   __   __   __     
     BL        ________________________________   ___   ___   __   __   __   __     
     BM        ________________________________   ___   ___   __   __   __   __     
     BN        ________________________________   ___   ___   __   __   __   __     
     BO        ________________________________   ___   ___   __   __   __   __     
                                                                                    
                                                                                    
     Fill in required definitions                                                   
     Command ===>                                                                   
     Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
           Help  Next  Exit  Field Incl  Flip  -     +           Sel   Run   Canc   
    

    Notice that the Delete column is now protected for the fields selected for display. For further information on protected columns, see Sample 2: Worksheet.

Start of instruction setCreate Selection Criteria using the Continue Function

The report requires information for cruises which have yachts with charter yacht type ATLANTIC 29.

  1. Issue the SELECTION command.

    You can abbreviate this command to SEL.

    The Selection Editor appears.

  2. Issue the CONTINUE command.

    This command is allocated to PF10.

    The Fields window appears:

     13:21                      ***** Super Natural *****                 1993-02-01
     SAMPLE1                       - Selection Editor -                      SNZUL-S
                                                                                    
                                             +---------------Fields----------------+
           1  <                              !                                     !
           2  <                              !   _  Field List  Invoke Field List  !
           3  <                              !   _  ALL         Select All Records !
           4  <                              !                                     !
           5  <                              ! Mark to replace:                    !
           6  <                              !                                     !
           7  <                              +-------------------------------------+
           
    
  3. Mark the Field List field.

  4. Press Enter.

    The Field Selection List appears showing the fields already in the Field Name column of the Worksheet marked with a chevron (>).

     13:21                      ***** Super Natural *****                 1993-02-01
     SAMPLE1                       - Selection Editor -                      SNZUL-S
                                                                                    
                              +----------------Field Selection List----------------+
           1  <               !     Field Name                        Format  Info !
           2  <               !  >  CRUISE-ID                         N8      __   !
           3  <               !  >  START-HARBOR                      A20     __   !
           4  <               !  >  DESTINATION-HARBOR                A20     __   !
           5  <               !  _                                            __   !
           6  <               !  _                                            __   !
           7  <               !  _                                            __   !
           8  <               !  _                                            __   !
           9  <               !  _                                            __   !
          10  <               !  _                                            __   !
          11  <               !  _                                            __   !
          12  <               !  _                                            __   !
          13  <               ! The selected field will be included.               !
          14  <               ! Mark to replace: _                                 !
          15  <               !                                                    !
                              +More:   +-------------------------------------------+
      
    
  5. Issue the FORWARD command to see the next page of the Field List.

  6. Mark the field CHARTER-YACHT-TYPE.

  7. Press Enter.

    The field name CHARTER-YACHT-TYPE appears in the first editor line.

  8. Press Enter.

    The Operator window appears:

     13:23                      ***** Super Natural *****                 1993-02-01
     SAMPLE1                       - Selection Editor -                      SNZUL-S
                                                                                    
                                                     +----------Operator-----------+
           1  < CHARTER-YACHT-TYPE                   !                             !
           2  <                                      !   _  EQ (=)   Equal to      !
           3  <                                      !   _  NE (ª=)  Not Equal     !
           4  <                                      !   _  LT (<)   Less than     !
           5  <                                      !   _  LE (<=)  Less Equal    !
           6  <                                      !   _  GT (>)   Greater than  !
           7  <                                      !   _  GE (>=)  Greater Equal !
           8  <                                      !   _  ST       Starting with !
           9  <                                      !                             !
          10  <                                      ! Mark to replace: _          !
          11  <                                      !                             !
          12  <                                      +-----------------------------+
            
    
      12:01                      ***** Super Natural *****                 1995-05-12
     NSN1                          - Selection Editor -                      SNZUL-S
    
                                                     +----------Operator-----------+
           1  < CHARTER-YACHT-TYPE                   !                             !
           2  <                                      !   _  EQ (=)   Equal to      !
           3  <                                      !   _  NE (^=)  Not Equal     !
           4  <                                      !   _  LT (<)   Less than     !
           5  <                                      !   _  LE (<=)  Less Equal    !
           6  <                                      !   _  GT (>)   Greater than  !
           7  <                                      !   _  GE (>=)  Greater Equal !
           8  <                                      !   _  ST       Starting with !
           9  <                                      !                             !
          10  <                                      ! Mark to replace: _          !
          11  <                                      !                             !
          12  <                                      +-----------------------------+
          13  <                                                              >   13
          14  <                                                              >   14
          15  <                                                              >   15
    
    
     Command ===>
     Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
                                         Flip                                Canc
    
            
    
  9. Mark the EQ (=) Equal To field.

  10. Press Enter.

    The operator = appears in the first editor line.

  11. Press PF10.

    The Value window appears:

     13:23                      ***** Super Natural *****                 1993-02-01
     SAMPLE1                       - Selection Editor -                      SNZUL-S
                                                                                    
                                                 +--------------Value--------------+
           1  < CHARTER-YACHT-TYPE =             !                                 !
           2  <                                  !   _  Alphanumeric Constant      !
           3  <                                  !   _  Hex Constant               !
           4  <                                  !   _  Define Dynamic Input Field !
           5  <                                  !   _  Invoke Field List          !
           6  <                                  !                                 !
           7  <                                  !   _  SCAN                       !
           8  <                                  !   _  MASK                       !
           9  <                                  !                                 !
          10  <                                  ! Mark to replace: _              !
          11  <                                  !                                 !
          12  <                                  +---------------------------------+
           
    
  12. Mark the Alphanumeric Constant field.

    For further information on alphanumeric constants, see Constants in Fields in the User's Guide.

  13. Press Enter.

    The Alphanumeric Constant window appears:

     13:23                      ***** Super Natural *****                 1993-02-01
     SAMPLE1                       - Selection Editor -                      SNZUL-S
                                                                                    
                                              +-------Alphanumeric Constant--------+
           1  < CHARTER-YACHT-TYPE =          !                                    !
           2  <                               !  ' _____________________________   !
           3  <                               !    _____________________________ ' !
           4  <                               !                                    !
           5  <                               ! Mark to replace: _                 !
           6  <                               !                                    !
           7  <                               +------------------------------------+
           8  <                                  !   _  MASK                       !
           9  <                                  !                                 !
          10  <                                  ! Mark to replace: _              !
          11  <                                  !                                 !
          12  <                                  +---------------------------------+
        
    
  14. Type "ATLANTIC 29" in the unnamed input field.

  15. Press Enter.

    The value ATLANTIC 29 appears in inverted commas (' ') in the first editor line.

    You can also enter "CHARTER-YACHT-TYPE = 'ATLANTIC 29'" directly in the editor lines.

     13:25                      ***** Super Natural *****                 1993-02-01
     SAMPLE1                       - Selection Editor -                      SNZUL-S
                                                                                    
                                                                                    
           1  < CHARTER-YACHT-TYPE = 'ATLANTIC 29'                           >    1 
           2  <                                                              >    2 
           3  <                                                              >    3 
           4  <                                                              >    4 
           5  <                                                              >    5 
          
    
  16. Issue the CHECK command. This command is allocated to PF5.

    If the selection lines are correct, the transaction specification is complete. You have specified fields to use, display sequence and selection criteria.

Start of instruction setTo Run the Transaction

You can now either save the transaction and execute it later or you can run it to see the report immediately. If the selection lines are incorrect, you can either correct them or keep the transaction and finish it later.

  1. Issue the RUN command. This command is allocated to PF11.

    The report is generated:

     13:28:32  CHARTER-YACHT-TYPE = 'ATLANTIC 29'                         1993-02-01
     ISAMPLE1                                                               1       
                                                                                    
     CRUISE-ID     START-HARBOR      DESTINATION-HARBOR                             
     --------- -------------------- --------------------                            
                                                                                    
            79 KIEL                 KIEL                                            
            80 KIEL                 KIEL                                            
            81 KIEL                 KIEL                                            
            82 KIEL                 KIEL                                            
            83 KIEL                 KIEL                                            
            84 KIEL                 KIEL                                            
            85 KIEL                 KIEL                                            
            86 KIEL                 KIEL                                            
            87 KIEL                 KIEL                                            
            88 KIEL                 KIEL                                            
            89 KIEL                 KIEL                                            
            90 KIEL                 KIEL                                            
            91 KIEL                 KIEL                                            
            92 KIEL                 KIEL                                            
            93 KIEL                 KIEL                                            
                                                                                    
     Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
                 Print Exit              Flip        +                       Canc   
    
  2. Copy the transaction SAMPLE1 and call it "EG1" as described in Copying Transactions in Using Reporting Transactions in the User's Guide.

  3. Try changing the order of the display fields and change the selection criteria to "DESTINATION-HARBOR = 'BAHAMAS' or CHARTER-YACHT-TYPE = 'INDIC-CAT 42'".