f



Re: Create SAS file from raw data

Julie:

Try this:

data Temp;
  input A $ 1-5;
  input Test $ 1 @@;
  do while (Test eq ' ');
    input B C:$2. D:$8. E:$5. F G H / I J:$3. K:$3. L:$3.;
    output;
    input Test $ 1 @@;
  end;
cards;

HTH
J S Huang

>>> "Li,Qian [Ontario]" <Qian.Li@EC.GC.CA> 12/8/2005 12:12:14 PM >>>
Hi all,

I have to create a SAS file from a raw data formatted as following:

60101
     9.44240 O3   P  CNSAPR02     12002    1    1 20020501.00000000
20020501.01000000 001 001 001
     2.72953 O3   P  CNSAPR02     12002    2    2 20020501.00000000
20020501.02000000 001 001 001
     2.37352 O3   P  CNSAPR02     12002    3    3 20020501.00000000
20020501.03000000 001 001 001
     1.86168 O3   P  CNSAPR02     12002    4    4 20020501.00000000
20020501.04000000 001 001 001
     1.25260 O3   P  CNSAPR02     12002    5    5 20020501.00000000
20020501.05000000 001 001 001
     0.70932 O3   P  CNSAPR02     12002    6    6 20020501.00000000
20020501.06000000 001 001 001
     0.57959 O3   P  CNSAPR02     12002    7    7 20020501.00000000
20020501.07000000 001 001 001
     0.88178 O3   P  CNSAPR02     12002    8    8 20020501.00000000
20020501.08000000 001 001 001
     1.37837 O3   P  CNSAPR02     12002    9    9 20020501.00000000
20020501.09000000 001 001 001
     1.71653 O3   P  CNSAPR02     12002   10   10 20020501.00000000
20020501.10000000 001 001 001
     0.85449 O3   P  CNSAPR02     12002   11   11 20020501.00000000
20020501.11000000 001 001 001
     1.17837 O3   P  CNSAPR02     12002   12   12 20020501.00000000
20020501.12000000 001 001 001
     7.54995 O3   P  CNSAPR02     12002   13   13 20020501.00000000
20020501.13000000 001 001 001
    17.59682 O3   P  CNSAPR02     12002   14   14 20020501.00000000
20020501.14000000 001 001 001
    22.61692 O3   P  CNSAPR02     12002   15   15 20020501.00000000
20020501.15000000 001 001 001
    25.54689 O3   P  CNSAPR02     12002   16   16 20020501.00000000
20020501.16000000 001 001 001
    25.11730 O3   P  CNSAPR02     12002   17   17 20020501.00000000
20020501.17000000 001 001 001
    23.59137 O3   P  CNSAPR02     12002   18   18 20020501.00000000
20020501.18000000 001 001 001
    22.56029 O3   P  CNSAPR02     12002   19   19 20020501.00000000
20020501.19000000 001 001 001
    21.32302 O3   P  CNSAPR02     12002   20   20 20020501.00000000
20020501.20000000 001 001 001
    21.00521 O3   P  CNSAPR02     12002   21   21 20020501.00000000
20020501.21000000 001 001 001
    21.10764 O3   P  CNSAPR02     12002   22   22 20020501.00000000
20020501.22000000 001 001 001
    18.10735 O3   P  CNSAPR02     12002   23   23 20020501.00000000
20020501.23000000 001 001 001
     9.33048 O3   P  CNSAPR02     12002   24   24 20020501.00000000
20020502.00000000 001 001 001
60104
     8.16078 O3   P  CNSAPR02     12002    1    1 20020501.00000000
20020501.01000000 001 001 001
     1.30862 O3   P  CNSAPR02     12002    2    2 20020501.00000000
20020501.02000000 001 001 001
     1.15719 O3   P  CNSAPR02     12002    3    3 20020501.00000000
20020501.03000000 001 001 001
     0.72941 O3   P  CNSAPR02     12002    4    4 20020501.00000000
20020501.04000000 001 001 001
     0.28360 O3   P  CNSAPR02     12002    5    5 20020501.00000000
20020501.05000000 001 001 001
    -0.02694 O3   P  CNSAPR02     12002    6    6 20020501.00000000
20020501.06000000 001 001 001
    -0.09367 O3   P  CNSAPR02     12002    7    7 20020501.00000000
20020501.07000000 001 001 001
     0.08212 O3   P  CNSAPR02     12002    8    8 20020501.00000000
20020501.08000000 001 001 001
     0.38631 O3   P  CNSAPR02     12002    9    9 20020501.00000000
20020501.09000000 001 001 001
     0.65235 O3   P  CNSAPR02     12002   10   10 20020501.00000000
20020501.10000000 001 001 001
     0.53187 O3   P  CNSAPR02     12002   11   11 20020501.00000000
20020501.11000000 001 001 001
     1.01275 O3   P  CNSAPR02     12002   12   12 20020501.00000000
20020501.12000000 001 001 001
     7.00913 O3   P  CNSAPR02     12002   13   13 20020501.00000000
20020501.13000000 001 001 001
    17.31079 O3   P  CNSAPR02     12002   14   14 20020501.00000000
20020501.14000000 001 001 001
    22.43160 O3   P  CNSAPR02     12002   15   15 20020501.00000000
20020501.15000000 001 001 001
    25.56678 O3   P  CNSAPR02     12002   16   16 20020501.00000000
20020501.16000000 001 001 001
    25.35555 O3   P  CNSAPR02     12002   17   17 20020501.00000000
20020501.17000000 001 001 001
    23.76221 O3   P  CNSAPR02     12002   18   18 20020501.00000000
20020501.18000000 001 001 001
    22.60013 O3   P  CNSAPR02     12002   19   19 20020501.00000000
20020501.19000000 001 001 001
    21.09888 O3   P  CNSAPR02     12002   20   20 20020501.00000000
20020501.20000000 001 001 001
    20.57557 O3   P  CNSAPR02     12002   21   21 20020501.00000000
20020501.21000000 001 001 001
    20.65545 O3   P  CNSAPR02     12002   22   22 20020501.00000000
20020501.22000000 001 001 001
    17.57322 O3   P  CNSAPR02     12002   23   23 20020501.00000000
20020501.23000000 001 001 001
     8.58713 O3   P  CNSAPR02     12002   24   24 20020501.00000000
20020502.00000000 001 001 001
60105
..
..
..

I would like the SAS data file showing like this:

60101   9.44240 O3   P  CNSAPR02     12002    1    1 20020501.00000000
20020501.01000000 001 001 001
60101   2.72953 O3   P  CNSAPR02     12002    2    2 20020501.00000000
20020501.02000000 001 001 001
60101   2.37352 O3   P  CNSAPR02     12002    3    3 20020501.00000000
20020501.03000000 001 001 001
60101   1.86168 O3   P  CNSAPR02     12002    4    4 20020501.00000000
20020501.04000000 001 001 001
60101   1.25260 O3   P  CNSAPR02     12002    5    5 20020501.00000000
20020501.05000000 001 001 001
..
..
..
60104   8.16078 O3   P  CNSAPR02     12002    1    1 20020501.00000000
20020501.01000000 001 001 001
60104   1.30862 O3   P  CNSAPR02     12002    2    2 20020501.00000000
20020501.02000000 001 001 001
60104   1.15719 O3   P  CNSAPR02     12002    3    3 20020501.00000000
20020501.03000000 001 001 001
60104   0.72941 O3   P  CNSAPR02     12002    4    4 20020501.00000000
20020501.04000000 001 001 001
60104   0.28360 O3   P  CNSAPR02     12002    5    5 20020501.00000000
20020501.05000000 001 001 001
60104  -0.02694 O3   P  CNSAPR02     12002    6    6 20020501.00000000
20020501.06000000 001 001 001
..
..
..


I have tried to use the hold symbols (@,@@) but seems not working.
Could
anyone give me a hand on this?

Many thanks.

Julie
0
12/8/2005 6:47:19 PM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

0 Replies
452 Views

Similar Articles

[PageSpeed] 53

Reply:

Similar Artilces:

Re: Is there a system option for OpenVMS SAS version 8 where a sas program can create an output file with a file attribute of "Stream_LF" so that these external files c
Charles Patridge <charles_s_patridge@PRODIGY.NET> wrote: > Is there a system option for OpenVMS SAS version 8 where a sas program can > create an output file with a file attribute of "Stream_LF" so that these > external files can be served through an Apache WebServer properly? > > Currently, what happens is when we create a CSV file, the Apache Webserver > wants to load the contents of this CSV file into a single cell for Excel. > That is, all OBS are treated as a SINGLE record and all the contents is > loaded into a single cell within Excel. > > T...

Re: running a sas file within a sas file
Like Joep wrote: that seems to be the right thing for the macro facility. With %include you are very static. With the macro facility that could be very dynamic. The simplest thing is: you could provide the statements you want to insert as parameter: %macro doit(stmt1=,stmt2=); ..... &stmt1 ..... &stmt2 ..... %mend; %doit(stmt1=%str(y=sqrt(y);), stmt2=%str(if y<2 then y=2;) ); with many other things you can do, e.g. conditional creating of statements, naming variables by parameters, create multiple statements with macro loops and much more. On the other hand: if you want to do such simple things like you wrote, avoid any %INC or %MACRO things! It is far more readable, if you don't use %INCLUDES. What do you think, that data-step will do: data a; %inc(inc1); %inc(inc2); %inc(inc3); run; ??? instead of: data a; set sashelp.class; if age>11 then age=11; keep name age; run; Gerhard On Mon, 9 Jun 2008 01:42:03 -0700, Joep Steeman <jsteeman@BUSINESSDECISION.COM> wrote: >On 9 jun, 09:20, zpe...@NATURE.BERKELEY.EDU (Zach Peery) wrote: >> Sorry to bug you all with such an easy one, but I havent had much luck >> with the usual help sources. >> >> I just want to run a sas program file within a sas program file. For >> example, in sas file 1 I want to set x equal to 2, then with file 2 >> invoked by file 1, I want to set y = 3. >> >> So sas file 1 looks like this... >> &g...

Re: Exporting a SAS data set to Text file on SAS unix #3
hi ... actually, what I posted earlier was too much code (sorry) this is enough (a bit more succinct) * variable names into a macro variable (tab separated); proc sql noprint; select name into :vars separated by '09'x from dictionary.columns where libname eq 'SASHELP' and memname eq 'CLASS' order varnum; quit; data _null_; file 'z:\class.txt' dsd dlm='09'x ; if _n_ eq 1 then put "&vars"; set sashelp.class; put (_all_) (:); run; -- Mike Zdeb U@Albany School of Public Health One University Place Rensselaer, New York 12144-3456 P/518-402...

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: Executing separate SAS File from Main SAS File
See %include -----Original Message----- From: owner-sas-l@listserv.uga.edu [mailto:owner-sas-l@listserv.uga.edu]On Behalf Of tobyrathgeb@stanford.edu Sent: Tuesday, August 02, 2005 2:42 PM To: sas-l@uga.edu Subject: Executing separate SAS File from Main SAS File Hi All I was wondering if I can initiate execution of SAS code stored in a SAS file from my main SAS code. Help very much appreciated. Thanks Toby __________________________________________________________________________________________________________________________________ This e-mail may be privileged and/or confidential, and the sender does not waive any related rights and obligations. Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized. If you received this e-mail in error, please advise me (by return e-mail or otherwise) immediately. Ce courrier �lectronique est confidentiel et prot�g�. L'exp�diteur ne renonce pas aux droits et obligations qui s'y rapportent. Toute diffusion, utilisation ou copie de ce message ou des renseignements qu'il contient par une personne autre que le (les) destinataire(s) d�sign�(s) est interdite. Si vous recevez ce courrier �lectronique par erreur, veuillez m'en aviser imm�diatement, par retour de courrier �lectronique ou par un autre moyen. ...

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 #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: 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 #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 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 #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 #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 #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: sas data file --> excel file
I wrote a paper on doing this using Visual Studio Express for C# and reading the SAS dataset using OleDb. You can find the paper with step-by-step instructions here: http://www.savian.net/Utilities.aspx Several people have followed the steps with no issues. 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 Mindy Sent: Tuesday, November 15, 2005 4:27 PM To: SAS-L@LISTSERV.UGA.EDU Subject: sas data file --> excel file Does any one know an easy way of transfer sas data file to excel file except EXPORT? we have DBMS engine, which is really easy to read excel file to SAS, but I don't know if that engine is helpful to export SAS data file to excel file. Any comments are welcome. Thanks. Mindy ...

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 ...

Is there a system option for OpenVMS SAS version 8 where a sas program can create an output file with a file attribute of "Stream_LF" so that these external files can b
To SAS-Lers (specifically OpenVMS Users), Is there a system option for OpenVMS SAS version 8 where a sas program can create an output file with a file attribute of "Stream_LF" so that these external files can be served through an Apache WebServer properly? Currently, what happens is when we create a CSV file, the Apache Webserver wants to load the contents of this CSV file into a single cell for Excel. That is, all OBS are treated as a SINGLE record and all the contents is loaded into a single cell within Excel. To fix this problem, we are able to use an "Convert/FDL" th...

Re: Create SAS dataset from C# data table or data set
Mike, Read my paper on how to create your first .net app on sascommunity.org for how to read a SAS dataset. There are a lot of nuances though. Watch out for formats. Yes, you can stream the graph. Have SAS gen it then read it as binary. Alan 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 Mike Durbin Sent: Thursday, May 31, 2007 1:59 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Create SAS dataset from C# data table or data set SAS-L, We are evaluating SAS/Integration Technologies and have what we think should be straight forward question. How can I have .Net create or update a SAS dataset on our backend SAS AIX server? Also, if the backend SAS server creates a graph can I stream it to the C# client server application? Thanks in advance for all your advice, Mike Durbin Hi, I try to integrate C#.Net with SAS using COM. I used the FlustList() function to get output from SAS. Is there option to capture SAS output variables into dotnet Dataset?? Thanks in advance. Regards., Sabari.V ...

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...

Re: converting sas transport files into sas datasets
Once you have assigned an xport libname you can read it in like a normal dataset. libname out xport 'C:\Documents and Settings\kdt\Desktop\class.xpt'; *- Create xport file; data out.class; set sashelp.class; run; *- Create work file from xport file; data work.class; set out.class; run; 2008/12/17 <pramila.sami@gmail.com>: > Hello All, > > Could anyone please give me the code for converting sas transport > files into sas datasets. thanks in advance. > ...

Re: Opening non SAS files with BASE SAS ?
SYSTASK may be what you want. SYSTASK COMMAND "operating system-command" <WAIT | NOWAIT> <TASKNAME=taskname> <MNAME=name-var> <STATUS=stat-var> <SHELL<="shell-command">>; On 10/10/07, anderson115@gmail.com <anderson115@gmail.com> wrote: > Is there a function that executes a non SAS file? > > I've written a macro that outputs a file with the extention SQL (EXE > would also be helpful). > > *.SQL files are associated with SQL server on my computer so I'd like > to make SAS execute this file so it triggers the SQL server program. > > Is this possible? > > Thank You, > Aaron > ...

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 #15
Summary: Suggestions for maintaining large data set #iw-value=1 Chandra, You are essentially making a copy of a 50GB file every month. Of course, it takes long. Consequently you either have to copy the data more efficiently or modify how the data is stored and/or used. Have you looked at system options to make this as efficient as possible? Big buffers, many buffers. Different disk handlers for input and output would also speed up the process since it is mainly IO bound. (These topics have been discussed on SAS-L, in papers, and documentation. I have not found the techniques necessary, but then I have not worked with 50 GB data sets.) You are adding about 2 gig per month. That is 4% increase. Perhaps accepting the increase one month and then modifying the second month would make more sense, if the data is accessed infrequently. To do this you need to control all programs that read the data set. It might pay to combine the previous suggestion with the MODIFY command. I suspect that SAS can skip over deleted records pretty quickly. It might pay to store the data by month and each month create a new view data prod.master / view = prod.master ; set prod.mon_x ... prod.mon_y ; run ; The process could even be automated with something like %macro prod_list ( end_dt = 1jul2008 ) ; %local i mon ; %do i = -11 %to 0 ; %let mon = %sysfunc(intnx(month,"&end_dt"d,&i)) ; %let mon = %sysfunc(putn(...

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 ...

Web resources about - Re: Create SAS file from raw data - comp.soft-sys.sas

iRobot Create - Wikipedia, the free encyclopedia
iRobot Create is a hobbyist robot manufactured by iRobot that is based on the Roomba platform and was introduced in 2007. However, iRobot Create ...

The Knot Creates Facebook Page To Help Hurricane Sandy Victims Salvage Their Weddings
The damage in the wake of Hurricane Sandy included some 2,300 weddings that had to be postponed or rescheduled, according to wedding portal The ...

World's elite wisdom may no longer matter as new winners create losers
Millions are more likely to see an influx from Europe as a source of competition, for jobs, for houses, for everything.

World's elite wisdom may no longer matter as new winners create losers
Millions are more likely to see an influx from Europe as a source of competition, for jobs, for houses, for everything.

World's elite wisdom may no longer matter as new winners create losers
Millions are more likely to see an influx from Europe as a source of competition, for jobs, for houses, for everything.

ARM and TSMC team up to create a 7nm chip
... version of a fist-bump of solidarity, ARM and TSMC have agreed to join forces to develop a 7nm chip. It won’t be the world’s first - IBM created ...

Recharge Wrap-up: Tesla communications VP leaves, UK to create "net-zero emissions" law
Filed under: Government/Legal , Green , Hirings/Firings/Layoffs , Misc. Automakers , Tesla , Emissions , Green Automakers , Electric Ricardo ...

Create and search file lists with File List Maker
... programming, but it also means you can run it from a USB key on any PC where you’ve files to be searched. The core idea is that you create ...

Scientists create ‘invisibility cloak’ that can make microscopic objects disappear
Do we really need invisibility cloaks like the one Harry Potter uses at Hogwarts to move around undetected? Apparently, we do. At least two projects ...

18 Ideas That Will Help Create Your Dream Bedroom
... Prints on Accent Pieces: A very common misconception amongst women is that prints are only best for bedcovers. The fact is that you can create ...

Resources last updated: 3/18/2016 4:29:25 PM