You are on page 1of 6

SAS QUESTIONS :

You can place more than one SAS statement on a single line.
True b.) False

What are the datatypes of SAS ?


Character and Numeric
Character , Numeric ,Integer.
Character and Integer
character,Numberic and Dates.

What is the default storage length for SAS numeric variables (in bytes)?
16 bytes
32 bytes
8 bytes
None of these.

What is the default data delimiter for SAS ?


Tabs
Space
commas
coloums.

TITLE statement are called global statements?


True
False

SAS datasets consists of how many parts?


2
3
1
none

You can use PROC CONTENTS to list the names of all the SAS data sets in a SAS
library (folder)?
True
False

In which steps, you can create labels for the variable.


only in DATA step.
Only in PROC step
Either in DATA or PROC step.
None of the above.

PDV stands for ?


Program Data Verification.
Procedure Data Vector
Program Data Vector.
Procedure Data Verification.
Concatenating data sets is the process of creating the new data with another datasets
without using By statement?
True
False

ODS TRACE statement tell the SAS to print information in output file?
True
False

In ODS,the default style to create HTML output is


HTML
DEFAULT
FILE
none

What SAS statements would you code to read an external raw data file to a DATA step?
INFILE statement.
FILE statemet
FILEIN statement
None of the above.

Default for the missing value of numeric variable is?


Blank
Dot
Blank with ticks ( ‘ ‘ )
None.

The extesion of ".sas" is required for sas program files.

True
False

Which X variable has a value of 1 at the end of an input file?

A. END = X
B. OBS = X
C. EOF = X
D. LASTOBS = X

Which values are stored in the output data set?

name age XYZABC 20


name age XYZABC (missing value)
name age (missing value) (missing value)
The DATA step fails execution due to data errors
Given the following DATA step:
DATA LOOP;
X = 0;
DO INDEX = 1 TO 5 BY 2;
X = INDEX ;
END;

RUN;

Upon completion of execution, what are the values of the variables X and
INDEX in the SAS data set named
LOOP?

x = 3, index = 3
x = 3, index = 4
x = 5, index = 5
x = 5, index = 6
x = 5, index = 7

The following program submitted:

data xx;
date1=122591;
date2=put(date1,z6.);run;
What’s the data type of date1 and date 2 ?

Date1 Character, Date 2 Numeric


Date1 numeric, Date 2 character
Syntax error

not executed

The following statements are submitted

Data Test;
today = '20dec2008'd;
format today mmddyy10.;
run;

Which of the following statement is true ?

‘Today’ variable displays like ‘12/20/2008’


Data step not executed due to wrong format ‘mmddyy’.
Today is displayed as ‘20DEC2008’.
22) Given that the data set named ONE contains 10 observations and the data set
named TWO contains 10 observations, how many observations will be contained in
the data set named COMBINE that is created in
the following DATA step?

data combine;
set one two;
run;

A. 10
B. 20
C. 0, the DATA step will fail due to syntax errors
D. 10 to 20, depending on how many observations match

23) Default format of SAS Date

Numeric

Character

YYMMDD10.

DDMMYY8.

24) If the SAS values are -365,15706,1,365

(Jan 1,1959),(Jan 1,2003),(Jan 1,1960),(Jan 1,1961)

(Dec 1,1959),(Jan 1,2003),(Jan 1,1960),(Jan 1,1961)

(Jan 1,1959),(Jan 1,2003),(Jan 2,1960),(Jan 1,1961)

(Jan 1,1959),(Jan 1,2003),(Jan 2,1960),(Dec 1,1960)

25) Uses of Following date Interval Function

INTCK function computes the number of intervals between two dates and
INTNX function computes a date after a given number of intervals.

INTNX function computes the number of intervals between two dates and INTCK
function computes a date after a given number of intervals.

Both INTCK and INTNX are used for function computes the number of intervals
between two dates

D) Both (a) and (c)


26) Go through the following code and choose the correct options,

DISCHRDATE= '29NOV2003'D;

Step1- FOLLOWDATE = INTNX('MONTH',DISCHRDATE,6);

Step-2 FOLLOWDATE1 = INTNX('MONTH',DISCHRDATE,6,'SAMEDAY');

Both are same?

a)Yes

b)No

27) Compare the Result – INTCK (when taking the year difference years) and YRDIF.

a)Both will return the value with decimal point

b)Both will return the Whole numbers only.

c)INTCK will return the whole nos and YRDIF will return with decimal
point
d)Both (a) and (b).

28) The following statements are submitted

Data Test;
today = '20dec2005'd;
format today mmddyy10.;
run;

Which of the following statement is true ?

‘Today’ variable displays like ‘12/20/2005’


b. Data step not executed due to wrong format ‘mmddyy’.
c. Today is displayed as ‘20DEC2005’

29)Which statement is false regarding the use of DO loops?

a.They can contain conditional clauses.

b.They can generate multiple observations.

c.They can be used to combine DATA and PROC steps.

d.They can be used to read data.

30)Which set of statements is the most efficient equivalent to the code shown below?

if code='1' then Type='Fixed';


if code='2' then Type='Variable';

if code^='1' and code^='2' then Type='Unknown';

if code='1' then Type='Fixed';

else if code='2' then Type='Variable';

else Type='Unknown';

if code='1' then Type='Fixed';

if code='2' then Type='Variable';

else Type='Unknown';

if code='1' then type='Fixed';

else code='2' and type='Variable';

else type='Unknown';

if code='1' and type='Fixed';

then code='2' and type='Variable';

else type='Unknown';

31) Mark the Keyword that will come under WHERE statement,

a.Between and , otherwise

b.In, is missing

c.=*,contains

d.All of the above

32.What is an array
arrays are a collection of elements (usually SASvariables)
b)arrays are used store memory location of other variables
c)array is collocection of statement

You might also like