Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help: extra blank lines (break and compute)

Status
Not open for further replies.

aparente001

Programmer
Feb 24, 2009
1
0
0
US
Hi, I'm getting two mysterious blank lines after the first line of each group. I am attaching and appending the code and the output. See
and
Thanks.

Code:
-- purpose: Create a list of all aircraft, showing the manufacturer, 
--			model name, aircraft number, and charters trips flown
--			(destination, miles flown, and revenue generated).  In
--			addition, generate totals of revenue generated and miles
--			flown for each aircraft.

COLUMN make -
   FORMAT A10 -
   HEADING 'Make'
COLUMN modl -
   FORMAT A18 -
   HEADING 'Model'
COLUMN ac_number -
	FORMAT A6 -
	HEADING 'plane#'
COLUMN destination -
	FORMAT A7 -
	HEADING 'airport'
COLUMN char_distance -
	FORMAT 99999 -
	HEADING 'distance'
COLUMN revenue -
	FORMAT $99999.99 -
	HEADING 'revenue'
   
BREAK ON make skip 1 ON modl skip 1 ON ac_number skip 1
COMPUTE SUM OF revenue ON ac_number
COMPUTE SUM OF char_distance ON ac_number

SET PAGESIZE 54
SPOOL out4

SELECT m.mod_manufacturer AS make, m.mod_name AS modl, a.ac_number,
	char_trip, ch.destination, ch.char_distance,
	1.35 * m.mod_chg_mile * ch.char_distance AS revenue
FROM hartmar.aircraft a 
	LEFT JOIN hartmar.charter ch ON a.ac_number = ch.ac_number
	LEFT JOIN hartmar.model m ON a.mod_code = m.mod_code
ORDER BY make, modl, ac_number;

CLEAR COLUMNS BREAKS COMPUTES
SPOOL OFF



Make Model plane# CHAR_TRIP airport distance revenue
---------- ------------------ ------ ---------- ------- -------- ----------
Beechcraft KingAir 2289L 10025 ATL 936 $3285.36


10029 ATL 1023 $3590.73
10055 GNV 1645 $5773.95
10049 GNV 1574 $5524.74
10031 GNV 1574 $5524.74
10022 GNV 1574 $5524.74
10014 GNV 1574 $5524.74
10041 ATL 936 $3285.36
10037 GNV 1645 $5773.95
10045 ATL 1023 $3590.73
****** -------- ----------
sum 13504 $47399.04



Cessna Citation Mustang 1234C


****** -------- ----------
sum


Citation Sovereign 2345C


****** -------- ----------
sum



Piper Axtec 1484P 10023 STL 508 $1303.02


10013 TYS 644 $1651.86
10004 STL 508 $1303.02
10051 BNA 352 $902.88
10048 TYS 644 $1651.86
10044 STL 472 $1210.68
10039 STL 508 $1303.02
10033 BNA 352 $902.88
10028 STL 472 $1210.68
****** -------- ----------
sum 4460 $11439.90


Navajo Chieftain 2278V 10034 MOB 884 $2804.49


10052 MOB 884 $2804.49

Make Model plane# CHAR_TRIP airport distance revenue
---------- ------------------ ------ ---------- ------- -------- ----------
Piper Navajo Chieftain 2278V 10056 MQY 312 $989.82


10047 GNV 1574 $4993.52
10012 GNV 1574 $4993.52
10007 BNA 320 $1015.20
10042 BNA 320 $1015.20
10038 MQY 312 $989.82
10026 BNA 320 $1015.20
****** -------- ----------
sum 6500 $20621.25

4278Y 10032 ATL 998 $3166.16
10053 TYS 646 $2049.44
10019 ATL 936 $2969.46
10030 STL 472 $1497.42
10046 STL 472 $1497.42
10024 TYS 644 $2043.09
10027 GNV 1574 $4993.52
10008 GNV 1574 $4993.52
10015 ATL 998 $3166.16
10040 TYS 644 $2043.09
10054 ATL 936 $2969.46
10003 TYS 644 $2043.09
10018 TYS 646 $2049.44
10036 ATL 936 $2969.46
10035 TYS 646 $2049.44
10050 ATL 998 $3166.16
10043 GNV 1574 $4993.52
****** -------- ----------
sum 15338 $48659.81




47 rows selected.
 
Have a look at the line:

BREAK ON make skip 1 ON modl skip 1 ON ac_number skip 1

and what the skip 1 means.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top