f



Re: Simple SAS problem #2

JK,

data need (drop = _:) ;
   set have ;
   by sub grp ;
   retain _last_num 0 ;
   new_num = num + _last_num ;
   if last.grp then _last_num = num ;
run ;

On Tue, 23 Sep 2008 11:47:29 -0400, sas geeks <sasgeeks.jk@GMAIL.COM>
wrote:

>Hi,
> I have the following data
>
>data have;
>input sub grp $ num;
>cards;
>sub    grp     num
>1       A       12
>1       A       54
>1       A       67
>1       A       88
>1       B        1
>1       B       77
>1       B       98
>1       B       105
>run;
>
>I need the following output
>
> sub    grp     num  new_num
>1       A       12      12
>1       A       54      54
>1       A       67      67
>1       A       88      88
>1       B        1       89
>1       B       77      165
>1       B       98       186
>1       B       105     193
>
>Basically i need the last 'num'  from the grp A and add that to the 'num'
in
>grp B to get new_num. I am sure it is very easy for most of you. I am just
>not getting the idea.
>
>Thanks
>JK
0
sashole (972)
9/23/2008 4:05:54 PM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

0 Replies
677 Views

Similar Articles

[PageSpeed] 42

Reply:

Similar Artilces:

Re: problem when installing SAS. windows x64 does not support SAS? #2
Elodie, Take a look at: http://support.sas.com/kb/16/568.html HTH, Art --------- On Wed, 14 May 2008 07:54:57 -0700, elodie.gillain@GMAIL.COM wrote: >Hi everyone > >I am trying to install SAS on a Vista machine. > >The setup wizard says that Windows x64 does not support the SAS >version I am trying to install. > >What can I do? > >I greatly appreciate your help. ...

Re: SAS 9.2 Update on problem re Help files #2
SNOTES is an approximately daily email from SAS STech Support listing the new or changed usage notes since the last email. So the item pertaining to you was: 32792 - SAS prompts you to rebuild the index when you press F1 to request help while running a SAS procedure in SAS 9.2 Release(s) Reported: 9.2 Release(s) Fixed: Date Created: 28JUL2008 Date Last Updated: 11AUG2008 http://support.sas.com/kb/32792.html To subscribe, go to http://support.sas.com/techsup/news/snotes.html You'll get an extra email on most workdays, but if you subscribe to SAS-L you'll hardly notice one more. There's also http://support.sas.com/techsup/news/tsnews.html It has news about tech support office hours and a few other things. If you want even more news, and you have an RSS reader, you can go to http://support.sas.com/community/rss/index.html On Mon, 25 Aug 2008 11:10:05 -0400 (GMT-04:00), "Peter Flom" <peterflomconsulting@mindspring.com> said: > Hi Jack > > I don't think I've ever looked at tech support notes ..... where is it? > Is it useful for browsing? > > Peter > > -----Original Message----- > >From: Jack Hamilton <jfh@alumni.stanford.org> > >Sent: Aug 25, 2008 11:08 AM > >To: Peter Flom <peterflomconsulting@mindspring.com>, "sas-l@listserv.uga.edu" <SAS-L@LISTSERV.UGA.EDU> > >Subject: Re: [SAS-L] SAS 9.2 Updat...

Re: suggest: improve SAS Deployment Wizard for SAS v9.2, phase 2 #2
> From: A Little Birdie > > I just searched the SAS-L archives (should have done that > first) and found references to these two pages: > > http://www.sascommunity.org/wiki/Category:V9.2_Phase_2 > > http://www.sascommunity.org/wiki/V9.2_Phase_2_install_guide > > Have you seen this page? > ***************************************************** > http://support.sas.com/kb/35/631.html <---<<< NICE! ***************************************************** > It looks like it addresses your needs, and might be something > nice to add to the SASCo...

SAS/Warehouse Administrator Problem?? or SAS/ACCESS problem?? #2
hello, I've built a process in SAS/Warehouse Administrator, where i'm trying to extract distinct cities from the 3 tables(source schema) in Oracle into a new table (target schema) called CITY and again into UniqueCity (target schema) bcos of some redundancy. The process looks like this. Unique City | | mapping | | CITY ...

Re: R vs. SAS (was Replacement for SAS (SPSS vs. SAS, redux)) #2
Sounds like R is the SAS equivalent of Linux .. who are incidentally in all sorts of a copy left/right mess at the moment. On Thu, 5 Feb 2004 09:39:37 -0500, Peter Flom <flom@NDRI.ORG> wrote: >I use both SAS and R; I"ve used SAS for 10 or 15 years, R for about 6 >months - 1 year. > >Each has strengths and weaknesses; I'd not like to give up either. > >Strengths of SAS (esp. compared to R) > >Tech support - I have SAS tech support's phone number and our license >number memorized. They're great. > >SAS-L - There's also an R-help list...

Re: FTP problem in SAS v9.2 #2
The problem may be with Windows Firewall/McAfee/Other Antivirus programs blocking all but some programs from using FTP. > Our program run on z/OS, but the same problem occurs on windows. > There is no problem accessing the same ftp server from a native ftp client, and ping works as well. > > I have opened an issue with SAS. > > Gadi > > > ...

Re: SAS Sample 1728 Was ---> Re: SAS Sample 1727 #2
Graham , I am not sure that the SI Tech Support examples should have all the error checking that Chang wanted to throw in the macro. The examples should be clear concise and easy to read and get going, as well as be illistrative. Too much error checking in an example well is just over kill and even detrimental to an example. However, any code solution on the SI Tech Support web sit should follow basic rules of good practices and sound advice. Such as with thier macros having atleast a somewhat good Macro design. Look at Example SAS Sample 1728: The first method well lets say is soooo bad...

Re: SAS time problem and formula problem #2
Please re-post your second question and present the formula in-line, as part of the message. SAS-L does not allow attachments. Also make it a separate posting, with its own subject. When a person has two or more unrelated questions, there is no reason to bundle them in one posting. It's not as if one has to pay for postage. Making a separate posting for each question, with appropriate subjects, makes it much easier to carry on and follow the discussions. On Mon, 3 Nov 2003 11:51:14 +0000, Vijay Reddi <Vijay.Reddi@SSL- INTERNATIONAL.COM> wrote: >Hi All, > >I have two probl...

Re: suggest: improve SAS Deployment Wizard for SAS v9.2, phase 2
Subject: Re: v9.2 phase 2, page update "Make the installation of SAS BI Server easier!" .... Ok w/me! Just remember that the majority of us are still just installing only SAS Foundation v9.2, and possibly Enterprise Guide v4.2 My rant/suggestion to Tech Support has been addressed. I have added notes about my conversation with Tech Support to this sas community wiki page: http://www.sascommunity.org/wiki/V9.2_Phase_2_install_guide summary: if you have Build # greater than or equal to 28 then you can dispense with ForceInstall. Ronald J. Fehd, IT Spec HelpDesk Level 3: SAS CDC S...

Re: Newbie SAS Array problem (take 2) #2
Hi Machelle, Nice, good. But you should also declare your arrays dxnum and diagnum as being of character type. And I would even completely avoid this kind of solution. I would use a format instead (with some arrays or some macro code). Create a format for your 46 diagnose codes, like: PROC FORMAT; VALUE $DiagFmt '4270' = 'Paroxysmal supraventricular tachycardia' .............and so on............. ; RUN; And if it is just for presentation then never create a variable with the textual diagnoses, but use the code variables (dx#) instead with the format. If you really n...

Re: SAS/DMS library default library allocations using SAS V8.2 on #2
The library allocations have to be stored <somewhere>, otherwise you wouldn't continue to get the prompt. You can look under your userid to see if it's there (though I suspect you've already done that), but a better question would be directed at the SAS sysadmin--ask them where these profiles/customizations are stored (the sasuser.profile is the generic one--your personal one is concatenated along with it). You may be able to see your session info under your userid tso log (shows usage information), though off the top of my head I can't remember if it captures al...

Re: Running SAS jobs sequentially in batch mode
> Note that unless you clean up work datasets and any macro variables created by each production job, subsequent jobs will not be starting in a pristine environment. It may be a good idea to include a new program between each production job to kill all work datasets and query sashelp.vmacro to create %symdel statements to delete macro variables. Would you be kind enough to give sample statements to do the CLEANING and KILLING? Susie Li TV Guide 1211 Avenue of the Americas New York, NY 10036 Tel 212.852.7453 Email susie.li@tvguide.com -----Original Message----- From: SAS(r) Discussion [m...

Re: SAS 9.2 Update on problem re Help files
On Mon, 25 Aug 2008 09:25:35 -0400, "Peter Flom" <peterflomconsulting@MINDSPRING.COM> said: > Hi again > > A week ago, I asked this list about a problem with 9.2: When you click > "help" it runs an index, but it doesn't save the index when you quite > SAS, so, each time you quit SAS, you lose the index. > > Replies received here did not work, so I wrote to SAS. > > They said, essentially, that it's a known bug, and they are working on > it. So you're responsible for the item in today's Tech Support Notes. Congratulations! That's almost as good as having a disease that gets you mentioned in the MMWR. > > Peter > > Peter L. Flom, PhD > Statistical Consultant > www DOT peterflom DOT com -- Jack Hamilton Sacramento, California jfh@alumni.stanford.org <== Use this, not jfh@stanfordalumni.org ...

Re: Simple SAS problem
You can try like this if grp = B then new_num = num+88 ; else new_num = num ; On Tue, Sep 23, 2008 at 10:47 AM, sas geeks <sasgeeks.jk@gmail.com> wrote: > Hi, > I have the following data > > data have; > input sub grp $ num; > cards; > sub grp num > 1 A 12 > 1 A 54 > 1 A 67 > 1 A 88 > 1 B 1 > 1 B 77 > 1 B 98 > 1 B 105 > run; > > I need the following output > > sub grp num new_num > 1 A 12 12 > 1 A 54 54 > 1 A 67 67 > 1 A 88 88 > 1 B 1 89 > 1 B 77 165 > 1 B 98 186 > 1 B 105 193 > > Basically i need the last 'num' from the grp A and add that to the 'num' in > grp B to get new_num. I am sure it is very easy for most of you. I am just > not getting the idea. > > Thanks > JK > ...

Re: SAS Problem. #2
sas__l@HOTMAIL.COM expertly replied: >Hello, use SAS dates for computing time intervals and such.. >BUT >what is this? Has these two id's been hospitalized 5 times >in this short period? Poor fellas! >Is "enter" .. well, entering .. and "disc" a folowing visit, or? >Please explain if this doesn't get you going. > >data t1; > input enter : ddmmyy10. disc : ddmmyy10. x $ 23 id 25; > interval=intck( 'days', enter, disc); > . . . . . Yes. I agree. Good points all. And, since SAS dates are just the number of days since 1/...

Re: SAS 9.2 Update on problem re Help files #3
Yes, I encountered the same problem, although I hadn't got around to contacting SAS. AnnMaria DeMars, Ph.D. Senior Statistical Consultant University of Southern California Customer Support Center Information Technology Services ademars@usc.edu (213) 740-2840 On Aug 25, 2008, at 6:25 AM, Peter Flom wrote: > Hi again > > A week ago, I asked this list about a problem with 9.2: When you > click "help" it runs an index, but it doesn't save the index when > you quite SAS, so, each time you quit SAS, you lose the index. > > Replies received here did not work, so I wrote to SAS. > > They said, essentially, that it's a known bug, and they are working > on it. > > Peter > > Peter L. Flom, PhD > Statistical Consultant > www DOT peterflom DOT com ...

Re: Autoexec.sas file Dm"pgm;zoom;"; doesnot wrk in SAS 9.2 #2
Hi Ace, The PGM is the editor window up through v6.12 but also still exists today. For the Enhanced Editor you can use: dm editor 'zoom' wedit ; Hope this is helpful. Mark Terjeson Investment Business Intelligence Investment Management & Research Russell Investments 253-439-2367 Russell Global Leaders in Multi-Manager Investing -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Ace Sent: Wednesday, October 14, 2009 5:49 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: Autoexec.sas file Dm"pgm;zoom;"; doesnot wrk in SAS...

Re: Deleting SAS Data from a SAS DATASET #2
Chandra - this isn't my expertise area - I'm sure others may have better ideas but I'll make three comments. If your datasets have a large number of variables, in your datastep method a WHERE clause will be more efficient - the IF statement causes each record to be fully read before it can be selected for deletion. A WHERE clause would only read the single variable in the case of records that meet the criteria for deletion. Data prod.Master_date; set prod.master_date; where snap_dt ne "&end_dt"d; run; You probably would be better off changing your data model though - my first thought would to be to store your data as separate yearly or monthly files and then access them with a view of the past two years or 24 months. With each month or year you would delete the oldest file and change the view one time period forward. *set up the data; data time1 time2 time3 time4; do i = 1 to 100; do t = 1 to 4; if t=1 then output time1; if t=2 then output time2; if t=3 then output time3; if t=4 then output time4; end; end; run; *three successive example views; data filet1 / view=filet1; set time1 time2; run; data filet2 / view=filet2; set time2 time3; run; data filet3 / view=filet3; set time3 time4; run; One more thought - since the data are appended - if the file is not reordered and you have the record counts from each append - then you can use firsto...

Re: Difference Between PC SAS and UNIX SAS #2
I cannot give a complete list by any means for these two systems but there are functions listed in TS486 that are specific to windows and afaik, Sleep is one of these. I suggest that you look at the Companion to the ... Operating System in the online docs for each of these and compare the two systems. Nat Wooding Environmental Specialist III Dominion, Environmental Biology 4111 Castlewood Rd Richmond, VA 23234 Phone:804-271-5313, Fax: 804-271-2977 Suthakar Iyer <suthakariyer@YAH OO.COM> To ...

Re: EWMA in base SAS / or SAS/STAT? #2
>From: Michael Murff <mysasbox@GMAIL.COM> >Reply-To: Michael Murff <mysasbox@GMAIL.COM> >To: SAS-L@LISTSERV.UGA.EDU >Subject: EWMA in base SAS / or SAS/STAT? >Date: Wed, 11 Oct 2006 18:57:15 -0600 > >Hi, > >I'm wondering if others are aware of open source coding for Exponentially >Weighted Moving Average (EWMA) or other advanced time series smoothers (eg. >holt winters) in base SAS? Just putting out a feeler in the hope that I >don't have to reinvent the wheel :-) > >TIA, > >M.M. I'm guessing you're still in that SQC ...

Re: SAS 8.2 = SAS 8.02 ?
On Mon, 6 Dec 2004 10:29:57 -0500, Igor Kurbeko <ikurbeko@ATHEROGENICS.COM> wrote: >Hi, guys. > > > >Are SAS releases 8.2 and 8.02 one and the same? > > > >I wanted to apply hot fix for SAS Release 8.2 (TS2M0) B2BB97. > >But we use SAS 8.02 Hi, Igor, SAS releases 8.2, 8.02, and 8e refer to the same thing Release 8.2 (TS2M0), at least on Windows platform and likely so in other platforms. It seems an outcome of the development and marketing not in sync -- which is much frequent happening in the industry. Like Java 2 is in fact Java 1.2 and above, ms off...

Re: SAS concatenation problem #2
Llyod, The reason you are getting a variable with the length of one is more than likely the fact that the first data set you bring in the data step has a missing value for that variable (the first data set is setting the length of your variables for all the datasets you are brining in.). The easiest way to solve the problem is to use a length statement and set the variable(s) to the length you desire. HTH Toby Dunn -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Lloyd Dollins Sent: Thursday, September 16, 2004 2:19 PM To: SAS-L@LISTSERV.UGA.EDU...

Re: Simple SAS problem #4
JK Try the following data have; input sub grp $ num; cards; 1 A 12 1 A 54 1 A 67 1 A 88 1 B 1 1 B 77 1 B 98 1 B 105 Data wanted; set have; by sub grp; retain lastval 0; new_num = num + lastval; if last.grp then lastval = num; * drop lastval; run; Proc Print; run; Nat Wooding Environmental Specialist III Dominion, Environmental Biology 4111 Castlewood Rd Richmond, VA 23234 Phone:804-271-5313, Fax: 804-271-2977 sas geeks <sasgeeks.jk@GMAI L.COM> To Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU Discussion" cc <SAS-L@LISTSERV.U GA.EDU> Subject Simple SAS problem 09/23/2008 11:47 AM Please respond to sas geeks <sasgeeks.jk@GMAI L.COM> Hi, I have the following data data have; input sub grp $ num; cards; sub grp num 1 A 12 1 A 54 1 A 67 1 A 88 1 B 1 1 B 77 1 B 98 1 B 105 run; I need the following output sub grp num new_num 1 A ...

Re: Simple SAS problem #3
Hi Paul, Your solution is perfect..Thanks i learned how to use retain statement. Hi Sudip, Thank you .Your solution works only for that particular dataset since you suggested using the last number of grp A directly.I guess using retain will be more concrete. Thanks JK On Tue, Sep 23, 2008 at 12:05 PM, Paul Dorfman <sashole@bellsouth.net>wrote: > JK, > > data need (drop = _:) ; > set have ; > by sub grp ; > retain _last_num 0 ; > new_num = num + _last_num ; > if last.grp then _last_num = num ; > run ; > > On Tue, 23 Sep 2008 11:47:29 -0400, sas geeks <sasgeeks.jk@GMAIL.COM> > wrote: > > >Hi, > > I have the following data > > > >data have; > >input sub grp $ num; > >cards; > >sub grp num > >1 A 12 > >1 A 54 > >1 A 67 > >1 A 88 > >1 B 1 > >1 B 77 > >1 B 98 > >1 B 105 > >run; > > > >I need the following output > > > > sub grp num new_num > >1 A 12 12 > >1 A 54 54 > >1 A 67 67 > >1 A 88 88 > >1 B 1 89 > >1 B 77 165 > >1 B 98 186 > >1 B 105 193 > > > >Basically i need the last 'num' ...

Web resources about - Re: Simple SAS problem #2 - comp.soft-sys.sas

Problem novel - Wikipedia, the free encyclopedia
Working class, or proletarian novels are often also social problem novels . This was in many ways a reaction to rapid industrialization , and ...

SmartPot Problems: Marijuana And The Internet Of Things
What happens when you combine cannabis, whose laws are changing almost daily, with technologies that are constantly evolving as well?

Sanders Wins Millennial Women Two-to-One; Clinton Would Have Millennial Problem in General Election
Just some of the information from a new USA Today poll ( source ) by Gaius Publius Buried in a USA Today polling story with the headline "Poll ...

No Manuel! The Government Is the Problem. Not The Exits.
I find it difficult to publicly refute Manuel Trajtenberg. He is a man of high integrity and has done wonderful things for the State of Israel. ...

Ford has solved a problem for owners of its biggest pickup trucks
For a lot of drivers, it's hard to imagine life before cameras on cars and trucks. Rear-, side, and forward cameras have made parallel parking ...

Reports of voting problems surface in Florida primary
Some voting machines in the Jacksonville area were down Tuesday morning, and some Orlando-area reportedly ran out of ballots

Kensho Trade: Fed's dollar problem
Using Kensho, we looked at which securities perform the best and the worst if the U.S. dollar rises in reaction to the Fed's statement Wednesday. ...

Vizio says new TV certification program has 'serious problems'
One of the most popular TV companies not in the UHD Alliance is Vizio, and turns out, it has some pretty strong feelings about it.

Apple cites iPhone, Mac security problems in rebuttal to FBI demands
In a lengthy legal rebuttal to the U.S. government, Apple yesterday deployed an unusual defense that its devices are susceptible to attack to ...

eBay Solves The Most Annoying Problem Of Selling: Packing Things And Shipping Them
There’s a problem with being only an occasional eBay seller: you don’t have a warehouse full of boxes and packing material like a full-time business. ...

Resources last updated: 3/16/2016 7:07:11 PM