Version 8.2.3
 —  User's Guide  —

Working with Prototype Programs

This section describes Prototype Programs and how to handle them. An example prototype program is also given.

This section covers the following topics:


What Are Prototype Programs?

Prototype programs are basic program frameworks for reporting or data maintenance transactions. The program framework for a transaction is generated in Natural reporting mode. A Natural programmer can use the program framework as a prototype for further development. Because it doesn't contain any code specific to Super Natural, a prototype program can be used like any other Natural program.

Note:
When you use prototype programs, Super Natural no longer checks your activities, since you are working withNatural. That means that you are fully responsible for what you do.

Note:
Prototype programs created with Super Natural under Natural Version 2.2 cannot be cataloged under Natural Version 2.3 without revision. This is because the keyword LESS of the NEWPAGE statement is no longer optional, but required.

Top of page

Listing Prototype Programs

Start of instruction setTo list the prototype programs generated in your present library

Top of page

Generating Prototype Programs

Start of instruction setTo generate a prototype program

Top of page

Saving Prototype Programs

Start of instruction setTo save a prototype program

Note:
If you do not save your prototype program before leaving the Natural program editor for the first time, you will lose the prototype and have to generate it again!

When you leave the Natural program editor, the Prototype List screen appears.

When you save a prototype program you have generated from an existing transaction, the transaction name appears on both the Transaction Listscreen and the Prototype List screen.

When you save a prototype program generated from a transaction you are creating which you have not saved or run, the transaction name (program name) appears on the Prototype List screen but not on the Transaction List screen and the transaction is lost.

When you save a prototype program generated from a transaction you are modifying which you haven't saved or run, the transaction name (program name) appears on the Prototype List screen but modifications you have made since you last saved the transaction are lost.

Top of page

Running Prototype Programs

Do not run a prototype program if you have accessed from Super Natural as this is not a development environment. You will have problems if the program has errors in it. If you want to run a prototype program, access it directly from Natural.

Note:
Prototype programs created with Super Natural under Natural Version 2.2 cannot be cataloged under Natural Version 2.3 without revision. This is because the keyword LESS of the NEWPAGE statement is no longer optional, but required.

Top of page

Leaving the Natural Program Editor

Start of instruction setTo leave the Natural program editor and return to Super Natural

Note:
The prototype program is not saved.

Top of page

Modifying Prototype Programs

Start of instruction setTo modify a prototype program

In prototype programs created from data maintenance transactions, the data maintenance statements STORE, UPDATE, DELETE etc. are commented out with asterisks (*) to prevent accidental execution of data maintenance functions. If you access these programs directly from Natural and want to run them, you must remove the asterisks and provide END TRANSACTION and BACKOUT TRANSACTION statements yourself.

Top of page

Copying Prototype Programs

Program Stored in Your Private Library

If you want to copy a prototype program stored in your private library, you simply save it under a different name in the Natural program editor.

Start of instruction setTo save a program stored in your private library

  1. Enter the command abbreviation MO in the command column of the Prototype List screen next to the prototype program name.

    The Natural program editor appears displaying the prototype program.

  2. Issue the SAVE command together with the name to be assigned (see the note below for naming conventions).

    To identify the new program as a prototype to Super Natural, the first character of the new name must be the prefix for prototype programs at your installation. Otherwise the program will not be listed on the Prototype List screen.

    Now the same program exists twice, but with two different names.

Program Stored in a Public Library

Start of instruction setTo copy a prototype program stored in a public library to your private library

Top of page

Deleting Prototype Programs

Start of instruction setTo delete a prototype program

  1. Enter the command abbreviation DE in the command column of the Prototype List screen next to the prototype program name.

    Or:
    Issue the DELETE PROTOTYPE name command.

    The Confirm Delete window appears. This window asks you to confirm that you want to delete the prototype program named.

  2. Enter "Y" to delete the prototype program.

    The prototype program is deleted.

Top of page

Example Prototype Program

The following prototype program was generated with the transaction SAMPLE3 demonstrated in the Tutorial:

                                                                                
 >                                       > +  Program     XSAMPLE3 Lib YSBE     
 Top    ....+....1....+....2....+....3....+....4....+....5....+....6....+....7..
   0010 * PROGRAM: SAMPLE3                                                      
   0020 * AUTHOR : Super Natural                                                
   0030 * DATE   : 93-03-22                                                     
   0040 *                                                                       
   0050 SET GLOBALS LE=OFF ZD=OFF                                               
   0060 FORMAT PS=21 LS=80 SF=1 AD=I HW=OFF EM=OFF KD=ON MP=32767 ES=OFF        
   0070 IS=OFF SG=OFF ZP=OFF MC=1 PC=1                                          
   0080 RESET #HEAD(L)                                                          
   0090 RESET #BE(A8) #BI(A8)                                                   
   0100 PRI. READ ( 1000000 ) SAG-TOURS-E-CRUISE                                
   0110     PHYSICAL                                                            
   0120     WHERE CHARTER-YACHT-TYPE = 'ATLANTIC 29'                            
   0130   REDEFINE START-DATE(PRI.) (2X #BF(N2))                                
   0140   REDEFINE START-DATE(PRI.) (4X #BG(N2))                                
   0150   REDEFINE START-DATE(PRI.) (6X #BH(N2))                                
   0160   REDEFINE END-DATE(PRI.) (2X #BJ(N2))                                  
   0170   REDEFINE END-DATE(PRI.) (4X #BK(N2))                                  
   0180   REDEFINE END-DATE(PRI.) (6X #BL(N2))                                  
   0190   MOVE TRUE TO #HEAD                                                    
   0200   COMPRESS #BH '.' #BG '.' #BF INTO #BE LEAVING NO                      
        ....+....1....+....2....+....3....+....4....+....5....+... S 89   L 1   

Top of page