f

#### Re: Need help with SAS Data step #3

```in SAS you can get all which has a structure, following certain rules. A
simple rule is: all data-fields are seperated by a delimiter.
That seems to be not the case at your data. Ok, also that data must have a
certain structure, if you are able to read it and understand it. So the
easiest way might be to ask, "how do I understand that data?" "Which rules
do I follow?".
Ok, one of that rules might be: I know that the country is the first word.
That after the country up to the first number is the capital. That are
rules you could implement in SAS.
If it is more complicated, e.g. there are also countries like 'Sri Lanca'
you might have a list with all that countries (like that in your head -
something in your brain must tell you, that the country is not Sri and the
capital is not Lanca) to get them.
Gerhard

On Mon, 23 Jun 2008 06:05:20 -0700, Lou <lpogoda@HOTMAIL.COM> wrote:

>On Jun 21, 5:23 pm, mehdisat...@GMAIL.COM (Mehdi Satter) wrote:
>> Hello,
>>
>> I'm a new SAS learner. I become interested in SAS when I took a
>> Biostatistics class. Then I took a SAS/Stat class and learned how to
SAS for
>> statistical data analyses. Basically I'm a spinal cord injured graduate
>> student in computer science. After taking that SAS class I started
learning
>> SAS and planning to develop my career in SAS programming. Because other
>> computer programming languages involve writing many many lines of
codes. For
>> my physical limitation I find SAS needs only few lines of codes and
makes my
>> life little easier.
>>
>> Anyway, I'm always having trouble reading data at SAS data step using
>> 'INPUT' statement. I fail to read character variables with embedded
spaces.
>> Here is a part of a data set I was using to practice SAS;
>>
>> *data* country;
>>
>>           input Name : \$19. Capital \$ Population Area Continent \$
UNDate;
>>
>>           datalines;
>>
>>           Afghanistan Kabul 17070323 251825 Asia 1946
>>
>>           Albania Tirane 3407400 11100 Europe 1955
>>
>>           Algeria Algiers 28171132 919595 Africa 1962
>>
>>           Andorra Andorra la Vell 64634 200 Europe 1993
>>
>>           Angola Luanda 9901050 481300 Africa 1976
>>
>>           Antigua and Barbuda St. John's 65644 171 Central America 1981
>>
>>           Argentina Buenos Aires 34248705 1073518 South America 1945
>>
>>           Armenia Yerevan 3556864 11500 Asia 1992
>>
>>           Australia Canberra 18255944 2966200 Australia 1945
>>
>>           Austria Vienna 8033746 32400 Europe 1955
>>
>>           Azerbaijan Baku 7760064 33400 Asia 1992
>>
>>           Bahamas Nassau 275703 5400 Central America 1973
>>
>>           Bahrain Manama 591800 300 Asia 1971
>>
>>           Bangladesh Dhaka 1.2639E8 57300 Asia 1974
>>
>>           Barbados Bridgetown 258534 200 Central America 1966
>>
>>           ;;;;
>>
>> Would anyone be kind enough to teach me how to write input statement for
>> this kind of data set with embedded spaces and quotes. I would
appreciate
>> that.
>
>SAS supports several styles of input, but they all depend on the data
>following one or another set of rules.  What you're asking for doesn't
>look possible to me - as someone else noted, if you can't change the
>data lines to agree with something SAS supports, it would seem your
>only choice is to read in the whole line and use logic to tease out
>
>However, looking beyond this particular case - if you're looking
>forward to a career that involves heavy involvement with SAS
>programming, there's no substitute for learning SAS.  People here are
>often glad to help with suggestions and code snippets, but the
>majority of the effort has to come from you.  I STRONGLY suggest that
>as a minimum you read the documentation for SAS/BASE more or less
>start to finish, besides using it to look up answers to questions such
>as you pose above.  Don't stress about the sheer volume of material -
>if you spend even half and hour a day (over lunch maybe) it will pay
>you back manyfold for decades.  If your place of work doesn't have
>paper copies of the documentation, you can access it online at
>http://support.sas.com/onlinedoc/913/docMainpage.jsp
```
 0
6/23/2008 2:29:17 PM
comp.soft-sys.sas 142828 articles. 3 followers.

0 Replies
532 Views

Similar Articles

[PageSpeed] 56

Similar Artilces:

Re: Need help with SAS Data step
Mehdi, There is no way for SAS to know when the variables begin and end if the data is both free-form and lacks a delimiter. Prior to reading the file into SAS, is it possible to save the file in some type of delimited format, e.g. comma or tab, or fixed form? What is the original source / file type of your data? If you have no way of changing your data prior to reading it into SAS, it seems you would have to read the entire observation into a single variable and then use logic to parse the data. Regards, Scott -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Mehdi Satter Sent: Saturday, June 21, 2008 5:23 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Need help with SAS Data step Hello, I'm a new SAS learner. I become interested in SAS when I took a Biostatistics class. Then I took a SAS/Stat class and learned how to SAS for statistical data analyses. Basically I'm a spinal cord injured graduate student in computer science. After taking that SAS class I started learning SAS and planning to develop my career in SAS programming. Because other computer programming languages involve writing many many lines of codes. For my physical limitation I find SAS needs only few lines of codes and makes my life little easier. Anyway, I'm always having trouble reading data at SAS data step using 'INPUT' statement. I fail to read character variables with embedded spaces. Here is a part of a data set I was using to practice SA...

Re: Need help with SAS Data step #2
On Sat, 21 Jun 2008 16:23:07 -0500, Mehdi Satter <mehdisatter@GMAIL.COM> wrote: >Hello, > >I'm a new SAS learner. I become interested in SAS when I took a >Biostatistics class. Then I took a SAS/Stat class and learned how to SAS for >statistical data analyses. Basically I'm a spinal cord injured graduate >student in computer science. After taking that SAS class I started learning >SAS and planning to develop my career in SAS programming. Because other >computer programming languages involve writing many many lines of codes. For >my physical limitation I find SAS needs only few lines of codes and makes my >life little easier. > >Anyway, I'm always having trouble reading data at SAS data step using >'INPUT' statement. I fail to read character variables with embedded spaces. >Here is a part of a data set I was using to practice SAS; > >*data* country; > > input Name : \$19. Capital \$ Population Area Continent \$ UNDate; > > datalines; > > Afghanistan Kabul 17070323 251825 Asia 1946 > > Albania Tirane 3407400 11100 Europe 1955 > > Algeria Algiers 28171132 919595 Africa 1962 > > Andorra Andorra la Vell 64634 200 Europe 1993 > > Angola Luanda 9901050 481300 Africa 1976 > > Antigua and Barbuda St. John's 65644 171 Central America 1981 > > Argentina Buenos Aires 34248705 1073...

Re: Need help with SAS Data step #4
Thank you all for being so nice and helpful. Have a good one. -Mehdi On Mon, Jun 23, 2008 at 9:29 AM, Gerhard Hellriegel < gerhard.hellriegel@t-online.de> wrote: > in SAS you can get all which has a structure, following certain rules. A > simple rule is: all data-fields are seperated by a delimiter. > That seems to be not the case at your data. Ok, also that data must have a > certain structure, if you are able to read it and understand it. So the > easiest way might be to ask, "how do I understand that data?" "Which rules > do I follow?". > Ok, one of that rules might be: I know that the country is the first word. > That after the country up to the first number is the capital. That are > rules you could implement in SAS. > If it is more complicated, e.g. there are also countries like 'Sri Lanca' > you might have a list with all that countries (like that in your head - > something in your brain must tell you, that the country is not Sri and the > capital is not Lanca) to get them. > Gerhard > > > > > On Mon, 23 Jun 2008 06:05:20 -0700, Lou <lpogoda@HOTMAIL.COM> wrote: > > >On Jun 21, 5:23 pm, mehdisat...@GMAIL.COM (Mehdi Satter) wrote: > >> Hello, > >> > >> I'm a new SAS learner. I become interested in SAS when I took a > >> Biostatistics class. Then I took a SAS/Stat class and learned how to > SAS for > >> statistical...

Re: Need help with SAS Data step #5
Summary: Make guesses and add information to check work. #iw-value=1 Mehdi, As a computer science student you must be aware that any field has to be defined in some way if one is to have an automated way to read the fields. Let's look at your worst case. > Antigua and Barbuda St. John's 65644 171 Central America 1981 Where does country end and capital begin? An English speaking human might say, "Well, the word 'and' cannot begin a capital name." You could of course build this feature into your program, but then there are probably some other examples with other words. As a computer science student you are probably aware of regular expressions, so you might take a look at the PRX functions and try to parse each line into separate fields. This probably would have the biggest payoff in your career, but since you are a beginning SAS student I have chosen to show you some of the more traditional SAS tricks. First we observe that it is easy to recognize the three number fields. The rest follows by assuming that a country name is usually one word. You will have to look up features in on line documentation or the help facility. Hopefully the comments are enough to follow the code below. You might copy it and then try executing it. data country ( drop = rest x ) check ; /* assumptions name - first word captal - everthing up to numbers population - first number area - second number ...

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

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: SAS DATA STEP #3
1) to the the natural ordering you ask for you will need to read period as a "SAS date variable" using MONYY informat. If your data are in SAS data set use: periodDT=input(period,monyy.); or similar. The thing to know is SAS dates are numbers and input function reads character data. Check the docs. 2) creating the flag is easy using first. and a counter. data work.bank; input period :monyy5. ID RESPONSE @@; format period monyy.; cards; JAN05 1234 0 APR05 1234 0 JUN05 5678 0 OCT05 5678 0 SEP05 5678 1 APR05 3456 1 JAN05 3456 0 OCT05 3456 0 SEP05 3456 1 ;;;; run;...

Need help with SAS Data step
Hello, I'm a new SAS learner. I become interested in SAS when I took a Biostatistics class. Then I took a SAS/Stat class and learned how to SAS for statistical data analyses. Basically I'm a spinal cord injured graduate student in computer science. After taking that SAS class I started learning SAS and planning to develop my career in SAS programming. Because other computer programming languages involve writing many many lines of codes. For my physical limitation I find SAS needs only few lines of codes and makes my life little easier. Anyway, I'm always having trouble reading data at SAS data step using 'INPUT' statement. I fail to read character variables with embedded spaces. Here is a part of a data set I was using to practice SAS; *data* country; input Name : \$19. Capital \$ Population Area Continent \$ UNDate; datalines; Afghanistan Kabul 17070323 251825 Asia 1946 Albania Tirane 3407400 11100 Europe 1955 Algeria Algiers 28171132 919595 Africa 1962 Andorra Andorra la Vell 64634 200 Europe 1993 Angola Luanda 9901050 481300 Africa 1976 Antigua and Barbuda St. John's 65644 171 Central America 1981 Argentina Buenos Aires 34248705 1073518 South America 1945 Armenia Yerevan 3556864 11500 Asia 1992 Australia Canberra 18255944 2966200 Australia 1945 Austria Vienna 8033746 32400 Europe 1955 Azerbaijan Baku 7760064 ...

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

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

Re: I need help with SAS Macro #3
Same tune, different song ... %Let Start_Month = 200510; %Let End_Month = 200601; DATA t; LENGTH s \$ 6; DO d = Input("&start_month.01",yymmdd8.) TO Input ("&end_month.01",yymmdd8.); s = Catt(Put(Year(d),4.),Put(Month(d),z2.)); OUTPUT; d = Intnx('month',d,0,'E'); END; FORMAT d DATE9.; RUN; ...

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

Need SAS Data Integration Consultant with SAS Data Integration Studio, Base SAS, SAS macros and SQL experience for a 9 months project at Charlotte NC, please send resumes to kamesh@kmmtechnologies.com
Need SAS Data Integration Consultant with SAS Data Integration Studio, Base SAS, SAS macros and SQL experience for a 9 months project at Charlotte NC, please send resumes to kamesh@kmmtechnologies.com ...

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

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

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: SAS Certification
The book "SAS Certification Prep Guide: Base Programming" from Amazon (\$75) is very good for SAS certification. It also has sample quiz at the end of each chapter and gives you sample codes on a CD too. I would strongly recommend that book to get started. BB -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Neil Sent: Monday, June 19, 2006 12:57 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: SAS Certification - Need Some Help There are several prep books published by the SAS Institute that are available on Amazon. A bit pricey, though. ...

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: SAS Certification
Amazon is carrying a new version. Is it worth the extra \$50? 2004 848pages \$75 http://tinyurl.com/l5u7z 2006 848pages \$124 http://tinyurl.com/ekqto thanks in advance, mike ...

Re: SAS data step processing question #3
SAS did it in the order you wanted, but unfortunately first.id is created in the by statement, not when you first ask for it. Once you do the set and by statements, you have a dataset that looks like this (it actually has first and last in separate variables for EACH by statement element). id type 1 1 FIRST 1 1 1 1 LAST 2 2 FIRST 2 1 2 1 LAST 3 2 FIRST 3 4 3 1 LAST 4 2 FIRST 4 1 4 1 LAST Then it deletes, leaving so: id type 1 1 FIRST 1 1 1 1 LAST 2 1 2 1 LAST 3 1 LAST 4 1 4 1 LAST and then it keeps only the first one (1 1) because the others are not first.id. Use WHERE in the set statement to cause the by statement to work as you expect. set v1(where=(type=1)); -Joe On Fri, Dec 12, 2008 at 12:10 PM, D T <sasandstats@live.com> wrote: > I used this code: > > data v2; > set v1; > by id descending date; > if type ne '1' then delete; > if first.id and nocase=1; > run; > > and was assuming it would process restriction 1 first (if type ne '1' then > delete;), and would then, after excluding all other types select the first > row (first.id) for those with nocase=1. > > I found out the hard way that SAS actually processed this differently: it > seemed to have selected those with type=1 among those for which the second > statement was true--so, in a way, SAS reversed the order of my statements. > > Can anyone explain? > > Thanks and best regards, > D. > _____________________________________...

Re: New to SAS and need a bit of help #3
Vishaal, I haven't had a chance to look at this since this morning, but I've been bothered by why my suggestion was so much shorter then the one offered by Gerhard. I, obviously, didn't understand what you were asking for. I still don't understand which data you want to omit, but I think that the following comes a lot closer than my previous suggestion: proc sort data=have; by permno Date; run; data temp; retain last_date; format last_date date9.; set have (where=(date between '01jan1987'd and '31dec2007'd)); by permno; if first.permno then do; sequence=0; call missing(last_date); end; if intck('month',last_date,date) ne 1 then do; sequence+1; consecutive=0; end; consecutive+1; last_date=date; run; proc sql; create table want as select Date,permno,returns from (select Date,permno,returns,sequence from temp group by permno,sequence having max(consecutive) ge 3) order by permno,Date; quit; Since you didn't provide any sample data, or desired output, I can't test or compare either Gerhard's or my own suggestions. Art ---------- On Wed, 25 Jun 2008 19:33:29 -0700, fredybeach <vishaal.baulkaran@GMAIL.COM> wrote: >Here is my dataset---monthly obs for 20 yrs > >Date permno returns >01/31/1987 11111 0.07 >. >.. >.... >12/31/2007 ...

Old SAS Guy needs help with some of these new fangled SAS 9.1.3
Greetings all who have helped me in the past. Here is something that has been bothering me unending and is causing me = sleepless afternoons. =20 I know that I can import just about any file imaginable into SAS using = the import function using SAS Windows 9.1.3. =20 However, when trying to get comma seperated values moved all at once = into the new SAS file, I can (or only know how to get) the data for one variable moved at a = time. I would like to do a mass=20 move of all the data from the input file into the new SAS file. Is = there a way to do this? Because once I have imported the file into a new SAS file, established variable = names, established formats, informats, variable lengths, etc. I would like to be able to save the settings for = the next like file that I want to import into what I have already slaved over doing, defining, etc., without repeating the = process. Is there a way to do this? Waiting with bad breath on the sidelines. The Old SYS/390 guy "SAS was originally invented for computer performance and capacity = planning for the SYS/3x0 IBM machines... they sure have taken it into new features that are amazing" I'm not sure I understand your question but it sounds like you're importing data using an wizard and you want to do it using command syntax. See http://www.ats.ucla.edu/stat/sas/faq/default.htm, I think that can help you. (Maybe http://www.listerine.com/ could help as well?) Good luck, John Hendrickx Statistician Cl...

Re: SQL SAS for DATA step OBS= statement #3
On Wed, 20 Dec 2006 13:27:37 -0800, hiemstra@yahoo.com <hiemstra@YAHOO.COM> wrote: >What is the SAS SQL equivalent for a DATA step (OBS=1000) request? > >This works: > >DATA WORK.&_filename; > SET &_dir..&_filename(WHERE=(bus_type='SF') OBS=1000); >RUN; You can use the INOBS option, as in proc sql; reset inobs=5; select * from sashelp.class where sex='F'; reset inobs=max; This displays 5 rows, because the WHERE filter is applied before the counting. > >But I would like to optimize with a pass through SQL request t...