Creating Enhanced List and Summary Reports |
Selecting Observations |
You might also want to select rows for your report based on a condition. To select observations, you can use the WHERE statement, just as you have learned to do with PROC PRINT.
The following WHERE statement specifies that only observations that have
the value LON or PAR for the variable proc report data=flights.europe nowd; where dest in ('LON','PAR'); column flight orig dest mail freight revenue; run; |
Flight | Orig | Dest | Freight | Revenue | |
821 | LGA | LON | 403 | 209 | 150634 |
271 | LGA | PAR | 492 | 308 | 156804 |
271 | LGA | PAR | 366 | 498 | 190098 |
821 | LGA | LON | 345 | 243 | 150634 |
821 | LGA | LON | 248 | 307 | 193930 |
271 | LGA | PAR | 353 | 205 | 166470 |
821 | LGA | LON | 391 | 395 | 167772 |
271 | LGA | PAR | 366 | 279 | 163248 |
821 | LGA | LON | 219 | 368 | 183106 |
271 | LGA | PAR | 357 | 282 | 170766 |
821 | LGA | LON | 389 | 479 | 169576 |
271 | LGA | PAR | 415 | 463 | 195468 |
821 | LGA | LON | 448 | 282 | 143561 |
271 | LGA | PAR | 352 | 351 | 123456 |
219 | LGA | LON | 331 | 376 | 189065 |
821 | LGA | LON | 403 | 209 | 170766 |
271 | LGA | PAR | 492 | 308 | 125632 |
219 | LGA | LON | 485 | 267 | 197456 |
271 | LGA | PAR | 366 | 498 | 128972 |
219 | LGA | LON | 388 | 298 | 162343 |
821 | LGA | LON | 345 | 243 | 129560 |
219 | LGA | LON | 421 | 356 | 134520 |
821 | LGA | LON | 248 | 307 | 196736 |
271 | LGA | PAR | 353 | 205 | 153423 |
219 | LGA | LON | 447 | 299 | 106753 |
821 | LGA | LON | 391 | 395 | 125344 |
271 | LGA | PAR | 366 | 279 | 133345 |
219 | LGA | LON | 356 | 547 | 122766 |
821 | LGA | LON | 219 | 368 | 166543 |
271 | LGA | PAR | 357 | 282 | 126543 |
219 | LGA | LON | 272 | 370 | 198744 |
821 | LGA | LON | 389 | 479 | 129745 |
271 | LGA | PAR | 415 | 463 | 134976 |
Copyright © 2002 SAS Institute Inc.,
Cary, NC, USA. All rights reserved.