Desktop productivity for business analysts and programmers

New to SAS

Reply
RD
N/A
Posts: 1

New to SAS

Hello friends,
I am new to the world of SAS. I have been working as a Marketing Analyst for a few years now and realize it is time to pick up SAS. The last place I worked at used another tool which had some built-in functionality to do various analyses.

I have being doing some research on how to get started and found out about the SAS Enterprise Guide. A few years back I got trained in a similar click and Drop SPSS tool and thought that that was interesting. I would like to know if I would handicap myself by not going the programming route. I understand that SAS sells the Learning Edition software, but I would like to know how much functionality it includes. Can someone give me suggestions here to getting started?

Thanks,
RD.
N/A
Posts: 0

Re: New to SAS

The Learning Edition is a fairly inexpensive ~ $100. introduction to SAS and besides Base, includes portions of SAS/Stat, SAS/ETS, SAS/QC and SAS/Graph. (I sound like a sales person ;->)

Three important caveats:
1) you are limited to 10,000 observations for any dataset you create
2) the LE is intended for self-study, non-commercial purposes and
3) the version of E.G. included w. LE is 2.0 - this is pretty far removed from 3.0.2. and the recently announced 4.1 .

An excellent resource for all things SAS is SAS-L on the Internet. Do a Google search, see how you can join and then stand back ..

Just my $0.02 .

Bernie Zimmerman
N/A
Posts: 0

Re: New to SAS

"Can someone give me suggestions here to getting started?"

Not without knowing more about what your goals are. What specifically are you trying to achieve? What/where are your data sources? Are they corporate ones? Are they in a datawarehouse? What type of analyses are you trying to perform, using what statistical methods? What products are you currently using?

To address one of your questions, EG is the preferred interface to SAS, and it comes with each PC licence of base SAS 9.

However, it is still the case that a power SAS user must also be a programmer and it will be a few releases yet before EG makes enough of the underlying power of SAS available as point and click for programming not to be essential.
N/A
Posts: 1

Re: New to SAS

I'm getting back to SAS after a 25-year break. I've been using SPSS. I've studied EG and the PROCs and HELP, but can't find anything on recoding variables (collapsing categories, putting cardinal or ordinal into categories, etc.). In SPSS it's the RECODE function. Where do I find this in SAS? Thank you.
Super Contributor
Posts: 260

Re: New to SAS

Recoding is possible in many ways in SAS. Mostly two of them are used :
1) Hard coding. That means you create a dataset with a Data step, in which you compute a new variable, using some kind of IF/THEN/ELSE (or, preferrably, SELECT/WHEN/OTHERWISE) statements to assign values to your new variable.
E.g.
[pre]
DATA myNewDataset ;
SET myOldDataset ;
SELECT ;
WHEN (myVar < 10) myNewVar = "< 10" ;
WHEN (myVar < 50) myNewVar = "[10;50[" ;
OTHERWISE myNewVar = ">= 50" ;
END ;
RUN ;
[/pre]
The SELECT/WHEN statements are processed in this order, and once a WHEN condition is true, the action is executed and the program "jumps" to the END statement. If no WHEN condition is true, then the OTHERWISE action is executed.

2) "Soft" coding : just create a format. This is the PROC FORMAT job. For the same example, code would be... [pre]
PROC FORMAT ;
VALUE recode
LOW -< 10 = "< 10"
10 -< 50 =[10;50["
50 - HIGH = ">= 50"
;
RUN ;
[/pre]
Then, in the following procedures, you just have to add a Format statement to associate your existing variable with its newly-created format. E.g.
[pre]
PROC whatever DATA = myOldDataset ;
FORMAT myVar recode. ;
...
RUN ;
[/pre]
Don't forget the POINT after the format name when you use it (but there is no point when you CREATE it ; sounds weird, but that's how it goes).

I prefer soft coding over hard coding, the latter being a lot more flexible, and taking a lot less space & time to process. In Enterprise Guide, you find a task to design formats (and then assign them to variables by changing their properties, selecting FORMAT and looking in the USER-DEFINED FORMATS category). You also find a recoding screen in the query window.

For a lot more explanations on formats and Data step, I suggest you buy The Little SAS Book, which is a summary of all the important things you might have to know to code in SAS.

Regards,
Olivier
Super Contributor
Posts: 260

Re: New to SAS

2) "Soft" coding : just create a format. This is the PROC FORMAT job. For the same example, code would be... [pre]
PROC FORMAT ;
VALUE recode
LOW -< 10 = "< 10"
10 -< 50 =[10;50["
50 - HIGH = ">= 50"
;
RUN ;
[/pre]
Then, in the following procedures, you just have to add a Format statement to associate your existing variable with its newly-created format. E.g.
[pre]
PROC whatever DATA = myOldDataset ;
FORMAT myVar recode. ;
...
RUN ;
[/pre]
Don't forget the POINT after the format name when you use it (but there is no point when you CREATE it ; sounds weird, but that's how it goes).

I prefer soft coding over hard coding, the latter being a lot more flexible, and taking a lot less space & time to process. In Enterprise Guide, you find a task to design formats (and then assign them to variables by changing their properties, selecting FORMAT and looking in the USER-DEFINED FORMATS category). You also find a recoding screen in the query window.

For a lot more explanations on formats and Data step, I suggest you buy The Little SAS Book, which is a summary of all the important things you might have to know to code in SAS.

Regards,
Olivier
Valued Guide
Posts: 2,111

Re: New to SAS

With your SPSS experience, buy "SAS for Dummies" or "The Little SAS Book for Enterprise Guide 4.1" for a very quick start.

Data transformations are under data --> filter and query . Then hit F1 for context sensitive help.

[Bernie, SAS Learning Edition now uses SAS 9.1.3 and EG 4.1, supports 1500 observations, and cost ~$200. I think I got a slightly older copy, since it expires 12/31/2008.]

Doc
Ask a Question
Discussion stats
  • 6 replies
  • 150 views
  • 0 likes
  • 5 in conversation