f



Re: Need help ASAP

I'd go with a proc sql solution, myself, but if I correctly understand
your specs, I'd use something like:

data have;
  input facility $   member;
  cards;
sas  12
sad   34
ret    45
sad   56
sad   56
;
proc sql;
  select distinct facility,count(*)
    from (select distinct facility,member
            from have)
      group by facility
;
quit;

Art
---------
On Wed, 31 Dec 2008 13:46:41 -0800, sdlenter <sdlentert@AOL.COM> wrote:

>I have a dataset
>facility   member
>sas  12
>sad   34
>ret    45
>sad   56
>sad   56
>
>I need to have a list of all facilities with a count of unique members
>for each:
>
>sas    1
>sad  2
>ret   1
>Thank you
0
art297 (4213)
12/31/2008 10:08:17 PM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

0 Replies
286 Views

Similar Articles

[PageSpeed] 2

Reply:

Similar Artilces:

Re: Old SAS Guy needs help with some of these new fangled SAS
Hi John, I believe PROC IMPORT writes dedicated data step code to the log that you can reuse. Regards - Jim. -- Jim Groeneveld, Netherlands Statistician, SAS consultant home.hccnet.nl/jim.groeneveld On Tue, 2 Dec 2008 00:26:53 -0600, John F. Regus <jfregus@IX.NETCOM.COM> wrote: >Greetings all who have helped me in the past. > >Here is something that has been bothering me unending and is causing me sleepless afternoons. > >I know that I can import just about any file imaginable into SAS using the import function using SAS Windows 9.1.3. >However, when trying to get comma seperated values moved all at once into the new SAS file, >I can (or only know how to get) the data for one variable moved at a time. I would like to do a mass >move of all the data from the input file into the new SAS file. Is there a way to do this? Because once > I have imported the file into a new SAS file, established variable names, established formats, informats, >variable lengths, etc. I would like to be able to save the settings for the next like file that I want to import into what I have >already slaved over doing, defining, etc., without repeating the process. > >Is there a way to do this? > >Waiting with bad breath on the sidelines. > >The Old SYS/390 guy >"SAS was originally invented for computer performance and capacity planning for the SYS/3x0 IBM machines... >they sure have taken it into new features that are amazing&...

Re: Old SAS Guy needs help with some of these new fangled SAS #2
It's been a while since I used the Import Wizard but as I recall, there is a window which asks for a file name where SAS can store the input statments for your future use. Nat Wooding Environmental Specialist III Dominion, Environmental Biology 4111 Castlewood Rd Richmond, VA 23234 Phone:804-271-5313, Fax: 804-271-2977 Jim Groeneveld <jim.1stat@YAHOO. COM> To Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU Discussion" cc <SAS-L@LISTSERV.U GA.EDU> Subject Re: Old SAS Guy needs help with some of these new fangled SAS 12/02/2008 04:49 9.1.3 gizmos for Windows AM Please respond to Jim Groeneveld <jim.1stat@YAHOO. COM> Hi John, I believe PROC IMPORT writes dedicated data step code to the log that you can reuse. Regards - Jim. -- Jim Groeneveld, Netherlands Statistician, SAS consultant home.hccnet.nl/jim.groeneveld On Tue, 2 Dec 2008 00:26:53 -0600, John F. Regus <jfregus@IX.NETCOM.COM> wrote: >Greetings all who have helped me in the past. > >Here is something that has been bothering me unending and is causing me sl...

Re: SAS help needed
Data Have ; Infile Cards ; Input sno dt Date9. ; Cards ; 1011 01jan2000 1012 02jan2000 1012 03jan2000 1012 04jan2000 1012 05jan2000 1012 06jan2000 1012 07jan2000 1013 03jan2000 1013 04jan2000 1013 05jan2000 1013 06jan2000 1013 07jan2000 ; Run ; Data Need ( Drop = Cnt ) ; Length NewVar $ 2 ; Set Have ; By Sno ; Retian Newvar ; If First.SNO Then Do ; Cnt + 1 ; NewVar = CatS( 'A' , Cnt ) ; End ; Run ; Proc Print Data = Need ; Format DT Date9. ; Run ; Toby Dunn If anything simply cannot go wrong, it will anyway. Murphys Law #2. The buddy system is essential to your survival;...

Re: I need help with SAS Macro
Hi Brian, Here is one approach: %Let Start_Month=200510; %Let End_Month=200601; %macro mklibs; %let stmo=%sysfunc(inputn(&Start_Month,yymmn6.)); %let enmo=%sysfunc(inputn(&End_Month,yymmn6.)); %do theDate = &stmo %to &enmo; %let yyyymm=%sysfunc(putn(&theDate,yymmn6.)); LIBNAME D&yyyymm "EEAR.AAA.BBB.XXX.MB&yyyymm" DISP=SHR; %let theDate=%sysfunc(intnx(month,&theDate,0,e)); %end; %mend; %mklibs; Hope this is helpful. Mark Terjeson Senior Programmer Analyst Investment Management & Research Russell...

Re: Need help ASAP #2
data have; input facility $ member; cards; sas 12 sad 34 ret 45 sad 56 sad 56 ; proc sql; create table want as select facility,count( facility) as count from have group by facility; quit; On Wed, Dec 31, 2008 at 3:46 PM, sdlenter <sdlentert@aol.com> wrote: > I have a dataset > facility member > sas 12 > sad 34 > ret 45 > sad 56 > sad 56 > > I need to have a list of all facilities with a count of unique members > for each: > > sas 1 > sad 2 > ret 1 > Thank you > ...

Re: Help Needed in SAS #3
Pavan, you cannot find any other list thats so friendly as SAS-l. But again expecting answers for that much questions really doesnt make sense.....So, when you have an idea or answer for those questions, explicitly write yours and someone here will correct you or give more appropriate or best answer.....but again expecting just answers may not be the right way....as David said, may be couple of them would be ok..... On Tue, 30 May 2006 23:39:22 -0700, pavan <pavankumarm_in@YAHOO.COM> wrote: >Actually , i am also an employee only ...i had collected this quetions >from Net . > ...

Re: Need help ASAP #3
Some corrections: Proc summary NWAY data=3Dfacilitymember; class facility member; output out=3Dwhatever sum=3D; =A0 PROC FREQ DATA=3Dwhatever; TABLES facility/NOPRINT OUT=3Dsomething (KEEP=3Dfacility COUNT); RUN; =A0 , Jay Jacob Wind <jay.wind@ATT.NET> wrote: From: Jay Jacob Wind <jay.wind@ATT.NET> Subject: Need help ASAP To: SAS-L@LISTSERV.UGA.EDU Date: Thursday, January 1, 2009, 7:40 PM > Date: Wed, 31 Dec 2008 13:46:41 -0800 > From: sdlenter > Subject: Need help ASAP > > I have a dataset > facility member > sas 12 > sad 34 > ret 45 > sad 56 > sad 56 > > I need to have a list of all facilities with a count of unique members > for each: > > sas 1 > sad 2 > ret 1 PROC FREQ DATA=3Dwhatever; TABLES facility/NOPRINT OUT=3Dsomething (KEEP=3Dfacility COUNT); RUN; -- -- Thank you -- Jay Jacob Wind =0A=0A=0A ...

Re: Need help ASAP #8
Here's an SQL approach: proc sql; select facility, count(*) as n label=3D'N Unique Members' from = (select distinct facility, member from have) group by facility;quit; On Wed, Dec 31, 2008 at 3:46 PM, sdlenter <sdlentert@aol.com> wrote: > I have a dataset > facility member > sas 12 > sad 34 > ret 45 > sad 56 > sad 56 > > I need to have a list of all facilities with a count of unique members > for each: > > sas 1 > sad 2 > ret 1 > Thank you ...

Re: Need Help with SAS Merge
I hope that Brian's actual application is brimming with logic: I find very little in the sample data. This is not difficult to do, not necessarily with MERGE. I'd use SET ... POINT=, something like (tested): data three; set two; ptr + 1; if ptr > nn then ptr = 1; set one point = ptr nobs = nn; run; That this should be useful to someone ... Prosit, Puddin' ******************************************************* ***** Puddin' Man **** Pudding_Man-at-mail.com ******** *******************************************************; A few words re "The Common Ground&...

Re: Need help ASAP #9
A slightly simpler SQL solution: PROC SQL; create table want as select facility, count(distinct member) as n label='N Unique Members' from have group by facility; quit; On Fri, 2 Jan 2009 10:38:37 -0600, Hoyle, Larry <larryhoyle@KU.EDU> wrote: >Here's an SQL approach: >proc sql; select facility, count(*) as n label='N Unique Members' from (select distinct facility, member from have) group by facility;quit; >On Wed, Dec 31, 2008 at 3:46 PM, sdlenter <sdlentert@aol.com> wrote: > >> I have a dataset >> facility member >> sas 12 >> sad 34 >> ret 45 >> sad 56 >> sad 56 >> >> I need to have a list of all facilities with a count of unique members >> for each: >> >> sas 1 >> sad 2 >> ret 1 >> Thank you ...

Re: Need Help in learning SAS...........
Ruskanna, Before anyone attempts to answer your request, please tell the list more about yourself (e.g., education, major and the type of job you are seeking). The answers will be quite different if you are seeking a job programming SAS, accomplishing data mining-related tasks, doing statistical analyses, or whatever. Art ---------- On Sun, 17 Apr 2005 15:51:39 -0700, ruksana <ruksana_anjum@REDIFFMAIL.COM> wrote: >hi there, >i am a student learning SAS on own can u plz guide me. >i am in search of job and i want to know th topic on >which i should be perfect. can u plz he...

Re: need sas help! #2
Does this do what you want: Data Vector1; input a b c d; cards; 1 2 3 4 5 6 7 8 run; Data Vector2; set vector1; vector = 0; array one a b c d; array two v1 v2 v3 v4; do over one; vector = vector + one; two = vector ; end; drop vector; run; Proc Print; run; By the way, the Do OVER is an old form of writing a SAS array that no longer appears in documentation but is very simple to write. I would not use it in production code that I would expect to be in use for a number of years but I do use it for ad hoc work. Nat Wooding Environmental Specialist III Dominion, Environmental Biology 4111 Castlewood Rd Richmond, VA 23234 Phone:804-271-5313, Fax: 804-271-2977 Cel Phone: 804-205-0752 Liang Xu <ilannyxu@GMAIL.C OM> To Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU Discussion" cc <SAS-L@LISTSERV.U GA.EDU> Subject need sas help! 06/29/2009 03:57 AM Please respond to Liang Xu <ilannyxu@GMAIL.C OM> I have a vector like (a,b,c,d)', and I need to generate a new vector like (a,a+b,a+b+c,a+b+c+d)'. How c...

Re: SAS help needed #2
Look at the BY statement and the FIRST.xx temporary variable. They will tell you when you need to reset the suffix of new_var. Look at the MOD function. It will allow to cycle the suffix every n entries. Look at the RETAIN statement. It will let you keep a the value of a counter across iterations of your DATA step. Look at the PUT function. It will let you construct a value from different pieces. You may also use the concatenation operator as part of this process. Try to use a more descriptive title in the future. It would also help if you gave some indication that you tried to do th...

Re: Need help ASAP #7
The OP seems to want counts of unique counts, so I don't think a basic freq or summary will work. If you want to use procs I think you will need 2 passes through the data. Alternatively use Arthurs sql suggestion. Happy new year all! data have; input facility $ member; cards; sas 12 sad 34 ret 45 sad 56 sad 56 ;run; proc summary data=have nway; class facility member; output out=intermediate(keep=facility); run; proc freq data=intermediate; tables facility/noprint out=want(drop=percent); run; 2009/1/2 BILL WEST <wm_a_west@yahoo.com>: > I dont have access to sas now so didn't try it but you're right, the sum= won't work. However I think the _freq_ variable that is output should be same as the total number of unique facility member combinations. > > With kind regards, > > Bill West > > > --- On Fri, 1/2/09, John Chapman <john.chapman@VIRGINBROADBAND.COM.AU> wrote: > > From: John Chapman <john.chapman@VIRGINBROADBAND.COM.AU> > Subject: Re: Need help ASAP > To: SAS-L@LISTSERV.UGA.EDU > Date: Friday, January 2, 2009, 8:36 AM > > Will that proc summary work with sum= but no var statement? > > BILL WEST wrote: >> Some corrections: >> >> Proc summary NWAY data=facilitymember; >> class facility member; >> output out=whatever sum=; >> >> PROC FREQ DATA=whatever; >> TABLES facility/NOPRINT OUT=something (KEEP=facility COUNT); >...

Re: Help Needed in SAS #12
The One Master sagely replied: >Pavan, > >You have claimed to have collected these questions from the "Net". For >those who doubt that this is possible, I point out that on March 31 Sa Palo >asked a sequence of questions (also ridiculed) under the subject, "Re: Help >needed with some SAS interview questions!". His first question > > >>1) Under what circumstances would you code a SELECT construct instead > of IF statements? > >and his eighth > > >>8)Name statements that function at both compile and execution time. &g...

Re: Need help ASAP #5
Will that proc summary work with sum= but no var statement? BILL WEST wrote: > Some corrections: > > Proc summary NWAY data=facilitymember; > class facility member; > output out=whatever sum=; > > PROC FREQ DATA=whatever; > TABLES facility/NOPRINT OUT=something (KEEP=facility COUNT); > RUN; > > > > , Jay Jacob Wind <jay.wind@ATT.NET> wrote: > > From: Jay Jacob Wind <jay.wind@ATT.NET> > Subject: Need help ASAP > To: SAS-L@LISTSERV.UGA.EDU > Date: Thursday, January 1, 2009, 7:40 PM > > >> Date: Wed, 31 Dec 2008 13:46:41 -0800 >> From: sdlenter >> Subject: Need help ASAP >> >> I have a dataset >> facility member >> sas 12 >> sad 34 >> ret 45 >> sad 56 >> sad 56 >> >> I need to have a list of all facilities with a count of unique members >> for each: >> >> sas 1 >> sad 2 >> ret 1 >> > > PROC FREQ DATA=whatever; > TABLES facility/NOPRINT OUT=something (KEEP=facility COUNT); > RUN; > -- > -- Thank you > -- Jay Jacob Wind > > > > > > > > > > ...

Re: need help in SAS prog.
Do you want the output to look like 1 1 1 2 1 3 1 4 2 1... or like 1 4 1 4 1 4 1 4 2 3... or like 1 4 2 3...? -----Original Message----- From: Santughosh001@GMAIL.COM [mailto:snip] Sent: Friday, July 13, 2007 10:17 PM To: SAS-L@LISTSERV.UGA.EDU Subject: need help in SAS prog. Hi guys, I need your help in the SAS prog. I have a data set like below. 1 1 1 1 2 2 2 3 3 I have to add a new variable count. which counts t...

Re: Need help ASAP #6
I dont have access to sas now so didn't try it but you're right, the sum=3D= won't work.=A0 However I think=A0the _freq_ variable that is output should= be same as the total number of unique facility member combinations. With kind regards, Bill West =A0 --- On Fri, 1/2/09, John Chapman <john.chapman@VIRGINBROADBAND.COM.AU> wrot= e: From: John Chapman <john.chapman@VIRGINBROADBAND.COM.AU> Subject: Re: Need help ASAP To: SAS-L@LISTSERV.UGA.EDU Date: Friday, January 2, 2009, 8:36 AM Will that proc summary work with sum=3D but no var statement? BILL WEST wrote: > Some corrections: > > Proc summary NWAY data=3Dfacilitymember; > class facility member; > output out=3Dwhatever sum=3D; > > PROC FREQ DATA=3Dwhatever; > TABLES facility/NOPRINT OUT=3Dsomething (KEEP=3Dfacility COUNT); > RUN; > > > > , Jay Jacob Wind <jay.wind@ATT.NET> wrote: > > From: Jay Jacob Wind <jay.wind@ATT.NET> > Subject: Need help ASAP > To: SAS-L@LISTSERV.UGA.EDU > Date: Thursday, January 1, 2009, 7:40 PM > > >> Date: Wed, 31 Dec 2008 13:46:41 -0800 >> From: sdlenter >> Subject: Need help ASAP >> >> I have a dataset >> facility member >> sas 12 >> sad 34 >> ret 45 >> sad 56 >> sad 56 >> >> I need to have a list of all facilities with a count of unique members >> for each: >> >> sas 1 >> sad 2 >> ret 1 &g...

Re: Need help ASAP #4
Proc summary data=3Dfacilitymember; class facitlity member; output out=3Dwhatever sum=3D; =A0 PROC FREQ DATA=3Dwhatever; TABLES facility/NOPRINT OUT=3Dsomething (KEEP=3Dfacility COUNT); RUN; =A0 , Jay Jacob Wind <jay.wind@ATT.NET> wrote: From: Jay Jacob Wind <jay.wind@ATT.NET> Subject: Need help ASAP To: SAS-L@LISTSERV.UGA.EDU Date: Thursday, January 1, 2009, 7:40 PM > Date: Wed, 31 Dec 2008 13:46:41 -0800 > From: sdlenter > Subject: Need help ASAP > > I have a dataset > facility member > sas 12 > sad 34 > ret 45 > sad 56 > sad 56 > > I need to have a list of all facilities with a count of unique members > for each: > > sas 1 > sad 2 > ret 1 PROC FREQ DATA=3Dwhatever; TABLES facility/NOPRINT OUT=3Dsomething (KEEP=3Dfacility COUNT); RUN; -- -- Thank you -- Jay Jacob Wind =0A=0A=0A ...

Re: Need Help ASAP with intck
Try using 'day' then, or some other interval. -Joe On Fri, May 1, 2009 at 1:20 PM, <sdlentertd@gmail.com> wrote: > Need to track medical claims of people who are 65+ > Time period of measurement is two years, from Mar2007 to Mar2009.... > what if during this time someone turns 65 (example in 2008)... using > the code > that has '01APR2007'd wouldn't be accurate b/c the person would turn > 65 in 2008 and should be captured after he turns 65... so > 1) pull all members who are 65 as of today and then when I compare > that table to get the actualy members who had medical claims during > the last 2 years and then only choose those ones apply... here is an > example > > NAME DOB CLAIMS Date of Fill > PersonA 3/5/1944 1 3/4/2009 (this claim would be excluded) > PersonA 3/5/1944 5 3/8/2009 (this on is included b/c at the > time of fill the person was alrady 65) > How do I put this in a code? > > This code does NOT work exacly the way it needs to work... only if the > difference between DOB and Date of Fill is one month then it works... > if floor((intck('month', dob, date_of_fill)-(day(date_of_fill) < day > (dob)) ) / 12) LT 65 > and this code does NOT work if intnx('year',dob,65,'S') GT > date_of_fill > ...

need help re: sas and unix
have a couple of .cgi and .sas files. how are they related?? they have the same file names On Sunday, 21 April 2013 07:11:06 UTC+5:30, wrote: > have a couple of .cgi and .sas files. how are they related?? Hi [Anonymous], the .Cgi file is nothing but the Common Gateway Interface with deals with the source code file format used for website formatting. where as .SAS file is editor code for the execution. ...

Re: Help Needed in SAS #8
Chang, All good points. This garbage has been floating around the Net for a long time, and I have seen some of them fairly recently mentioned on sas-l. Even though some of the questions make sense while some others are extremely out of ballpark, to me this is not the issue of good interview questions vs bad interview questions. It is rather whether to ask them at all, and my answer to *this* question is a resounding "no". Learning the questions perceived "right" by an interviewer not knowing the first thing about SAS (and whom else this questionnaire can be for?) is a sim...

Re: Need Help with SAS Merge #3
Brian Vuong <brianvuong@YAHOO.COM> wrote [in part]: > Hello, I am new to SAS. I need help with SAS merge below. Any help > is greatly appreciated. > > . . . . > > EXPECTED OUTPUT THAT THE FIRST DATA SET IS MERGED WITH THE DATA SET > TWO, AND THE NUMBER RECORDS SHOULD BE EQUAL TO THE NUMBER OF RECORDS > IN DATA SET TWO; > > > AA 001 > AB 002 > AC 003 > AD 004 > BA 005 > BB 001 > BC 002 > BD 003 > CA 004 > CB 005 > CC 001 > CD 002 This seems like a very bad idea....

Re: Need SAS RegEx Help ! #2
Alan: Thank you so much for taking the time assist us -- it works great ! It's not fun being in on the weekend, but thanks to you, we will be a little further along in this project. Again, thank you, it's much appreciated :-) ! -Gerry -----Original Message----- From: Alan Churchill [mailto:SASL001@savian.net] Sent: Friday, November 17, 2006 7:57 PM To: 'Gerry'; SAS-L@LISTSERV.UGA.EDU Subject: RE: Need SAS RegEx Help ! Even better: data _null_ ; input; _infile_ = prxchange('s/<href="\.{2}\//<href="\//',-1,_infile_) ; put _infile_; datalines; <href="../myimages/office/xxx.pdf">XXX</A> ; run; .... 33 data _null_ ; 34 input; 35 _infile_ = prxchange('s/<href="\.{2}\//<href="\//',-1,_infile_) ; 36 put _infile_; 37 datalines; <href="/myimages/office/xxx.pdf">XXX</A> NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 39 ; 40 run; Alan Churchill Savian "Bridging SAS and Microsoft Technologies" www.savian.net -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Gerry Sent: Friday, November 17, 2006 3:04 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Need SAS RegEx Help ! SAS RegEx Gurus: Below is test code that I was using to help one of our programmers. We've gotten through 4 programs so far, with sim...

Web resources about - Re: Need help ASAP - comp.soft-sys.sas

Cruz Campaign Accuses Fox News of Bending Its Rules for Donald Trump
The Ted Cruz campaign was a bit miffed at Fox News Wednesday morning when Donald Trump called in for a Fox & Friends interview, something they ...

PlayStation VR launch lineup has five slick Sony-made games
Come October, Sony's PlayStation VR will hit the shops for the princely sum of $399/£349/€399 . That's far cheaper than the likes of the Oculus ...

Brussels shooting: ISIS flag, ammo found in raid tied to Paris attacks
CNN Brussels shooting: ISIS flag, ammo found in raid tied to Paris attacks CNN (CNN) The police raid of a Brussels apartment tied to last ...

WSJ corroborates earlier reports: Apple working on stronger iCloud encryption, balancing privacy against ...
The Wall Street Journal is corroborating several reports from February that Apple is working on new iCloud backup encryption methods that will ...

Indiana Jones will return with Harrison Ford in 2019: huzzah or please stop?
When it comes to Harrison Ford, I am an unabashed fan. So when I tell you that Harrison is re-teaming with Steven Spielberg to make a fifth Indiana ...

Questions, answers on new rules for Americans visiting Cuba
WASHINGTON (AP) — Cuba is bracing for an influx of American visitors in the years following the Obama administration's move to do away with the ...

Feds Bust Celebrity Nude-Photo Hacker
Federal prosecutors charged a Pennsylvania man with felony computer hacking related to the theft of hundreds of nude photos of Jennifer Lawrence, ...

Instagram Begins Experimenting With a Non-Chronological Timeline
Instagram, like Twitter before it , is starting to learn there’s no money in letting your best posts disappear to the ravages of time. The service ...

The Latest on DC subway shutdown: Stations are eerily quiet
WASHINGTON (AP) — The Latest on a daylong shutdown of the Washington area's Metro subway system (all times local):

Google's identity services now cover more apps including Office 365
Google is expanding its single sign-on umbrella to cover a number of new third-party offerings including Microsoft's productivity juggernaut ...

Resources last updated: 3/16/2016 2:17:33 PM