f



Re: help reading data

The following will read the two strings of data.  You would, of course,
might want to use the same method, but specifically input the variables
you are interested in.

data want;
  infile cards scanover;
  input @"[TSW]" tswstring $20.
        @"[SIV]" sivstring $51.;
  cards;
[TSW] 10D001048014D0050005
[SIV] 1158357600 16-09-06 00:00 j 60 60 180 115 0 0 BLK G

[TSW] 10D001048014D0050009
[SIV] 1158357600 16-09-06 00:00 j 60 60 540 94 0 0 BLK G

[TSW] 10D00104844D60200007
[SIV] 1158357600 16-09-06 00:00 j 60 60 300 101 0 0 BLK G
;
run;

HTH,
Art
----------
On Fri, 30 Mar 2007 17:11:35 -0700, pande <apan14@GMAIL.COM> wrote:

>I have some data in this format in a text file and it is a large file.
>Each observation is split in two rows what would be the best way to
>read such data so that i have each observations as one row in sas.
>
>[TSW] 10D001048014D0050005
>[SIV] 1158357600 16-09-06 00:00 j 60 60 180 115 0 0 BLK G
>
>[TSW] 10D001048014D0050009
>[SIV] 1158357600 16-09-06 00:00 j 60 60 540 94 0 0 BLK G
>
>[TSW] 10D00104844D60200007
>[SIV] 1158357600 16-09-06 00:00 j 60 60 300 101 0 0 BLK G
>
>thanks
>regards
>Anurag
0
art297 (4213)
3/31/2007 12:31:19 AM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

0 Replies
343 Views

Similar Articles

[PageSpeed] 3

Reply:

Similar Artilces:

Re: help with reading ASCII data into SAS
Secret... here a start try data a; informat dd dtc dtm anydtdtm17. ; infile cards dlm=',' dsd firstobs=2; input site id pid it $ dd itd rtd linkid sp fc dtc dtm u $5. ; cards; "Site","ID","PID","IT","DD","ITD","RTD","LinkID","SP","FC","DTC","DTM","U" 1,1,100,"DA",1/1/2008 0:00:00,1,1,1,1,10,1/1/2008 13:10:20,1/1/2008 13:10:20,"obd" ; run; proc print data=a; format dd dtc dtm datetime17.; run; but the limits are the length of the variables and those types as i have only one line of data and no other specification HTH Andre olivesecret@GMAIL.COM a �crit : > I will appreciate for any suggestions. The data is a txt file. The > first two observations of the data is: > > "=Site","ID","PID","IT","DD","ITD","RTD","Lin=kID","SP","FC","DTC","DTM","U" > 1,1,100,"DA",1/1/2008 0:00:00,1,1,1,1,10,1/1/2008 13:10:20,1/1/2008 > =13:10:20,"obd" > > Thanks a lot! > > -- Andr� WIELKI INED (Institut National d'Etudes D�mographiques) Service Informatique 133 Boulevard Davout 75980 Paris Cedex 20 m�l : wielki@ined.fr t�l : 33 (0) 1 56 06 21 54 ...

Re: help with reading ASCII data into SAS #2
> -----Original Message----- > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On > Behalf Of olivesecret@GMAIL.COM > Sent: Wednesday, November 05, 2008 8:50 AM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Re: help with reading ASCII data into SAS > > Yes, I did it with delimiter=',' dsd firstobs=2, but was told invalid > data for each variable. > Any more suggestions? Thanks a lot! > > You will need to show us the actual code you are using to read the file if you want more than just a guess as to what went wrong. Seeing the log file with actual error message would be helpful as well. Dan Daniel J. Nordlund Washington State Department of Social and Health Services Planning, Performance, and Accountability Research and Data Analysis Division Olympia, WA 98504-5204 Here is my code: data data; infile 'data.txt' delimiter=',' dsd firstobs=2; input site id pid it $ dd itd rtd linkid sp fc dtc dtm u $5. ; run; Here is one more obs: 1,4,1004,"JS",9/27/2008 0:00:00,1,1,57,11,10,10/3/2008 11:31:17,10/3/2008= 11:31:17,"AVRC\psuggett" Other obs are similar. Thank you very much! On Nov 5, 12:24 pm, Nord...@DSHS.WA.GOV ("Nordlund, Dan (DSHS/RDA)") wrote: > > -----Original Message----- > > From: SAS(r) Discussion [mailto:SA...@LISTSERV.UGA.EDU] On > > Behalf Of olivesec...@GMAIL.COM > > Sent: Wednesday, November 05, 2008 8:50 AM > > To: SA...@...

Re: help with reading ASCII data into SAS #5
Olive, Try: data a; infile "data.txt" dlm=',' dsd firstobs=2 lrecl=200; input site id pid it $ dd itd rtd linkid sp fc dtc dtm u $; informat dd dtc dtm anydtdtm19. ; format dd dtc dtm datetime21.; informat u $10.; format u $10.; run; HTH, Art -------- On Wed, 5 Nov 2008 11:36:20 -0800, olivesecret@GMAIL.COM wrote: >I tried Andre's code, that is, do not import data from the hard disc >by infile statement, but copy all the data directly to sas using >datalines. You know what? Now it works. So it means there is something >wrong when I use infile statement to import data from the hard disc. >Any suggestions? >Thanks a lot! > > > >On Nov 5, 1:57 pm, bigD <diaphanos...@gmail.com> wrote: >> Andre's code works for the example you gave .... >> >> On Nov 5, 1:20 pm, olivesec...@gmail.com wrote: >> >> > Here is my code: >> >> > data data; >> > infile 'data.txt' delimiter=',' dsd firstobs=2; >> > input site id pid it $ dd itd rtd linkid sp fc dtc dtm u $5. ; >> > run; >> >> > Here is one more obs: >> >> > 1,4,1004,"JS",9/27/2008 0:00:00,1,1,57,11,10,10/3/2008 >> > 11:31:17,10/3/2008= 11:31:17,"AVRC\psuggett" >> >> > Other obs are similar. >> >> > Thank you very much! >> >> > On Nov 5, 12:24 pm, Nord...@DSHS....

Re: help with reading ASCII data into SAS #4
its not much information about your problem. Did you try it with something like: data a; infile "c:\daten\test.dat" dlm="," truncover; if _n_=1 then do input; delete; end; else input site : 8. id : 8. pid : 8. it : $5. dd : ANYDTDTM20. itd : 8. rtd : 8. linkid : 8. sp : 8. fc : 8. dtc : ANYDTDTM20. dtm : ANYDTDTM20. u : $5. ; u = compress(u,'""'); it = compress(it,'""'); format dtm dtc dd datetime20.; run; That seems to work for your example. Gerhard On Wed, 5 Nov 2008 07:45:07 -0800, olivesecret@GMAIL.COM wrote: >I will appreciate for any suggestions. The data is a txt file. The >first two observations of the data is: > >"=Site","ID","PID","IT","DD","ITD","RTD","Lin=kID","SP","FC","DTC","DTM"," U" >1,1,100,"DA",1/1/2008 0:00:00,1,1,1,1,10,1/1/2008 13:10:20,1/1/2008 >=13:10:20,"obd" > >Thanks a lot! ...

Re: help with reading ASCII data into SAS #6
I'm only reposting my suggestion, with changes (suggested by Andre offline), that are obviously needed for the code to work correctly. Specifically, I had moved the formats and informats to the end of the code (so as not to change the order in the PDF) but, as a result, made then ineffective. As such, my suggested code should have read: data a; informat dd dtc dtm anydtdtm19. ; format dd dtc dtm datetime21.; informat u $10.; format u $10.; infile "data.txt" dlm=',' dsd firstobs=2 lrecl=200; input site id pid it $ dd itd rtd linkid sp fc dtc dtm u $; run; Art -------- On Wed, 5 Nov 2008 20:38:24 -0500, Arthur Tabachneck <art297@NETSCAPE.NET> wrote: >Olive, > >Try: > >data a; > infile "data.txt" dlm=',' dsd firstobs=2 lrecl=200; > input site id pid it $ dd itd rtd linkid sp fc dtc dtm u $; > informat dd dtc dtm anydtdtm19. ; > format dd dtc dtm datetime21.; > informat u $10.; > format u $10.; >run; > >HTH, >Art >-------- >On Wed, 5 Nov 2008 11:36:20 -0800, olivesecret@GMAIL.COM wrote: > >>I tried Andre's code, that is, do not import data from the hard disc >>by infile statement, but copy all the data directly to sas using >>datalines. You know what? Now it works. So it means there is something >>wrong when I use infile statement to import data from the hard disc. >>Any suggestions? >>Thanks a lot! >> >> &g...

Re: help with reading ASCII data into SAS #3
ok, in that case u was too short: data a; infile "c:\daten\test.dat" dlm="," truncover dsd firstobs=2; input site : 8. id : 8. pid : 8. it : $5. dd : ANYDTDTM20. itd : 8. rtd : 8. linkid : 8. sp : 8. fc : 8. dtc : ANYDTDTM20. dtm : ANYDTDTM20. u : $15. ; u = compress(u,'""'); it = compress(it,'""'); format dtm dtc dd datetime20.; run; Gerhard On Wed, 5 Nov 2008 10:20:47 -0800, olivesecret@GMAIL.COM wrote: >Here is my code: > > data data; > infile 'data.txt' delimiter=',' dsd firstobs=2; > input site id pid it $ dd itd rtd linkid sp fc dtc dtm u $5. ; >run; > >Here is one more obs: > >1,4,1004,"JS",9/27/2008 0:00:00,1,1,57,11,10,10/3/2008 >11:31:17,10/3/2008= 11:31:17,"AVRC\psuggett" > >Other obs are similar. > >Thank you very much! > > > >On Nov 5, 12:24 pm, Nord...@DSHS.WA.GOV ("Nordlund, Dan (DSHS/RDA)") >wrote: >> > -----Original Message----- >> > From: SAS(r) Discussion [mailto:SA...@LISTSERV.UGA.EDU] On >> > Behalf Of olivesec...@GMAIL.COM >> > Sent: Wednesday, November 05, 2008 8:50 AM >> > To: SA...@LISTSERV.UGA.EDU >> > Subject: Re: help with reading ASCII data into SAS >> >> > Yes, I did it with delimiter=',' dsd firstobs=2, but was told invalid >> > data for each vari...

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

Re: Reading SAS data sets on UNIX by non-SAS apps #2
John: Following on Richard's thoughtful suggestions, the Affinium system would likely capture data from csv files. SAS PROC EXPORT produces them quickly, and loading them into external systems works faster for relatively basic data structures and data formats, in my experience, than xml parsing. Sig -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of John Bentley Sent: Monday, October 18, 2004 10:10 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Reading SAS data sets on UNIX by non-SAS apps I have SAS data sets on AIX that we need to read with Unica's Affinium campaign management software, also on a UNIX box. (Let's not get into why we didn't go with the SAS Solution.) SAS Institute doesn't supply an ODBC driver for the UNIX environment, and the Affinium implementors don't want to use the SAS SQL Library for C and or deal with APIs. Other that dumping the SAS data sets as flat files, can anyone suggest a solution? Thanks in advance for the help. ...

Re: Reading & Writing SAS data sets without SAS #3
Chang, You're correct in that a number of companies have done it. I believe SPSS can do it, WPS, Stat Transfer, dbmscopy, and perhaps others have also done it. But what I think is unique about this is that Alan is talking about offering plug-ins so you can roll-your-own so to speak. How cool would it be to have some type of driver/plugin for R? Phil Philip Rack MineQuest, LLC SAS & WPS Consulting and WPS Reseller Tel: (614) 457-3714 Web: www.MineQuest.com Blog: www.MineQuest.com/WordPress -----Original Message----- From: Chang Chung [mailto:chang_y_chung@HOTMAIL.COM] Sent: Monday...

help with reading ASCII data into SAS
I will appreciate for any suggestions. The data is a txt file. The first two observations of the data is: "=Site","ID","PID","IT","DD","ITD","RTD","Lin=kID","SP","FC","DTC","DTM","U" 1,1,100,"DA",1/1/2008 0:00:00,1,1,1,1,10,1/1/2008 13:10:20,1/1/2008 =13:10:20,"obd" Thanks a lot! Can anyone help me? On Nov 5, 10:45 am, olivesec...@gmail.com wrote: > I will appreciate for any suggestions. The data is a txt file. The > first two observations of the data is: > > "=Site","ID","PID","IT","DD","ITD","RTD","Lin=kID","SP","FC","DTC","DTM","U" > 1,1,100,"DA",1/1/2008 0:00:00,1,1,1,1,10,1/1/2008 13:10:20,1/1/2008 > =13:10:20,"obd" > > Thanks a lot! imort the data as comma separated values. If it does not read the values properly, copy the log into the program window and edited it accordingly On Nov 5, 11:09=A0am, olivesec...@gmail.com wrote: > Can anyone help me? > > On Nov 5, 10:45 am, olivesec...@gmail.com wrote: > > > > > I will appreciate for any suggestions. The data is a txt file. The > > first two observations of the data is: > > > "=3DSite","ID","PID","IT","DD",&...

Re: how to read quarterly data in SAS?
Richard, You are looking for the YYQ informat. 27?? data _null_ ; 28??? qob='1947Q1' ; 29??? qob_d=input( qob, yyq6. ) ; 30??? put qob= qob_d=date9. ; 31??? run ; qob=1947Q1 qob_d=01JAN1947 HTH, Ken -----Original Message----- From: Richard <hujian@GMAIL.COM> To: SAS-L@LISTSERV.UGA.EDU Sent: Sat, 3 Nov 2007 5:52 pm Subject: how to read quarterly data in SAS? Hi Guys: how to read time variable like 1947q1 from excel file? any informat? Thanks! Richard ________________________________________________________________________ Email and AIM finally together. You've gotta check out free AOL Mail! - http://mail.aol.com ...

Re: read Access data in SAS
If you have Access to PC File Formats, you can use the syntax: Libname mdb access "PATH\file.mdb"; -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Little T Sent: Thursday, October 11, 2007 8:14 AM To: SAS-L@LISTSERV.UGA.EDU Subject: read Access data in SAS Guys, I was given a Access data file to do some analysis. Can anyone share your idea or code of how to read Access data in SAS. Do I have to go into Access and export or do Import in SAS? Thanks. ...

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

Re: help reading data #5
art297@NETSCAPE.NET replied: > >[*1] I'll never learn whether that should be 'how reliable your > >data are' or 'how reliable your data is'. In German it's clearly > >'sind' i.e. 'are'. > > > > > >Robert Bardos > >Ansys AG, Zurich, Switzerland > >Robert, > >Not really a SAS-specific question, but I'm certain that you are not the >only one confused by the English/North American use of the word data. > >According to the M-W on-line dictionary: > >usage: Data leads a life of its own quite independent of datum, of which >it was originally the plural. It occurs in two constructions: as a plural >noun (like earnings), taking a plural verb and plural modifiers (as these, >many, a few) but not cardinal numbers, and serving as a referent for >plural pronouns (as they, them); and as an abstract mass noun (like >information), taking a singular verb and singular modifiers (as this, >much, little), and being referred to by a singular pronoun (it). Both >constructions are standard. The plural construction is more common in >print, evidently because the house style of several publishers mandates >it. > >HTH, >Art Which just goes to show that Americans should not be allowed to call it "the English language". :-) :-) I'm sorry, but as far as I am concerned, the word "data" is a plural. Data are. A single data point i...

Re: read compressed SAS data
Haven't seen that done ... A pipe command would, I believe, expect to stream a text file. Using zcat to stream data from a compressed XML document might work, but I haven't tried that. S -----Original Message----- From: owner-sas-l@listserv.uga.edu [mailto:owner-sas-l@listserv.uga.edu] On Behalf Of Wensui Liu Sent: Thursday, January 31, 2008 2:54 PM To: SAS(r) Discussion Subject: read compressed SAS data Dear All, in our unix server, we archived SAS data by compressing them to Z file. I am wondering if there is a way that I can read the compressed SAS data from Z file without uncompressing it. Thanks a lot for your insight! ...

Re: SAS Reading Cognos Data
May be with ODBC, I haven't tried, check online help doc or SI website. Other way, if you can dump COGNOS data into a flat file then you can with EFI or IMPORT wizard. Prasad Ravi Royce Claytor <Royce_Claytor@DOM.CO To: SAS-L@LISTSERV.UGA.EDU M> cc: Sent by: "SAS(r) Subject: SAS Reading Cognos Data Discussion" <SAS-L@LISTSERV.UGA.E DU> ...

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

Web resources about - Re: help reading data - comp.soft-sys.sas

Reading, Massachusetts - Wikipedia, the free encyclopedia
Coordinates: 42°31′32″N 71°05′45″W  /  42.52556°N 71.09583°W  / 42.52556; -71.09583 Coordinates : 42°31′32″N 71°05′45″W  /  42.52556°N 71.09583°W ...

Crystal Palace v Reading score, result, video highlights, goals - Fox Sports Fox sports
Cabaye opened the scoring from the penalty spot in the 85th minute after Jake Cooper was sent off for fouling Yannick Bolasie. Substitute Campbell ...

Crystal Palace v Reading score, result, video highlights, goals
... goals by Yohan Cabaye and Fraizer Campbell have given Socceroos skipper Mile Jedinak’s Crystal Palace a 2-0 victory at second-tier club Reading ...

Here's Mitt Romney Reading Mean Tweets by Trump and Trump Supporters
... the best tweet. Simon Dumenco, aka Media Guy, is an Ad Age editor-at-large. You can follow him on Twitter @simondumenco. Continue reading ...

(Late) Weekend Reading: Jeffrey Edleson on Sexual Harassment Here at Berkeley Edition
**Jeffrey Edleson**: [A Dean’s Reflection on Campus Sexual Misconduct Cases](http://blogs.berkeley.edu/2016/03/13/a-deans-reflection-on-camp ...

A brain-wave-reading device designed to improve sleep did wonderful and terrifying things to my dreams ...
The last week has been extremely unusual, to say the least. My dreams have been more colorful, detailed, vivid, and realistic than at any other ...

Melissa McBride Couldn't Speak After Reading The Walking Dead Season 6 Finale
The Walking Dead season six finale is going to be a mighty big, nasty pill to swallow.Several cast [...]

Man Learns About Ex’s Pregnancy & Friends’ Erotic Reading Habits Via Google Play
Sharing your review of an app — for good or bad — can help others decide if they should spend the money to add the service to their smartphone ...

Yeelight is smart, colorful and perfect for reading [Reviews]
The Yeelight is a fantastic, app-controlled, touch-enabled smartlamp that will fill your room will color and enable you to read bedside.

Here's another headline you should probably get used to reading: Warmest winter ever
The National Oceanic and Atmospheric Administration reported Tuesday that this was the warmest winter ever recorded for the 48 contiguous states ...

Resources last updated: 3/18/2016 2:05:34 AM