Question-81:  What is the Syntax and semantic errors in SAS?

Answer: Syntax errors occur when SAS program does not confirm the programming language of the SAS for instance having a wrong spelling for SAS keyword, missing RUN statement, missing semicolon, unbalanced quotation marks etc.

 

And semantic errors mean you are using language element which is not valid for a particular usage.

 

Logic error: logic errors means that program successfully executed but not generate the expected results or incorrect results. In this PUTLOG statement can help to find the cause of the issue, which can help you to print the messages in the SAS log.

 

Question-82: What is the use of the STOP statement in SAS?

Answer: STOP statement of the SAS program can help you un stopping the currently running DATA step and run the or resume the processing statement which comes after the end of current DATA step.

 

Question-83: What is the effect if you use “drop=” option in DATA statement and SET statement?

Answer: When you use “drop=” option in the set statement it means variable mentioned in the “drop=” option would not be even processed and would not be part of the new data set.

 

But if you want to process the variables but do not want them to be appear in the output data set then use the “drop=” option in the data statement.

 

Question-84: What all are the data types in SAS?

Answer: SAS has two data types NUMERIC and CHARACTER.

 

Question-85: What is the difference between function and procedure?

Answer: In SAS the fundamental difference between function and proc is that function expects the argument values across an observation in a SAS DATA set and procedure expects one variable value per observation.

                             data he_learner ;

 set he_fee ;

 avgfee = mean( of F1 - F6 ) ;

run ;

 

proc sort ;

 by month ;

run ;

proc means ;

 by month ;

 var avgfee ;

run ;

 

 

In the above code you can see calculate the average fee for each observation in a day for 6 courses. And the proc means we are passing the same average fee for each day and it calculates the mean value across 30/31 observation in the month.