
     /*      USER HIGH MESSAGES - GAP REPORT SCRIPT         */

     /*******************************************************/
     /* This report script will create an ASCII text file   */
     /* of all your users who have left 100 messages or     */
     /* more.  See "select" to change this number to meet   */
     /* your own needs.                                     */
     /*******************************************************/

     /*******************************************************/
     /* All report scripts must begin with START            */
     /*******************************************************/

START


     /*******************************************************/
     /* Virtual fields are used within the report.  They    */
     /* are normally used to provide computations.  For     */
     /* instance, the username field is taking the user's   */
     /* first name and last name, striping off the spaces   */
     /* and then joining the two names together.            */
     /*******************************************************/


VIRTUAL

  userfile      STRING  32      "C:\GAP\MAIN\USERS.DAT"
  username      STRING  32      STRIP(first) # " " # STRIP(last)
  average_minutes INT2   2      ttl_mins / timeson






     /*******************************************************/
     /* The SEARCH section is where you tell the report     */
     /* generator how to search the file.  In this case, we */
     /* are searching by the userindex.  The same way you   */
     /* see the users in GAPUSER.                           */
     /*******************************************************/


SEARCH
  FILE userfile USING_KEY user_index

     /*******************************************************/
     /* The SELECTION section is where you tell the report  */
     /* generator how to select individual records.  For    */
     /* instance, you could tell it to to select ONLY those */
     /* users with a level of 90 or greater.                */
     /*******************************************************/


SELECT
  average_minutes >= 10  /* Only those who left 100+ messages */

     /*******************************************************/
     /* The sort section allows you to format the report in */
     /* any order you wish.  It must be realized however    */
     /* that in using SORTS, the report generator will need */
     /* to actually sort the data before it prints the      */
     /* report.  This may take some time with large files.  */
     /*******************************************************/

     
SORT USING_KEY                      /* format report according to the      */
                                    /* following fields.                   */
  NO_MOD        last                /*  By last name  (ascending order)    */
  NO_MOD        first               /*  By first name (ascending order)    */
  INTEGER       average_minutes     /*  By # of Messages Left              */

     /*******************************************************/
     /* The DISPLAY section is where you tell the report    */
     /* generator where to send the report.  Output can be  */
     /* directed to any valid DOS device.                   */
     /*******************************************************/

DISPLAY

  DEVICE        OUTFILE     /* OUTFILE is an ASCII text file */
  PAGE_LENGTH   0           /* no page formatting           */


     /*******************************************************/
     /* The IMAGE section is where the report is actually   */
     /* produced.   You set up exactly how you want the     */
     /* report to appear, and the report generator will     */
     /* substitute your user or message fields in place of  */
     /* of the format specifications.                       */
     /*                                                     */
     /* Anything after a '+' is printed except that the     */
     /* format specifications are substitued with the       */
     /* actual fields that appear in the line beneath.      */
     /*                                                     */
     /* Inside the body, you may refer to either an actual  */
     /* DODA name, or a name that was defined in the        */
     /* VIRTUAL section above.  For instance, "username"    */
     /* does not exists as one of the DODA names but it was */
     /* defined in the VIRTUAL section as a formula to use  */
     /* "first" and "last" (both defined in DODA)           */
     /*******************************************************/


     /*******************************************************/
     /*  NOTE!!!  DO NOT place any comments after a line    */
     /*  that begins with a '+'!  If you do, then your      */
     /*  comments will be printed and/or shown!             */
     /*******************************************************/



IMAGE

PAGE_HDR

+      Wicked Scherzo Users Who Have Written Over 100 Messages
+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Name                        City                      Average Minutes On
+~~~~                        ~~~~                      ~~~~~~~~~~~~~~~~~~
BODY
+
+@xxxxxxxxxxxxxxxxxxxxxxxxx  @xxxxxxxxxxxxxxxxxxxxxxxxx@9999999
  username                    city                      average_minutes

     /*******************************************************/
     /* EXIT must be the last line in each script           */
     /*******************************************************/


EXIT
