LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 2002, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 6 May 2002 12:50:04 -0700
Reply-To:   Jim <jim.neuer@YELLOWCORP.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Jim <jim.neuer@YELLOWCORP.COM>
Organization:   http://groups.google.com/
Subject:   proc tabulate
Content-Type:   text/plain; charset=ISO-8859-1

Is there an equvilent sql table statement to the sas proc tabulate procedure. Say I have 3 fields of data which look like:

id number , status, timestamp xx 1 ts xx 2 ts

I want output that looks like the following.

id number status(1) status(2) status(3) xxx time time time xxx time time time

I currently using case statements to create the different status fields:

CREATE TABLE TRAILER4 AS SELECT PROPF,PRO,STATUS,TS FORMAT=DATETIME18.,

CASE STATUS WHEN 'ARV' THEN TS ELSE 0 END AS ARV FORMAT=DATETIME18.,

CASE STATUS WHEN 'UAD' THEN TS ELSE 0 END AS UAD FORMAT=DATETIME18.,

CASE STATUS WHEN 'MTY' THEN TS ELSE 0 END AS MTY FORMAT=DATETIME18.,

CASE STATUS WHEN 'LDG' THEN TS ELSE 0 END AS LDG FORMAT=DATETIME18.,

CASE STATUS WHEN 'LTG' THEN TS ELSE 0 END AS LTG FORMAT=DATETIME18.,

CASE STATUS WHEN 'SDT' THEN TS ELSE 0 END AS SDT FORMAT=DATETIME18.,

CASE STATUS WHEN 'ADT' THEN TS ELSE 0 END AS ADT FORMAT=DATETI

FROM TRAILER3 GROUP BY PROPF,PRO ORDER BY PROPF,PRO,TS;


Back to: Top of message | Previous page | Main SAS-L page