SAS-INTERVIEW QUESTIONS

SAS-INTERVIEW QUESTIONS

1. What SAS statements would you code to read an external raw data file to a DATA step?

Ans: Infile and Input statements are used to read external raw data file to a Data Step.

2. How do you read in the variable that you need?

Ans: If we want to read a particular variable in a set of SAS data set, we can mention the variable we want in the INPUT statement.

3. Are you familiar with special input delimiters? How are they used?

Ans: Yes, we have special delimiters like DLM and DSD in SAS. Both these delimiters can be used in the infile statement The DLM can read the commas and spaces as data delimiters. You may choose any delimiters you wish with this option. You can choose multiple character such as DLM="XX" for your delimiter. The DSD option allows you to treat two consecutive delimiters as containing a missing value.

4. If reading a variable length file with fixed input, how would you prevent SAS from reading the next record if the last variable didn't have a value?

Ans: We can use MISS OVER option in the INFILE statement

5. What is the difference between an informat and a format? Name three informat or format?

Ans: An informat is an instruction that SAS uses to read data values into a variable A format is an instruction that SAS uses to write data values

The three informat are: A) Date informat B) Character informat c) Numeric informat

The three Formats are:-

A) Date format B) Character Format C) Numeric Format

6. Name and describe three SAS function that u have used, if any? Ans: A) SUM Function: It adds the variable together by ignoring the missing values if any E.G: Var=SUM (var1, var2...varn); Var1= SUM (1,., 3) = 4

B) Mean Function: This function returns the arithmetic mean (average) and ignores the missing value. E.G: Var=MEAN (var1, var2, var3...varn);

C) SUBSTR Function: The SUBSTR function extracts a portion of the character data values based on how many characters are designated for retrieval. E.G: Var=SUBSTR (var, start ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download