A SERVICE OF

logo

Accessing DBMS Data with the LIBNAME Statement Using the RANK Procedure 257
Output 13.16 Using the CONTENTS Procedure
Contents of the DELAY Table
The CONTENTS Procedure
Data Set Name: MYDBLIB.DELAY Observations: .
Member Type: DATA Variables: 7
Engine: Oracle Indexes: 0
Created: . Observation Length: 0
Last Modified: . Deleted Observations: 0
Protection: Compressed: NO
Data Set Type: Sorted: NO
Label:
-----Alphabetic List of Variables and Attributes-----
# Variable Type Len Pos Format Informat Label
-----------------------------------------------------------------------------
2 DATES Num 8 8 DATETIME20. DATETIME20. DATES
7 DELAY Num 8 64 DELAY
5 DELAYCAT Char 15 32 $15. $15. DELAYCAT
4 DEST Char 3 24 $3. $3. DEST
6 DESTYPE Char 15 48 $15. $15. DESTYPE
1 FLIGHT Char 3 0 $3. $3. FLIGHT
3 ORIG Char 3 16 $3. $3. ORIG
Using the RANK Procedure
This example uses the RANK procedure to rank flights in the DB2 table Delay by
number of minutes delayed.
libname mydblib db2 ssid=db2;
options obs=20;
proc rank data=mydblib.delay descending
ties=low out=ranked;
var delay;
ranks RANKING;
run;
proc print data=ranked;
title ’Ranking of Delayed Flights’;
format delay 2.0
dates datetime9.;
run;
Output for this example is shown here.