LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (September 2004, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 8 Sep 2004 00:59:13 -0400
Reply-To:     sashole@bellsouth.net
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Paul M. Dorfman" <sashole@BELLSOUTH.NET>
Organization: Sashole of Florida
Subject:      Re: Again: Pass parameter between records of a dataset-in a group
Comments: To: "Deng, Yue" <Yue.Deng@ASTRAZENECA.COM>
In-Reply-To:  <E7DF4212AA54D51189B40002A56B1E1E030314CB@cnsgcasmsx01.cnsg.astrazeneca.net>
Content-Type: text/plain; charset="us-ascii"

Deng,

Howard has provided you with the answer, although I am failing to gather why in your in/out sample, the sequence of the VALUE values in ORIGINAL is different from that in NEW. Of course, neither Howard's code, nor Roger's offerings provide for the change. If it is of any significance, it is in your best interest (since you are the one asking the question) to spell it out, because I do not see how its purpose can be reasonably inferred from what you have said.

On a different note, I have a question myself. Please no offense (just sheer observation), but from your post, it is apparent that you have at least major problems with three things:

1) SAS 2) Basic general programming logic 3) English

It is also apparent from your email address, that you are successfully employed by a giant pharmaceutical company, most likely as a clinical SAS programmer. It is not a small achievement, considering that I know quite a few splendid SAS programmers, perfectly versed in a dozen of programming languages, having no problem implementing any Knuth algorithm in any of them, speaking and writing in flawless English, and even having certain (say, 1-2 years) "clinical trial experience" consulting for major pharmaceutical firms, yet having lately been utterly unable to secure any kind of position in one of the firms in your area (i.e. DE/PA/NJ) on the ground that they do not have enough ubiquitous "clinical trial experience".

What gives? What is the critical skill component eluding my fancy which makes one employable in a clinical trials setting without the sufficient knowledge of the three major components listed above? Or maybe those "experienced" folks take themselves too seriously and charge too much for their services? Just wondering...

Kind regards, ---------------- Paul M. Dorfman Jacksonville, FL ----------------

> -----Original Message----- > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On > Behalf Of Deng, Yue > Sent: Tuesday, September 07, 2004 10:40 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Again: Pass parameter between records of a dataset-in a group > > Thank you all for your help, > Now I try to expand min rule to every id group. For the first > rule of min, I can make it work by change _n_=1 to first.id. > However for the second min rules I can't make it work because > I can't prevent the min value from passing to the first > record of next group. > What shall I do? > Here I explain what I want to process with an example: > Original Dataset: > Gp Value > 1 30 > 1 40 > 1 20 > 1 10 > 2 30 > 2 40 > 2 20 > 2 10 > 3 30 > 3 40 > 3 20 > 3 10 > New Dataset: > (Min: is the mininum value of former records in that group) > Gp Value Min > 1 30 30 > 1 20 30 > 1 40 20 > 1 10 20 > 2 30 30 > 2 20 30 > 2 40 20 > 2 10 20 > 3 30 30 > 3 20 30 > 3 40 20 > 3 10 20 > Thank & Regards, > Deng Yue > ************************************************************** > ************** > * > From: Howard Schreier; Sent: Thursday, September 02, 2004 > 12:17 AM data new; > set original; > if _n_=1 then min = value; > min = min(min,lag(value) ); > retain min; > run; > ************************************************************** > ************** > * > On Tue, 31 Aug 2004 09:26:30 +0100, Deng, Yue > <Yue.Deng@ASTRAZENECA.COM> > >Thank you all, > >I know the use of "retain" and "lag". And now my problem > changes a little. > >How can I make it? > >Original Dataset: > >ID Value > >1 30 > >2 40 > >3 20 > >4 10 > >-> > >New Dataset: > >ID Value Min > >1 30 30 > >2 20 30 > >3 40 20 > >4 10 20 > ************************************************************** > ************ > From: Groeneveld, Jim; Sent: Tuesday, August 31, 2004 2:36 PM > DATA New; * _untested_ code; > SET Original; > LagMin = LAG(MinValue); > IF _N_ EQ 1 THEN MinValue = Value; > ELSE MinValue = MIN (Value, LagMin); * How about missing > Values? ; RUN; > > or: > > DATA New; * _untested_ code; > SET Original; > RETAIN MinValue; > IF _N_ EQ 1 THEN MinValue = Value; > ELSE MinValue = MIN (Value, MinValue); * How about missing > Values? ; RUN; > ************************************************************** > ************ > On Tue, 31 Aug 2004 09:26:30 +0100, Deng, Yue > <Yue.Deng@ASTRAZENECA.COM> > >Thank you all, > >I know the use of "retain" and "lag". And now my problem > changes a little. > >How can I make it? > >Original Dataset: > >ID Value > >1 30 > >2 40 > >3 20 > >4 10 > >-> > >New Dataset: > >ID Value Min > >1 30 30 > >2 20 20 > >3 40 20 > >4 10 10 >


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