home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 6 / 06.iso / a / a610 / 6.ddi / DEMO / FGL / REPORT3.4GL < prev    next >
Encoding:
Text File  |  1989-12-08  |  799 b   |  50 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.             ORDER BY city
  11.  
  12.     START REPORT cust_list
  13.  
  14.     FOREACH q_curs INTO p_customer.lname,
  15.                 p_customer.company,
  16.                 p_customer.city,
  17.                 p_customer.state
  18.  
  19.         OUTPUT TO REPORT cust_list (p_customer.lname,
  20.                     p_customer.company,
  21.                     p_customer.city,
  22.                     p_customer.state)
  23.  
  24.     END FOREACH
  25.  
  26.     FINISH REPORT cust_list
  27.  
  28. END MAIN
  29.  
  30. REPORT cust_list (lname, company, city, state)
  31.  
  32.     DEFINE lname    CHAR(15),
  33.         company    CHAR(20),
  34.         city    CHAR(15),
  35.         state    CHAR(2)
  36.  
  37.     FORMAT
  38.  
  39.         ON EVERY ROW
  40.             PRINT lname,
  41.                 COLUMN 18, company,
  42.                 COLUMN 40, city,
  43.                 COLUMN 60, state
  44.  
  45.         AFTER GROUP OF city
  46.             SKIP 2 LINES
  47.  
  48.  
  49. END REPORT
  50.