Premium

SAS Base Latest Interview Preparation (Q&A)



Question-: What is the difference between PUTLOG and PUT statement?

Answer: We can use PUTLOG and PUT statement to help and identify the errors and print the messages in the logs. We can use the PUTLOG statement in a DATA step to write messages to the SAS log to help identify logic errors. And also use temporary variables in the PUTLOG to assist in debugging. And using the PUT statement to examine variables and print your own message to the SAS log.



Question-: In the PROC PRINT report, how can you use data value as an observation column?

Answer: If you don’t provide any variable then by default OBS column would be generated and produce as first column. But if you don’t want OBS as a first column and some other variable from the DATASET as an ID or OBS column then use the ID option and then variable name as below.

proc print data=he_sas.he_data;
Id courseName;
run;
In this case courseName would be the first column in the report instead of OBS column.



Question-: How many “WHERE� statement you can have in a step?

Answer: You should have only one WHERE statement in a step to filter the observation, however if you put more than one WHERE statement SAS would not give any error but consider the only last WHERE statement. And also keep in mind you can use the variable in the WHERE statement which is not defined in the var statement as well.



Question-: What is the use of CONTAINS operator?

Answer: Using the “CONTAINS� operator you can check the substring value match. For example as below.

where courseName CONTAINS 'SQL';
where courseName ? 'SQL';
Instead of CONTAINS keyword you can use ‘?’ symbol as well.


Related Questions


Question-: How can you crate a permanent dataset in SAS?

Question-: Can a numeric variable below to the ‘character’ data type?

Question-: Can you explain the PROC contents and PROC print procedure?

Question-: What all are the basic categories in which you can divide the SAS procedures?

Question-: How do you specify the input dataset for a procedure?

Question-: What do you mean by threaded processing of SAS Base procedure?

Question-: Why ODS was introduced and what is the use of it?

Question-: What is the use of QUIT statement?