Premium

Base SAS Certified Associate: Programming Fundamentals Using SAS Questions and Answers (Dumps and Practice Questions)



Question : Which one of the following is true when SAS encounters a data error in a DATA step?

  : Which one of the following is true when SAS encounters a data error in a DATA step?
1. The DATA step stops executing at the point of the error, and no SAS data set is created.
2. A note is written to the SAS log explaining the error, and the DATA step continues to execute.
3. A note appears in the SAS log that the incorrect data record was saved to a separate SAS file for further examination.
4. The DATA step stops executing at the point of the error, and the resulting DATA set contains observations up to that point.

Correct Answer : 2


Explanation: Notice what happens when SAS encounters invalid data.

1 An error message is printed on the log.

NOTE: Invalid data for DOB in line 6 9-15.
2 The raw data line is printed with a ruler.

RULE:----+----1----+----2----+----3----+----4----+----5----+----6
6 1 SMITH 1/23/66 68 144 M 26
Aside: Notice how the error message "for DOB in line 6 9-15" points you to the variable being read, the line number and the column range where the input error occurred.

3 The resulting values of all the variables (after the input process) are printed.

ID=1 LASTNAME=SMITH DOB=. HEIGHT=68 WEIGHT=144 GENDER=M AGE=26 _ERROR_=1 _N_=1
Aside: The special variables _ERROR_ and _N_ are used in the data set
to indicate whether a run-time error has occurred with this observation, and
to indicate how many times the data step has executed.
These two variables are not included in the output dataset.

4 The data step keeps running.

NOTE: The data set WORK.WONTWORK has 4 observations and 7 variables.
Also see that the Proc Print output shows that a dataset with values was created. All the variables have been given values for all the observations (a missing value is a value).
Data errors occur when some data values are not appropriate for the SAS statements that you have specified in the program. For example, if you define a variable as numeric, but the
data value is actually character, SAS generates a data error. SAS detects data errors during program execution and continues to execute the program, and does the following:
writes an invalid data note to the SAS log.
prints the input line and column numbers that contain the invalid value in the SAS log. Unprintable characters appear in hexadecimal. To help determine column numbers, SAS prints a
rule line above the input line.
prints the observation under the rule line.
sets the automatic variable _ERROR_ to 1 for the current observation.





Question : You have been given below dataset, how many observation and variables it has ?

 : You have been given below dataset, how many observation and variables it has ?
1. 10 Observation and 10 Variables

2. 9 Observation and 9 variables

3. 10 Observation and 9 variables

4. 9 observation and 10 variables

5. There is one value missing, so we cannot tell.



Correct Answer : 3
Explanation: In SAS dataset, rows are known as observation and columns are known as variables. Hence, there are in total 10 rows and 9
columns which translates to the 10 observation and 9 variables. And if any particular value is missing than it will not affect it.




Question : You have been given below SAS program
data hadoopexam.courses;
infile hadoopexam1;
input name $ price ;
run;
proc sort data=hadoopexam.courses;
by price;
run;
proc print data=hadoopexam.courses;
run;

You run this program, than how many steps will be processed in total?


 : You have been given below SAS program
1. 1

2. 2

3. 3

4. 10

5. How SAS executes the steps internally, cannot be identified.


Correct Answer : 3
Explanation: As you know, as soon as SAS finds the RUN, PROC or DATA statement. It will stop there and execute the previous step. Hence
there are in total 3 steps which will be executed here.


Related Questions


Question : You have been given two dates as Dec and Jan, now you need to make sure that the date read by the SAS system as above, what
value you should specify for the YEARCUTOFF= option?

 : You have been given two dates as Dec and Jan, now you need to make sure that the date read by the SAS system as above, what
1. YEARCUTOFF=46

2. YEARCUTOFF=55

3. YEARCUTOFF=45

4. YEARCUTOFF=54

5. Any value, you can specify



Question : : You are working in a company named Acmeshell Inc. which has SAS licensed software. However, you have been asked to use specific SAS
engine while working on the data set, why?

 : : You are working in a company named Acmeshell Inc. which has SAS licensed software. However, you have been asked to use specific SAS
1. Because any temporary files created by the SAS will depend on this engine.

2. You may have to use specific files generated in Acmeshell needs to be read by SAS

3. It will make sure that you will be always using the latest version of the SAS software

4. It will specify the file format for files that will be stored in the library.



Question : The contents of the raw data file SIZE are listed below:

--------10-------20-------30
72 95
The following SAS program is submitted:
data test;
infile 'size';
input @1 height 2. @4 weight 2;
run;
Which one of the following is the value of the variable WEIGHT in the output data set?



 : The contents of the raw data file SIZE are listed below:
1. 2
2. 72
3. 95
4. . (missing numeric value)



Question : A SAS PRINT procedure output of the WORK.LEVELS data set is listed below:
Obs name level
1 Frank 1
2 Joan 2
3 Sui 2
4 Jose 3
5 Burt 4
6 Kelly .
7 Juan 1
The following SAS program is submitted:
data work.expertise;
set work.levels;
if level = . then
expertise = 'Unknown';
else if level = 1 then
expertise = 'Low';
else if level = 2 or 3 then
expertise = 'Medium';
else
expertise = 'High';
run;
Which of the following values does the variable EXPERTISE contain?
 :  A SAS PRINT procedure output of the WORK.LEVELS data set is listed below:
1. Low, Medium, and High only
2. Low, Medium, and Unknown only
3. Low, Medium, High, and Unknown only
4. Low, Medium, High, Unknown, and ' ' (missing character value)


Question : The contents of the raw data file EMPLOYEE are listed below:

--------10-------20-------30
Ruth 39 11
Jose 32 22
Sue 30 33
John 40 44
The following SAS program is submitted:
data test;
infile 'employee';
input employee_name $ 1-4;
if employee_name = 'Ruth' then input idnum 10-11;
else input age 7-8;
run;
Which one of the following values does the variable IDNUM contain when the name of the employee is "Ruth"?
 :  The contents of the raw data file EMPLOYEE are listed below:
1. 11
2. 22
3. 32
4. . (missing numeric value)


Question : The contents of the raw data file EMPLOYEE are listed below:

--------10-------20-------30
Ruth 39 11
Jose 32 22
Sue 30 33
John 40 44
The following SAS program is submitted:
data test;
infile 'employee';
input employee_name $ 1-4;
if employee_name = 'Sue' then input age 7-8;
else input idnum 10-11;
run;
Which one of the following values does the variable AGE contain when the name of the employee is "Sue"?


 :  The contents of the raw data file EMPLOYEE are listed below:
1. 30
2. 33
3. 40
4. . (missing numeric value)