DATA Step, Macro, Functions and more

Best learning material to learn sas macros and functions?

Reply
Contributor
Posts: 26

Best learning material to learn sas macros and functions?

Hi i have just started learning SAS programming. I found it quite different another programming languages while implementing my ideas. Somebody had suggested me learn macros, looping, and functions to implement my ideas. Please suggest me good material on the internet where I can learn SAS programming with examples. Thankyou

PROC Star
Posts: 765

Re: Best learning material to learn sas macros and functions?

Posted in reply to ervinodsingh

SAS provides a free e-learning course, which is definitely worth checking out

 

https://support.sas.com/edu/elearning.html?ctry=us&productType=library

Super User
Posts: 7,854

Re: Best learning material to learn sas macros and functions?

Posted in reply to ervinodsingh

Do not start with macros before you have mastered the basic data step techniques, use of the most important functions (sort, means, tabulate, format, print, report, contents, datasets, transpose), and SQL. With the typical SAS courses, you start with the macro language no before at least three weeks of dealing with other aspects of SAS.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
SAS Super FREQ
Posts: 8,868

Re: Best learning material to learn sas macros and functions?

Posted in reply to KurtBremser
Hi:
We recommend SAS skills to the level of Programming 1 and Programming 2 training before someone takes the SAS Macro Language class. I think that this recommendation is absolutely on point. The SAS Macro facility works best when you start with a working SAS program and in order to start with a working SAS program, a programmer really needs to have a solid foundation in basic SAS programming skills.

cynthia
Super User
Super User
Posts: 7,988

Re: Best learning material to learn sas macros and functions?

Posted in reply to ervinodsingh

Hi,

 

There are many learning places out there:

http://support.sas.com/training/tutorial/

 

If you want to learn graphs, then this blog is a valuable resource:

http://blogs.sas.com/content/graphicallyspeaking/

 

I would certainly second @KurtBremser's suggestion there.  Learn Base SAS thouroughly before moving onto advanced topics such as macro.  Macro is just a find and replce tool, but it can very quickly complicate you and make your code dreadful.  There is nothing you can do in macro which you cannot do in Base SAS.  

I would also suggest you look at different data models, transposed (data going across) and normalised (data going down), as these can again make your life a lot easier, something like reuducing your code just by moving to the other structure, then doing your processing and flipping back up.  

 

This forum is also a good learning place, even after 15 years I still look at some posts and think I didn't know that.  

 

And remember, if you can't think of something:
google search: SAS <mytopic>

Generally yields plenty of results.

 

Oh, finally, by other languages do you mean .net type OOP langauges, or something else?  SAS is a data based approach, so datasteps run over data observations like a loop, and procedures can do loops by using by processing - important to remember as its rare you would need to hardcode a loop in yourself.

Contributor
Posts: 26

Re: Best learning material to learn sas macros and functions?

I mean R, Python, MATLAB etc. for Other languages,

Super User
Super User
Posts: 7,988

Re: Best learning material to learn sas macros and functions?

Posted in reply to ervinodsingh

Ok, well R has dataset type convention, and Python has some sort of distionary/array type setup.  So should be similar in that regards, although I don't believe either is hard typed - i.e. in SAS you need to define column lengths/formats.

Super User
Posts: 19,867

Re: Best learning material to learn sas macros and functions?

Posted in reply to ervinodsingh

If you find a specific topic you're having difficulties you can search at lexjansen.com for user written papers on the topic. 

For example based on your question I started thinking simulations, which means I'd refer you to the paper called Don't Be Loopy by David Cassell. Or Rick Wicklins book on simulation. 

Ask a Question
Discussion stats
  • 7 replies
  • 164 views
  • 1 like
  • 6 in conversation