How to understand a complex sas code as a beginner?

Reply
Contributor
Posts: 27

How to understand a complex sas code as a beginner?

Hi I am new to sas and I am eager to learn and understand unknown codes.. As a beginner, how do I understand a complex sas code.. Whenever I see a big code, I panic. Any suggestions?

Have same problem wih understanding macro code. Complex macro code too.. How do i understand..

SAS Super FREQ
Posts: 8,743

Re: How to understand a complex sas code as a beginner?

Hi:

  Every SAS statement starts with a keyword, such as

OPTIONS or DATA or PROC or IF or SET or INFILE or LIBNAME or....you may see a function call in an assignment statement like:

newvar=sum(oldvar1,oldvar2); and in this case, SUM is the name of the function

  Searching in the documentation for the keyword that starts your statement should give you a general idea of what the statement does. Or searching for the SUM function will give you an idea and examples of using the SUM function.  If you have a procedure step: PROC xyz, then you can search in the documentation for PROC xyz to see the documentation topic that explains what the procedure does.

  I do not generally recommend working with the SAS Macro Facility until you understand SAS programming. I do not know what you mean by "complex macro code". The macro facility is only generating "regular" SAS programming code. It will be hard to understand what the macro facility is doing if you do not understand the underlying SAS code that is being generated.

  We have some classes that might be useful to you:

Programming1 (SAS Training in the U.S. -- SAS Programming 1: Essentials) would be the class for your first question and

Programming2 (SAS Training in the U.S. -- SAS Programming 2: Data Manipulation Techniques) would also be the class for your first question;

Macro Language 1(SAS Training in the U.S. -- SAS Macro Language 1: Essentials) would be the class for your second question and, not surprisingly, we recommend that you understand the concepts in Programming 1 and Programming 2 before you take the Macro class.

  And, if you are working with the SAS BI Platform, as some of your other questions seem to imply, then you will probably want to read the documentation for those products/components, too.

cynthia

Ask a Question
Discussion stats
  • 1 reply
  • 232 views
  • 0 likes
  • 2 in conversation