f



Re: Help on data creation for SAS

data A;
set B;
where time=0;
run;



On 11/28/06, Kumar <iyer.bharath@gmail.com> wrote:
>
> Dear Sir,
>
> I have data set that i am preparing for use in NONMEM. I used an
> existing macro in SAS to create the data file, but i am able to read
> only the first row which is the data at time zero (a sample of the data
> set shown below) none of the other observations are recorded onto my
> output file... Can you please help me
>
> DATA A;
>
> SET B;
>
> BY ID;
>
> IF FIRST.ID THEN DO;
>
>        EVID = 1;
>        MDV = 1;
>        DV= 0;
>        CMT = 1;
>        AMT = DOSE;
>        OUTPUT;
>        AMT= .;
>       EVID = 0;
>        DV = CONC;
>        CMT = 2;
>       END;
>       ELSE DO;
>       AMT = .;
>       EVID = 0;
>       DV = CONC;
>       CMT = 2;
>       END;
>      RUN;
>
> Sample Data Set
>
>
>
> ID    TIME    CONC    DOSE
> 101     0       0       5000
> 101     0.25    0       5000
> 101     0.5     1.8     5000
> 101     0.75    16.5    5000
> 101     1       20.9    5000
> 101     1.5     32.3    5000
> 101     2       28.2    5000
> 101     3       24.7    5000
> 101     4       24.4    5000
> 102           0               0            5000
> 102             0.25        20           5000
>
>
> Regards
> Kumar
>
0
zhangyu05 (652)
11/28/2006 8:08:07 PM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

0 Replies
339 Views

Similar Articles

[PageSpeed] 9

Reply:

Similar Artilces:

Re: Help on data creation for SAS #5
Kumar , You have an explicit output statement in your first do loop block. When you explicitly code an output statement it overrides the implicit one inherent in the data steps do-loop. Thus, you only get the first observations which happen to correspond to time zero in yoru output data set. If you want more than just the first observation of your by group you will need to either get rid of that output statement and let the default data steps do-loop output statement take over or you will need to code more output statements where appropriate. Toby Dunn Quickly, bring me a beaker of wine, so that I may wet my mind and say something clever. Aristophanes Wise people, even though all laws were abolished, would still lead the same life. Aristophanes You should not decide until you have heard what both have to say. Aristophanes From: Kumar <iyer.bharath@GMAIL.COM> Reply-To: Kumar <iyer.bharath@GMAIL.COM> To: SAS-L@LISTSERV.UGA.EDU Subject: Help on data creation for SAS Date: Tue, 28 Nov 2006 12:01:14 -0800 Dear Sir, I have data set that i am preparing for use in NONMEM. I used an existing macro in SAS to create the data file, but i am able to read only the first row which is the data at time zero (a sample of the data set shown below) none of the other observations are recorded onto my output file... Can you please help me DATA A; SET B; BY ID; IF FIRST.ID THEN DO; EVID = 1; MDV = 1; DV= 0; CMT = 1; A...

Re: Help on data creation for SAS #2
You need to remove the 'output' statement. Once the output is used in data step, the default implied output is broken. Since you did not ask SAS to output other records (except the first.id), they will not be output. Another way is to add a output statement after the if then. On Tue, 28 Nov 2006 12:01:14 -0800, Kumar <iyer.bharath@GMAIL.COM> wrote: >Dear Sir, > >I have data set that i am preparing for use in NONMEM. I used an >existing macro in SAS to create the data file, but i am able to read >only the first row which is the data at time zero (a sample of the data >set shown below) none of the other observations are recorded onto my >output file... Can you please help me > >DATA A; > >SET B; > >BY ID; > >IF FIRST.ID THEN DO; > > EVID = 1; > MDV = 1; > DV= 0; > CMT = 1; > AMT = DOSE; > OUTPUT; > AMT= .; > EVID = 0; > DV = CONC; > CMT = 2; > END; > ELSE DO; > AMT = .; > EVID = 0; > DV = CONC; > CMT = 2; > END; > RUN; > >Sample Data Set > > > > ID TIME CONC DOSE >101 0 0 5000 >101 0.25 0 5000 >101 0.5 1.8 5000 >101 0.75 16.5 5000 >101 1 20.9 5000 >101 1.5 32.3 5000 >101 2 28.2 5000 >101 3 24.7 50...

Re: Help on data creation for SAS #6
Jack and Ya have pointed out your problem. In addition, I see some redundancy within If first.id then do ..... block. After writing the record out you are resetting the values identical to the conditions within the ELSE DO block. If a second record is required to be written for the first.id then you need another OUTPUT statement before the end. It is hard to guess what is needed without further details. You have made a good effort by giving us a sample. Can you also provide a sample output for the corresponding sample input? In other words provide: 1. What you have (the input) 2. What you want out of it (the output) Somebody will proide a response in due course. Venky Chakravarthy On Tue, 28 Nov 2006 15:23:29 -0500, Jack Clark <JClark@CHPDM.UMBC.EDU> wrote: >Kumar, > >The use of only 1 OUTPUT statement is at least part of the problem. When >you explicitly code an OUTPUT statement in the DATA step, you have to >explicitly code it in each place you want to output. > >In the code that you sent, the OUTPUT statement only processes when >FIRST.ID. Try adding another OUTPUT statement at the end of the ELSE DO >block. > >DATA A; >SET B; >BY ID; >IF FIRST.ID THEN DO; > EVID = 1; > MDV = 1; > DV= 0; > CMT = 1; > AMT = DOSE; > OUTPUT; > AMT= .; > EVID = 0; > DV = CONC; > CMT = 2; >END; >ELSE DO; > AMT = .; > ...

Re: Help on data creation for SAS #3
Kumar, The use of only 1 OUTPUT statement is at least part of the problem. When you explicitly code an OUTPUT statement in the DATA step, you have to explicitly code it in each place you want to output. In the code that you sent, the OUTPUT statement only processes when FIRST.ID. Try adding another OUTPUT statement at the end of the ELSE DO block. DATA A; SET B; BY ID; IF FIRST.ID THEN DO; EVID = 1; MDV = 1; DV= 0; CMT = 1; AMT = DOSE; OUTPUT; AMT= .; EVID = 0; DV = CONC; CMT = 2; END; ELSE DO; AMT = .; EVID = 0; DV = CONC; CMT = 2; OUTPUT; END; RUN; Jack Clark Research Analyst Center for Health Program Development and Management University of Maryland, Baltimore County -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Kumar Sent: Tuesday, November 28, 2006 3:01 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Help on data creation for SAS Dear Sir, I have data set that i am preparing for use in NONMEM. I used an existing macro in SAS to create the data file, but i am able to read only the first row which is the data at time zero (a sample of the data set shown below) none of the other observations are recorded onto my output file... Can you please help me DATA A; SET B; BY ID; IF FIRST.ID THEN DO; EVID = 1; MDV = 1; DV= 0; CMT = 1; AMT = DOSE; OUTPUT; AMT...

Re: Help on data creation for SAS #4
The reason why you get only one row for id 101 is becuase your by variable is id.If you want a unique combination of ID and time you will have to include both of them in the by statement. HTH Mona ----- Original Message ---- From: Kumar <iyer.bharath@GMAIL.COM> To: SAS-L@LISTSERV.UGA.EDU Sent: Tuesday, November 28, 2006 3:01:14 PM Subject: Help on data creation for SAS Dear Sir, I have data set that i am preparing for use in NONMEM. I used an existing macro in SAS to create the data file, but i am able to read only the first row which is the data at time zero (a sample of the data set shown below) none of the other observations are recorded onto my output file... Can you please help me DATA A; SET B; BY ID; IF FIRST.ID THEN DO; EVID = 1; MDV = 1; DV= 0; CMT = 1; AMT = DOSE; OUTPUT; AMT= .; EVID = 0; DV = CONC; CMT = 2; END; ELSE DO; AMT = .; EVID = 0; DV = CONC; CMT = 2; END; RUN; Sample Data Set ID TIME CONC DOSE 101 0 0 5000 101 0.25 0 5000 101 0.5 1.8 5000 101 0.75 16.5 5000 101 1 20.9 5000 101 1.5 32.3 5000 101 2 28.2 5000 101 3 24.7 5000 101 4 24.4 5000 102 0 0 5000 102 0.25 20 5000 Regards Kumar ...

Re: What r the data types in SAS? in Base SAS , and SAS SQL
> From: Amar Mundankar > Sent: Tuesday, July 21, 2009 8:10 AM > To: sas-l@uga.edu > Subject: What r the data types in SAS? in Base SAS , and SAS SQL > > Hi all, > What are the different data types in Base SAS and SAS SQL?? character, lengths from 1 to 32,000+ numeric: lengths from 2 to 8 dates are a subtype of numeric and are identified by their date, datetime, or time formats the new proc TSPL (Table Server Processing Language) supports ANSI data types: bigint, tinyint, etc. http://support.sas.com/documentation/cdl/en/tsag/30878/HTML/default/a003 065339.htm http://s...

Re: How to filter sas data sets into separate sas data sets
Lizette, a quick question first: what release of SAS are you using? Seems like an ideal task for a hash solution. Hashes however are only available with SAS version 9. Robert Bardos Ansys AG, Zurich, Switzerland > -----Ursprüngliche Nachricht----- > Von: SAS(r) Discussion > [mailto:SAS-L@LISTSERV.UGA.EDU]Im Auftrag von > Lizette Koehler > Gesendet: Montag, 2. April 2007 16:53 > An: SAS-L@LISTSERV.UGA.EDU > Betreff: How to filter sas data sets into separate sas data sets > > > Listers, > > This is my failing point in coding SAS. The use of 2 > separate SAS data sets to create a third. > > I can do this in a program with nested Do loops. But > with SAS it is just different enough I seem to be > unable to see the coding technique. > > Problem: > > Sas Data set 1 contains 1 variable and 1000 obs. > Sas Data set 2 contains 15 variables and 500000 obs. > > I need to filter off the data in Sas data set 2 based > on Sas data set 1 > > Node1, Node2 and Node3 must match VAR1 exactly. I have > all the code I need to do this except for splitting the > data into a separate SAS data set (NEWLISTS). > > > Psuedo code: > > Sas Data set 1: Var1 Length 7 Char > Sas Data set 2: Node1 Length 1-8 Char Node2 Length > 1-8 Char Node3 Length 1-8 Char > > > > Data Newlist (KEEP=node1 node2 node3 ... var15) > Otherds (Keep=node1 node2 node3 .... var15) ; > ...

Re: How to filter sas data sets into separate sas data sets #8
On Mon, 2 Apr 2007 23:37:16 +0000, Ian Whitlock <iw1junk@COMCAST.NET> wrote: >Summary: You need a loop and the POINT option or SQL >#iw-value=1 > >Lizette, > >I think a lot of respondents have misunderstood the problem. This probably >could have been avoided with a simplified example. Here is my >interpretation. Here is code to generate data. > > data control ; > do var1 = 1 to 4 ; output ; end ; > run ; > > data tosplit ; > input node1 node2 node3 other ; > cards ; > 1 2 3 4 > 1 2 3 5 > 7 7 7 7 > ; Here are test data generators which conform to the actual scale of the problem. data control; do _n_ = 1 to 1000; var1 = floor(ranuni(135)* 100000); output; end; run; data tosplit; do other = 1 to 500000; node1 = floor(ranuni(246)* 100000); node2 = floor(ranuni(246)* 100000); node3 = floor(ranuni(246)* 100000); output; end; run; > >Here is a way to split using the DATA step. > > data newlist other ; > drop flag var1 ; > set tosplit ; > do pt = 1 to nobs ; > set control point = pt nobs = nobs ; > if var1 = node1 or var1 = node2 or var1 = node3 then > flag = 1 ; > end ; > if flag then output newlist ; > else > output other ; > run ; At full scale the loop runs one half billion times. That took about 9 minutes on my PC....

Re: How to filter sas data sets into separate sas data sets #5
Lizette: Can you show (1) your nested do loops that work for you, and (2) some sample data and the data sets that you desire to get? -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Lizette Koehler Sent: Monday, April 02, 2007 9:53 AM To: SAS-L@LISTSERV.UGA.EDU Subject: How to filter sas data sets into separate sas data sets Listers, This is my failing point in coding SAS. The use of 2 separate SAS data sets to create a third. I can do this in a program with nested Do loops. But with SAS it is just different enough I seem to be unable to see the coding technique. Problem: Sas Data set 1 contains 1 variable and 1000 obs. Sas Data set 2 contains 15 variables and 500000 obs. I need to filter off the data in Sas data set 2 based on Sas data set 1 Node1, Node2 and Node3 must match VAR1 exactly. I have all the code I need to do this except for splitting the data into a separate SAS data set (NEWLISTS). Psuedo code: Sas Data set 1: Var1 Length 7 Char Sas Data set 2: Node1 Length 1-8 Char Node2 Length 1-8 Char Node3 Length 1-8 Char Data Newlist (KEEP=node1 node2 node3 ... var15) Otherds (Keep=node1 node2 node3 .... var15) ; Set SASDS1 ; *Contains 1 var 1000 obs ; Set SASDS2 ; *Contains 15 vars and 500,000 obs ; If Node1 = VAR1 or Node2 = VAR1 or Node3 = Var1 then Output Newlist ; Else Output Otherds ; I have tried putting in two SET statements, but I seem to reduce the information dramatically. ...

Re: How to filter sas data sets into separate sas data sets #4
Something like this is the old way. You could use a proc sql if you have a new enough version. Increase your buffersize and if you have enough memory you may get it into a hash routine. DATA WORK.NEW; MERGE small (IN=A OBS=500) big ; BY ID_FIELD; IF A=1; RUN; QUIT; RICH -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@listserv.vt.edu] On Behalf Of Lizette Koehler Sent: Monday, April 02, 2007 10:53 AM To: SAS-L@LISTSERV.VT.EDU Subject: How to filter sas data sets into separate sas data sets Listers, This is my failing point in coding SAS. The use of 2 separate SAS data sets to create a third. I can do this in a program with nested Do loops. But with SAS it is just different enough I seem to be unable to see the coding technique. Problem: Sas Data set 1 contains 1 variable and 1000 obs. Sas Data set 2 contains 15 variables and 500000 obs. I need to filter off the data in Sas data set 2 based on Sas data set 1 Node1, Node2 and Node3 must match VAR1 exactly. I have all the code I need to do this except for splitting the data into a separate SAS data set (NEWLISTS). Psuedo code: Sas Data set 1: Var1 Length 7 Char Sas Data set 2: Node1 Length 1-8 Char Node2 Length 1-8 Char Node3 Length 1-8 Char Data Newlist (KEEP=node1 node2 node3 ... var15) Otherds (Keep=node1 node2 node3 .... var15) ; Set SASDS1 ; *Contains 1 var 1000 obs ; Set SASDS2 ; *Contains 15 vars and 500,000 obs ; If Node1 = VAR1 or No...

Re: How to filter sas data sets into separate sas data s ets
I think that both Ron's (as he mentioned) and Richard solutions require that VAR1 is in both datasets. But from the original post, it seemed to me that VAR1 is only in data set 1, and it must be matched to 1 of 3 variables in data set 2 (NODE1, NODE2 or NODE3) to be output to the NEWLIST data set. For this reason, I think a format is one possible approach. Maybe the original poster can clarify this point. Thanks. Jack Clark Research Analyst Center for Health Program Development and Management University of Maryland, Baltimore County -----Original Message----- From: SAS(r) Discussio...

Re: How to filter sas data sets into separate sas data sets #7
Summary: You need a loop and the POINT option or SQL #iw-value=1 Lizette, I think a lot of respondents have misunderstood the problem. This probably could have been avoided with a simplified example. Here is my interpretation. Here is code to generate data. data control ; do var1 = 1 to 4 ; output ; end ; run ; data tosplit ; input node1 node2 node3 other ; cards ; 1 2 3 4 1 2 3 5 7 7 7 7 ; Here is a way to split using the DATA step. data newlist other ; drop flag var1 ; set tosplit ; do pt = 1 to nobs ; set control point = pt nobs = nobs ; if var1 = node1 or var1 = node2 or var1 = node3 then flag = 1 ; end ; if flag then output newlist ; else output other ; run ; And here is a way to split using SQL. proc sql ; create table newlist as select * from tosplit where node1 in (select var1 from control) or node2 in (select var1 from control) or node2 in (select var1 from control) ; create table other as select * from tosplit where not(node1 in (select var1 from control) or node2 in (select var1 from control) or node2 in (select var1 from control)) ; quit ; Ian Whitlock ================ Date: Mon, 2 Apr 2007 10:53:08 -0400 Reply-To: starsoul@mindspring.com Sender: "SAS(r) Discussion" From: Lizette Koehler <starsoul@MINDSPRING.COM>...

Re: How to filter sas data sets into separate sas data sets #6
First off, you don't need two set statements, I suspect you want a merge. (remember to sort datasets before merging) Data newlist (KEEP=node1 node2 node3 ... var15) Otherds (Keep=node1 node2 node3 .... var15) ; Merge sasds1 sasds2; By ;/*not sure which variable you need, but there has to be something that is the same between the two*/ What I'd really need to know is what are the field names in DS1 and DS2 (You described them but didn't tell us the names) You will possibly need a REANME= statement to get a matching name to merge by. Either read up more on merges and RENAME or get back to us with the variable names, and some sample data (maybe a proc print with obs=20). HTH -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Lizette Koehler Sent: Monday, April 02, 2007 9:53 AM To: SAS-L@LISTSERV.UGA.EDU Subject: How to filter sas data sets into separate sas data sets Listers, This is my failing point in coding SAS. The use of 2 separate SAS data sets to create a third. I can do this in a program with nested Do loops. But with SAS it is just different enough I seem to be unable to see the coding technique. Problem: Sas Data set 1 contains 1 variable and 1000 obs. Sas Data set 2 contains 15 variables and 500000 obs. I need to filter off the data in Sas data set 2 based on Sas data set 1 Node1, Node2 and Node3 must match VAR1 exactly. I have all the code I need to do this except for splitting the...

Re: How to filter sas data sets into separate sas data sets #3
Lizette, Instead of trying to merge the two data sets, I would probably try to create a SAS format from the values of VAR1 in data set 1. Then, NODE1, NODE2 and NODE3 could be compared against the format for a match. The example below is a simplified version of what you could do and shows a printout of how it works. It has 5 observations in data set 1 and only 3 variables in data set 2, but I think the logic should hold for the example you gave. After the example is code that could be used to actually split the data as you had requested. Hope this helps. * create sas data set 1 ; data sasds1; input var1 $; cards; AAA BBB DDD FFF AAA HHH ; run; * sort data set 1 to eliminate any duplicate values ; proc sort nodupkey data = sasds1 out = sasds1_dd (rename=(var1=start)); by var1; run; * create data set that will be used to build SAS format ; data sasds1_dd; set sasds1_dd end=last; fmtname = '$NODES'; label = 'Y'; output; if last then do; hlo='O'; label='N'; output; end; run; * build format (the optional fmtlib option will print the format for you to review) ; proc format cntlin = sasds1_dd fmtlib; run; * create sas dataset 2 ; data sasds2; input node1 $ node2 $ node3 $; cards; ZZZ YYY XXX AAA YYY XXX ZZZ FFF XXX ZZZ YYY DDD AA YYY XXX ZZZ AAAA XXX ; run; * apply format to node1-node3 to determine if there is a match ; data testing; set sasds2; if put(node1,$nodes.) = 'Y' or put(node2,$nodes.) = '...

Re: How to filter sas data sets into separate sas data sets #2
you cannot do this as described without a common link here, your Var1 Note: both data sets must be sorted by Var1 Data Newlist (KEEP=node1 node2 node3 ... var15) Otherds (Keep=node1 node2 node3 .... var15) ; do until(EndoFile); Set SASDS1 SASDS2 end = EndoFile; by Var1; *consider: if Var1 in (Node1 Node2 Node3); If Node1 = VAR1 or Node2 = VAR1 or Node3 = Var1 then Output Newlist ; Else Output Otherds ; end; stop; Undoubtedly the HashHeads will propose a lookup table but the above is what you are trying to do. Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov > From: starsoul@mindspring.com > Listers, > > This is my failing point in coding SAS. The use of 2 > separate SAS data sets to create a third. > > I can do this in a program with nested Do loops. But with > SAS it is just different enough I seem to be unable to see > the coding technique. > > Problem: > > Sas Data set 1 contains 1 variable and 1000 obs. > Sas Data set 2 contains 15 variables and 500000 obs. > > I need to filter off the data in Sas data set 2 based on Sas > data set 1 > > Node1, Node2 and Node3 must match VAR1 exactly. I have all > the code I need to do this except for splitting the data into > a separate SAS data set (NEWLISTS). > > > Psuedo code: > > Sas Data set 1: Var1 Length 7 Char > Sas Data set 2: Node1 Length 1-8 Char Node2 Length 1-8 > Char Node3 Length 1...

Re: Deleting SAS Data from a SAS DATASET
One thing you might do is to add an index on the snap_dt to the dataset; = if that's there then you should be able to delete the records in place: proc sql; delete from prod.master_date; where snap_dt =3D "&end_dt"d; quit; run; In both the ways you are trying now you are creating new data sets = rather than deleting records from the current data set; it would seem to = me that a SQL delete statement would be faster than creating new = datasets even if there isn't an index on the date.=20 -Mary ----- Original Message -----=20 From: SUBSCRIBE SAS-L Chandra Gadde=20 To: SAS-L@LISTSERV.UGA.EDU=20 Sent: Friday, August 15, 2008 12:14 PM Subject: Deleting SAS Data from a SAS DATASET Hi All I have several SAS datasets that are very very big. (50GB of size). = Every month, the data is being appended to these datasets. I need to deleted = the data which is greater than 24 months. What is the best method to do = this? Please help me. I tried PROC SQS and DATA STEP. But these two are taking very long = time. Data prod.Master_data; set prod.master_date; if snap_dt =3D "&end_dt"d then delete; run; proc sql; crete table prod.master_date from prod.master_date where snap_dt ne "&end_dt"d; quit; Hi You've got good ideas how to delete the old observations. My modify proposal was wrong. Sorry about that! I still think that changing the data model would be a good idea. Regards Patrick ...

Re: Help- How to change transaction data to individual level data in SAS
Here's more info on this very interest request... ________________________________ Bruce A. Johnson bjohnson@solucient.com -----Original Message----- From: Tulikaa Khunnah [mailto:tulikaa@yahoo.com] Sent: Tuesday, May 11, 2004 3:39 PM To: Bruce Johnson Subject: Help- How to change transaction data to individual level data in SAS Dear Bruce, I have web visit data for individuals with the duration, date, pages viewed, etc. I wanted to create one record per individual to run a logit first and then a dynamic program. I need to create a lot of lagged variables (last web portal visited -...

Help on data creation for SAS
Dear Sir, I have data set that i am preparing for use in NONMEM. I used an existing macro in SAS to create the data file, but i am able to read only the first row which is the data at time zero (a sample of the data set shown below) none of the other observations are recorded onto my output file... Can you please help me DATA A; SET B; BY ID; IF FIRST.ID THEN DO; EVID = 1; MDV = 1; DV= 0; CMT = 1; AMT = DOSE; OUTPUT; AMT= .; EVID = 0; DV = CONC; CMT = 2; END; ELSE DO; AMT = .; EVID ...

Re: Deleting SAS Data from a SAS DATASET #8
On 8/15/08, Mary <mlhoward@avalon.net> wrote: > A view helps on deletes, but I wonder how it affects performance of querying the data- wouldn't storing the data in 24 different locations cause a significant slowdown in perfomance upon querying the data versus having it all in one table that is indexed? If this data is queryied a lot but only deleted once a month, the time in querying (which probably is in peak time) could be much more important than the time in deleting (which could be run when the computer is not busy, such as nights or weekends). It is not the VIEW that has an influence on deleting the old data. I would think that having the 24 indexed data sets might be about as good as having the giant data set. I would think the indexes could be used while accessing the data through views. Where's that guy that says he knows everything about using indexed data sets? I would agree that much depends on how the data is used. And I don't know the answers to those questions. > > -Mary > ----- Original Message ----- > From: ./ ADD NAME=Data _null_, > To: SAS-L@LISTSERV.UGA.EDU > Sent: Friday, August 15, 2008 3:51 PM > Subject: Re: Deleting SAS Data from a SAS DATASET > > > Summary: PROC DATASETS; AGE statement. + VIEWs > > This won't help you delete data from your very big data set, but you > may find this example interesting. > > You say you append data monthly to a big data set then when b...

Re: Deleting SAS Data from a SAS DATASET #7
A view helps on deletes, but I wonder how it affects performance of = querying the data- wouldn't storing the data in 24 different locations = cause a significant slowdown in perfomance upon querying the data versus = having it all in one table that is indexed? If this data is queryied a = lot but only deleted once a month, the time in querying (which probably = is in peak time) could be much more important than the time in deleting = (which could be run when the computer is not busy, such as nights or = weekends). =20 -Mary ----- Original Message -----=20 From: ./ ADD NAME=3DData _null_,=20 To: SAS-L@LISTSERV.UGA.EDU=20 Sent: Friday, August 15, 2008 3:51 PM Subject: Re: Deleting SAS Data from a SAS DATASET Summary: PROC DATASETS; AGE statement. + VIEWs This won't help you delete data from your very big data set, but you may find this example interesting. You say you append data monthly to a big data set then when big gets too big you need to clean out the old. And that takes a very long time. However if you don't physically append but use a view to append/combine you may find it easier to get rid of the unwanted old data. Consider this code. it pushes MonthlyUpdate onto the stack of 24 data sets and the 24th data set is deleted. Then all the data sets get renamed to produce a new group of 24. You can see from the notes how the operation works. The data sets don't have to use a numbered range M01-M24 I did that...

Re: Deleting SAS Data from a SAS DATASET #3
The disadvantages of using SQL delete are (1) NOBS= is no longer accurate, and (2) POINT= may behave unexpectedly. If those are not issues, then the delete would be faster, with or without an index, than recreating the data set (especially if the data set has indexes that would need to be rebuilt). -- Jack Hamilton jfh@alumni.stanford.org On Aug 15, 2008, at 11:17 am, Mary wrote: > One thing you might do is to add an index on the snap_dt to the > dataset; if that's there then you should be able to delete the > records in place: > > proc sql; > delete from prod.master_date; > where snap_dt = "&end_dt"d; > quit; > run; > > In both the ways you are trying now you are creating new data sets > rather than deleting records from the current data set; it would > seem to me that a SQL delete statement would be faster than creating > new datasets even if there isn't an index on the date. > > -Mary > ----- Original Message ----- > From: SUBSCRIBE SAS-L Chandra Gadde > To: SAS-L@LISTSERV.UGA.EDU > Sent: Friday, August 15, 2008 12:14 PM > Subject: Deleting SAS Data from a SAS DATASET > > > Hi All > > I have several SAS datasets that are very very big. (50GB of size). > Every > month, the data is being appended to these datasets. I need to > deleted the > data which is greater than 24 months. What is the best method to do > this? > Please help me. > ...

Re: Deleting SAS Data from a SAS DATASET #9
On Fri, 15 Aug 2008 16:09:46 -0500, Mary <mlhoward@AVALON.NET> wrote: >A view helps on deletes, but I wonder how it affects performance of querying the data- wouldn't storing the data in 24 different locations cause a significant slowdown in perfomance upon querying the data versus having it all in one table that is indexed? If this data is queryied a lot but only deleted once a month, the time in querying (which probably is in peak time) could be much more important than the time in deleting (which could be run when the computer is not busy, such as nights or weekends). hi, good point! but as shown below, you can make a view of multiple datasets having the separate indexes, and where seems to be fine with this. interesting. ran on sas 9.1.3 sp4 on windows. cheers, chang /* test datasets */ data one two; set sashelp.class; ds = "one"; output one; ds = "two"; output two; run; /* separately index on age */ proc datasets lib=work; modify one; index delete age; index create age; modify two; index delete age; index create age; quit; /* make a view of two datasets appended */ proc sql feedback; drop view work.oneTwo; create view oneTwo as select * from one union select * from two order by age; quit; /* where is utilizing the indexes */ options msglevel=i; data sixteenAndOlder; set oneTwo; /* we are using the view */ where age >= 16; run; /* on log INFO: Index Age selected for WHERE clause optimiz...

Re: Deleting SAS Data from a SAS DATASET #12
--On 8/15/08 6:03 PM -0400 Chang Chung wrote: > good point! but as shown below, you can make a view of multiple datasets > having the separate indexes, and where seems to be fine with this. > interesting. ran on sas 9.1.3 sp4 on windows. > /* make a view of two datasets appended */ > proc sql feedback; > drop view work.oneTwo; > create view oneTwo as > select * from one union select * from two > order by age; > quit; One thought on this--at least in my general approach to using views--is you probably want to avoid the ORDER BY statement--especially if it's the variable you're indexing on and you want to use a subset. For any amount of data above a trivial one, there's no sense in forcing the view to re-order th e data if it doesn't have to. Dave ...

Re: Deleting SAS Data from a SAS DATASET #11
And what about the time of the database administrator who now needs to = keep track of 24 indexes to each index in the previous table? I just = can't see our DB2 administrators would have ever thought to organize the = data this way, though we had many very large tables, like the user had, = that were purged by month; it does seem like it would be a lot of = "people work" to manage 24 tables plus one index instead of just one = table, even if querying didn't suffer(and I do think that it could).=20 -Mary ----- Original Message -----=20 From: Chang Chung=20 To: SAS-L@LISTSERV.UGA.EDU=20 Sent: Friday, August 15, 2008 5:03 PM Subject: Re: Deleting SAS Data from a SAS DATASET hi, good point! but as shown below, you can make a view of multiple = datasets having the separate indexes, and where seems to be fine with this. interesting. ran on sas 9.1.3 sp4 on windows. cheers, chang /* test datasets */ data one two; set sashelp.class; ds =3D "one"; output one; ds =3D "two"; output two; run; /* separately index on age */ proc datasets lib=3Dwork; modify one; index delete age; index create age; modify two; index delete age; index create age; quit; /* make a view of two datasets appended */ proc sql feedback; drop view work.oneTwo; create view oneTwo as select * from one union select * from two order by age; quit; /* where is utili...

Web resources about - Re: Help on data creation for SAS - comp.soft-sys.sas

Institute for Creation Research - Wikipedia, the free encyclopedia
The Institute for Creation Research (ICR) is a Christian apologetics institute in Dallas , Texas that specializes in education, research, and ...

Huge demand for Bakery on O’Connell creation cronut cone - AdelaideNow Search Search
... cone. ADELAIDE is going nuts over a new food sensation known as the cronut cone. North Adelaide’s Bakery on O’Connell is home to the creation ...

AMD Announces Radeon Pro Duo: Dual GPU Fiji Video Card For VR Content Creation
... name Radeon Pro Duo, the new card is a departure from the usual for AMD, with the company specifically targeting it towards VR content creation ...

Manage your audio creations with SoundCloud Pulse
... Skype Qik will head into the sunset late next month . Image credit: SoundCloud Blog SoundCloud Pulse: for creators Manage your audio creations ...

Creation of mini-organs follows mini-brains; teeny Frankensteins unlikely
Wee livers and heart tissue act like the real thing, may help test new meds.

"When judges are not interpreting, they’re creating, and to understand judicial creation one must understand ...
Writes Judge Richard A. Posner in a WaPo column titled "The Supreme Court is a political court. Republicans’ actions are proof." Priors are ...

What recession? Job creation jumps in February
Despite the strong headline number, the closely watched average hourly wages actually declined for the month.

Adobe rolls out new enterprise app creation service
Adobe has merged two of its app development services into one, in an attempt to help businesses easily build professional-looking apps, without ...

Check out the creation of the Steve Wozniak wax sculpture
Apple co-founder Steve Wozniak is well on his way to becoming a life-sized action figure. Not really, but we’re nerds, and that’s how we prefer ...

FilmBuff Acquires ‘Thank You For Playing’ Docu About Creation Of ‘That Dragon, Cancer’ Video Game
FilmBuff has licensed worldwide rights to distribute Thank You For Playing , the Tribeca Film Festival documentary from David Osit and Malika ...

Resources last updated: 3/18/2016 5:24:25 AM