home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 6 / 06.iso / a / a610 / 6.ddi / DEMO / FGL / REPORT4.4GL < prev    next >
Encoding:
Text File  |  1989-12-08  |  1.1 KB  |  66 lines

  1. DATABASE stores
  2.  
  3. MAIN
  4.  
  5.     DEFINE p_customer RECORD LIKE customer.*
  6.  
  7.     DECLARE q_curs CURSOR FOR 
  8.         SELECT lname, company, city, state
  9.             FROM customer
  10.  
  11.     START REPORT cust_list
  12.  
  13.     FOREACH q_curs INTO p_customer.lname,
  14.                 p_customer.company,
  15.                 p_customer.city,
  16.                 p_customer.state
  17.  
  18.         OUTPUT TO REPORT cust_list (p_customer.lname,
  19.                     p_customer.company,
  20.                     p_customer.city,
  21.                     p_customer.state)
  22.  
  23.     END FOREACH
  24.  
  25.     FINISH REPORT cust_list
  26.  
  27. END MAIN
  28.  
  29. REPORT cust_list (lname, company, city, state)
  30.  
  31.     DEFINE lname    CHAR(15),
  32.         company    CHAR(20),
  33.         city    CHAR(15),
  34.         state    CHAR(2)
  35.  
  36.     ORDER BY city
  37.  
  38.     FORMAT
  39.  
  40.         PAGE HEADER
  41.  
  42.             PRINT COLUMN 25, "CUSTOMER LIST"
  43.             SKIP 1 LINE
  44.             PRINT COLUMN 24, "August 26, 1986"
  45.             SKIP 2 LINES
  46.             PRINT "Last Name",
  47.                 COLUMN 18, "Company",
  48.                 COLUMN 40, "City",
  49.                 COLUMN 60, "State"
  50.             SKIP 2 LINES
  51.  
  52.         ON EVERY ROW
  53.             PRINT lname,
  54.                 COLUMN 18, company,
  55.                 COLUMN 40, city,
  56.                 COLUMN 60, state
  57.  
  58.         AFTER GROUP OF city
  59.             SKIP 2 LINES
  60.  
  61.         PAGE TRAILER
  62.             PRINT "Confidential Information",
  63.                 COLUMN 55, PAGENO USING "Page ##"
  64.  
  65. END REPORT
  66.