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 (August 2007, 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 Aug 2007 20:39:49 -0400
Reply-To:   "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Subject:   Re: Collapsing records and concatenating variables using PROC SQL

On Mon, 6 Aug 2007 20:24:26 -0400, Scott Bass <sas_l_739@YAHOO.COM.AU> wrote:

>Hi, > >I would think I would have known how to do this by now, but alas I don't :- >( > >Say I have the following data step: > >data one; > length key 8 var $1; > input key var; > cards; >1 A >1 B >1 C >2 D >2 E >3 F >; >run; > >data two; > set one; > by key; > length newvar $200; > retain newvar; > if first.key then newvar = ""; > newvar = catx(" ",newvar,var); > if last.key then output; >run; > >Is there a way to create this dataset using PROC SQL only?

None that I can visualize. The results are sensitive to the original order of the rows, and SQL does not recognize order.

>I'd rather >just use the data step, but the customer would prefer SQL if possible. > >Thanks, >Scott


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