Easy-to-score Questions In SAS Interview Must Prepare

SAS INTERVIEW QUESTIONS

Sas interview questions, this are the some off the most asked questions in sas interview. If you are planning for SAS interview then you must try this article to get the most asked questions by recruiters or interviwee. Checkout the best answers for your sas interview.

 How does format differ with informat?

    Ans. The main difference between format and informat is that the work of formats is reading the data whereas formats indicate SAS to write the variable of the data. For instance, informat ddmmyy commands SAS to read 240321 as 24th March, 2021.

What do you know about SAS?

    Ans. SAS, the abbreviation of Statistical Analytics System, is one of the most used software collections for data management, access to the data, precise analysis of multiple types of data and progressive analytics.

How does a stopstatement work in SAS programs?

    Ans. With the help of a stop statement, the processing of current data step stops instantly and the statements which are after the current data step, are executed. Stop statement skips the execution of the current data step and jumps to the next one.

How are using + operator and SUM function different from each other?

     Ans. Whenever any argument is missing in the SAS program, using + operator will result in a missing value but on the other hand, using SUM function will give you the sum of the arguments which are not missing. Sas interview questions which is one of the most asked questions.

   Example- data sampleM1;

input p q r;

cards;

13 20 1

14 2 40

20 31 1

. 2 4

13 . 2

32 3 .

25 2 5

;

run;

data sampleM2;

set sampleM;

S=sum(p,q,r);

H=p+q+r;

run;

When you execute the program, you will see the Sas interview questions 4th, 5th and 6th observation values are not there in the output of H:

S H

34 34

56 56

52 52

6 .

15 .

35 .

32 32

Briefly explain the working terminology of PROC SQL?

     Ans.  PROC SQL is a simultaneous process for all the observations. In the execution of PROC SQL, the following steps are involved-

  I. Firstly, SAS examines each and every statement in the SQL PROC and identifies syntax errors like- invalid statements, undefined variables, missing semicolons and missing braces etc.

             II. Then the SQL optimizer performs scanning of the query inside the statement and it determines the shortest optimization path for the query for the least runtime.

            III. Data engine loads the tables inside the FROM statement and memory accesses them.

            IV. Memory creates the final table followed by the execution of code and all the calculations involved in the program.

            V. Final table goes to the output table in the SQL statement.

Consider following expression is stored in the variable :

5 Lawyers’ Colony, NEW AGRA, 282005, U.P.

Tell the outputs in the following cases?

M=scan(address,3);

V=scan(address,3,’,’);

   Ans: M= Colony; V= 282005

Describe the features of SAS in brief.

    Ans. Analytics: In the analytics of business services and products, SAS is the best software available. DNMS software can be one of its important applications.

Business Solutions: To provide the companies with optimum sales, SAS offers precise insights and business analysis so that the companies may use them as their business products.

Reporting & Graphics: Hello SAS assists the users in visualizing the analysis of data and it gives the summary, graphic reports and lists. Moreover, SAS can do the visualization of reports in the form of bar charts, plots as well as multi-page outputs.

How can a user print observations 5 through the 10 from a data set?

     Ans.  SAS can print observations 5 through 10 with the help of data set READIN commanded by FIRSTOBS= and OBS= data set options.

proc print data = readin (firstobs=5 obs=10);

run;

What are the differences between INFILE and INPUT?

     Ans. INPUT statement describes the variables defined in the program and INFILE statement identifies the external files.

       Examples-  

FILENAME TEST

 ‘C:\DEEP\File1.xls’;

DATA READIN;

INFILE TEST;

LENGTH NAME @25;

INPUT ID NAME@ SEX;

RUN;

Here, the variable names which are prefixed by @ sign, are character variable types whereas the rest ones are numeric types.

How to do sorting in descending order?

      Ans. To perform sorting in the descending order, one should insert DESCENDING keyword in the PROC SORT code.

For example,

PROC SORT DATA=auto; BY DESCENDING engine ; RUN ;

And, eventually you will get the sorted output in the descending order.

 How can you convert a character variable to numeric variable type?

     Ans.  INPUT function helps here in converting the type of variable from character to numeric. Using the INPUT function, we must create a variable with a different name. For conversion from numeric to character, we should use the PUT function.

The example below shows the use of the INPUT function and PUT function as well.

numvar= input(charvar, 15.0) ;

charvar= put(numvar, 12.);

What is the difference between SET and MERGE?

     Ans. The work of SET is to link the data sets while the work of MERGE is to match the observations of data sets