SAS Quiz(100% New And Real Time Questions)

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Pythonlearn20160
P
Pythonlearn20160
Community Contributor
Quizzes Created: 1 | Total Attempts: 486
| Attempts: 486 | Questions: 20
Please wait...
Question 1 / 20
0 %
0/100
Score 0/100
1.   PRIMARY KEY  is the type of integrity constraint you  would place on the variable StoreID to ensure that there are no missing values and that there are no duplicate values ?

Explanation

The primary key is a type of integrity constraint that ensures the uniqueness and non-nullability of a column. By applying the primary key constraint on the variable StoreID, it guarantees that there are no missing values (non-nullability) and no duplicate values (uniqueness). This constraint is commonly used to uniquely identify each row in a table and enforce data integrity. Therefore, the given answer of "True" is correct.

Submit
Please wait...
About This Quiz
SAS Quizzes & Trivia

This SAS quiz features real-time questions assessing skills in data handling, debugging, and SQL operations within SAS. It is designed for learners seeking to test and enhance their... see moreproficiency in SAS programming, ensuring readiness for practical applications in data analysis. see less

2. Which of the following will create the output as shown in figure?

Explanation

The correct answer is "%PUT _ALL_;" because the "%PUT _ALL_;" statement is used to display all the automatic macro variables and their values in the SAS log. In this case, it will display the value of the macro variable AUTOMATIC.

Submit
3.    %let a= 10;   %let b= 9;   %let c= %sysevalf(&a/ &b);   %put &c; What is written to SAS Log ?

Explanation

The macro variable C resolves to 1.11111 because the %sysevalf function is used to perform a floating-point division of the values of macro variables a and b. The result of the division is 1.11111, which is then assigned to the macro variable C. This value is then printed to the SAS Log using the %put statement.

Submit
4. Given the following program, What is the point value of "henry" in the dataset two ?data two;array score{2,4} _temporary_(40,50,60,70,40,50,60,70);set work.one;Points=score{hour,rating};run;

Explanation

The program is creating an array called "score" with dimensions 2x4 and initializing it with values 40, 50, 60, and 70. Then, it is using the "set" statement to read data from a dataset called "work.one". Finally, it is assigning the value of "score{hour,rating}" to the variable "Points". Since the array "score" has 2 rows and 4 columns, the expression "score{hour,rating}" is accessing the value at the intersection of the "hour" row and the "rating" column, which is 60.

Submit
5. What does an FLOW OVER option do in an ODS Statement ?

Explanation

The FLOW OVER option in an ODS Statement moves the output pointer to a new line if a PUT statement attempts to write an item beyond the last ODS column in the buffer. This means that if the output exceeds the available space in the current line, it will automatically wrap to the next line, ensuring that the output is properly displayed without any truncation or loss of data.

Submit
6. Below two datasets ONE and TWO are submitted.DATA ONE;INPUT EMPID EMP_NAME$;DATALINES;10 JACK20 JONE30 GILT39 HENRY55 ROCK;RUN;DATA TWO;INPUT EMPD EMP_NAME$;DATALINES;10 HENRY34 NOSY55 JOHN24 REMO;RUN;which of the following will the create output dataset THREE?

Explanation

The correct answer is "PROC SQL; CREATE TABLE THREE AS SELECT * FROM ONE OUTER UNION SELECT * FROM TWO; QUIT;". This code will create an output dataset named THREE using the SQL procedure. It will combine the datasets ONE and TWO using the OUTER UNION operator, which will include all rows from both datasets, including any duplicates. The SELECT * statement is used to select all columns from both datasets, and the resulting dataset will contain all the columns from both datasets.

Submit
7. If you store a macro definition in a SAS catalog SOURCE entry 

Explanation

Storing a macro definition in a SAS catalog SOURCE entry allows you to use FILENAME and %INCLUDE statements for compiling the macro. This means that you can include the macro definition in your program using the %INCLUDE statement, and the macro will be compiled and available for use. The FILENAME statement is used to specify the location of the macro definition in the SAS catalog. This allows for easy access and compilation of the macro without the need to manually compile it before invoking it in a program.

Submit
8. Given two sas datasets class1 and class2;data class1;input name$ rank exams;datalines;Alice 4 1Carol 2 1Henry 3 1James 1 2Janet 2 2louis 3 2leani 4 2;run;data class2;input name$ rank exams;datalines;Barbara 1 1Jeffrey 5 1William 5 2;run;which of the following will produce the given output?

Explanation

The correct answer is "proc sql; select * from class1 union select * from class2 order by exams; quit;". This query combines the data from both class1 and class2 datasets using the UNION operator and sorts the result by the exams column. The UNION operator eliminates duplicate rows from the result set.

Submit
9. The following SAS program is submitted.%let city=delhi;%let no=9;%let mycity=no;%let country=mycity;%put &&&&&&&country;What is written to the SAS log? 

Explanation

The SAS program defines macro variables using the %let statement. The macro variable "city" is assigned the value "delhi", the macro variable "no" is assigned the value "9", the macro variable "mycity" is assigned the value "no", and the macro variable "country" is assigned the value "mycity". The %put statement is used to write the value of the macro variable "&country" to the SAS log. Since "&country" resolves to "mycity", the value "9" is written to the SAS log.

Submit
10. Which of the following macro variable resolves to Joan's Report

Explanation

The correct answer is "%let text=%bquote(Joan's Report);" because the %bquote function is used to mask special characters in a macro variable value. In this case, the single quote in "Joan's Report" is masked using %bquote, so the macro variable resolves to "Joan's Report" without any syntax errors.

Submit
11. Which statement is false regarding the keyword CORRESPONDING? 

Explanation

The keyword CORRESPONDING can be used with the keyword ALL.

Submit
12. Which of the following will direct SAS to ignore all indexes in the following procedure

Explanation

The correct answer is "proc sql; Select * from sasuser.cars (idxwhere=no) where speed > 150 ; Quit;". This is because the "idxwhere=no" option in the PROC SQL statement tells SAS to ignore all indexes when executing the query.

Submit
13. %let summit= brics2016;Which one of the following statements stores the value brics in the macro variable summitname?

Explanation

The correct answer is %let summitname= %substr(&summit,1,%length(&summit)-4). This statement uses the %substr function to extract a substring from the macro variable summit. It starts at the first character and goes up to the length of the variable minus 4, effectively removing the last 4 characters from the value of summit. The resulting substring is then stored in the macro variable summitname.

Submit
14. Given the following datasets class1,class2 and class3data class1;input name$ id bus_no fee_status$;datalines;Alice 9 1 YCarol 8 1 Y;run;data class2;input name$ id bus_no fee_status$;datalines;Barbara 1 1 YJeffrey 5 2 N;run;data class3;input name$ id bus_no fee_status$;datalines;Judy 4 2 NMary 3 2 Y;run;

Explanation

The correct answer is "Data work.class; Set class1 class2 class3; Where id >5; Run;". This is the correct answer because it uses the SET statement to combine the datasets class1, class2, and class3 into a single dataset called work.class. The WHERE statement is then used to filter the observations, only selecting those where the id variable is greater than 5. Finally, the RUN statement is used to execute the data step and create the new dataset.

Submit
15. The following SAS program is submitted.data match; array balls{4,2}_temporary_ (10,20,30,40,50,60,70); runs= balls{4,2}; run;Which one of the following is the value of the variable runs in the data set match

Explanation

The variable "runs" is assigned the value of the element in the array "balls" with indexes 4 and 2, which is NULL/BLANK.

Submit
16. Given two sas datasets class1 and class2;data class1;input name$ rank exams;datalines;Alice 4 1Carol 2 1Henry 3 1James 1 2Janet 2 2louis 3 2leani 4 2;run;data class2;input name$ rank exams;datalines;Barbara 1 1Jeffrey 5 1William 5 2;run;which of the following will produce the given output?

Explanation

not-available-via-ai

Submit
17. Which of the following is a debugging technique in PROC SQL 

Explanation

FEEDBACK is a debugging technique in PROC SQL that provides information about the execution of the SQL statements. It displays messages in the SAS log, allowing the programmer to identify and correct any errors or issues in the SQL code. VALIDATE is another debugging technique in PROC SQL that checks the syntax and semantics of the SQL statements without actually executing them. It helps in identifying any errors or inconsistencies in the code before running the SQL queries.

Submit
18. The SAS data set ONE contains the variables P,Q,R and S.The following SAS program is submitted:Proc transpose data =oneOut=transName=new;By P;var Q;run;

Explanation

The SAS program is using the PROC TRANSPOSE statement to restructure the data set ONE. The BY statement is used to group the observations by the variable P. The VAR statement specifies that only variable Q should be transposed. The resulting transposed data set, named new, will contain the variables P and COL1 only.

Submit
19. Suppose we have a dataset named CLASS with four variables NAME, GENDER, SEX and CLASS. Which of the following will create an index on GENDER and CLASS.

Explanation

The correct answer is "Proc sql; Create unique index daily on work.CLASS (GENDER, CLASS) ;". This statement creates a unique index named "daily" on the dataset "CLASS" in the "work" library, with the index key variables as "GENDER" and "CLASS". This means that the index will be created based on the values of these two variables, allowing for faster data retrieval and improved performance when querying the dataset based on these variables.

Submit
20. Which SQL procedure program deletes rows from the data set CLASS ?

Explanation

The correct answer is "proc sql; delete from newdata.class Where age". This SQL procedure program uses the "delete" statement to remove rows from the data set "CLASS" where the condition "age" is met.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 20, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 20, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Aug 07, 2016
    Quiz Created by
    Pythonlearn20160
Cancel
  • All
    All (20)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
  PRIMARY KEY  is the type of integrity constraint you...
Which of the following will create the output as shown in figure?
   %let a= 10;   %let b= 9;   %let c=...
Given the following program, What is the point value of "henry" in the...
What does an FLOW OVER option do in an ODS Statement ?
Below two datasets ONE and TWO are submitted.DATA ONE;INPUT EMPID...
If you store a macro definition in a SAS catalog SOURCE entry 
Given two sas datasets class1 and class2;data class1;input name$ rank...
The following SAS program is submitted.%let city=delhi;%let no=9;%let...
Which of the following macro variable resolves to Joan's Report
Which statement is false regarding the keyword CORRESPONDING? 
Which of the following will direct SAS to ignore all indexes in the...
%let summit= brics2016;Which one of the following statements stores...
Given the following datasets class1,class2 and class3data class1;input...
The following SAS program is submitted.data match; array...
Given two sas datasets class1 and class2;data class1;input name$ rank...
Which of the following is a debugging technique in PROC SQL 
The SAS data set ONE contains the variables P,Q,R and S.The following...
Suppose we have a dataset named CLASS with four variables NAME,...
Which SQL procedure program deletes rows from the data set CLASS ?
Alert!

Advertisement