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 (January 1998, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 30 Jan 1998 10:57:59 -0500
Reply-To:   Michael Stuart <mstuart@PRUDENTIAL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   Michael Stuart <mstuart@PRUDENTIAL.COM>
Subject:   Re: Shorten a dataset
Comments:   cc: riksob@freemail.com
Content-Type:   text/plain; charset=US-ASCII

How about SQL:

data longdat ;

input no begin end name $ ;

cards ; 1010 24011998 24021999 richard 1010 24021998 24022000 richard 1020 24011968 24021969 ric 1020 24011969 24021975 ric 1020 24011975 24021980 ric ;

proc print data=longdat ; run ;

proc sql ;

create table shortdat as select no , min(begin) as begin, max(end) as end , name from longdat group by no , name ;

proc print data=longdat ;

run ;

Date: Thu, 29 Jan 1998 12:32:13 GMT From: Rik Sob <riksob@FREEMAIL.COM> Subject: Shorten a dataset

SASSERS, I have the following problem with SAS, i need to shorten the following data: NO BEGIN END NAME 1010 24011998 24021999 richard 1010 24021998 24022000 richard 1020 24011968 24021969 ric 1020 24011969 24021975 ric 1020 24011975 24021980 ric I would like to end up with the following: NO BEGIN END NAME 1010 24011998 24022000 richard 1020 24011968 24021980 ric The problem lies in the begin and end variable I have solved the problem with FIRST.variables and LAST.variables I have tried the PROC TRANSPOSE but that does not seem to work. Is their any one who has tackled this problem before and would share his solutions with his news fooks -- Met vriendelijke groet, With greetings, Rik Sob


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