



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A compilation of sas training questions and their correct answers, rated a+. It covers essential concepts such as data steps, proc steps, global statements, and various procedures like proc contents, proc freq, proc univariate, and proc sql. The questions address common errors, data manipulation techniques, and data summarization methods, making it a valuable resource for learning and reinforcing sas programming skills. It also includes practical tips and explanations to enhance understanding and application of sas concepts. Useful for university students.
Typology: Exams
1 / 5
This page cannot be seen from the preview
Don't miss anything!




Error 180-322: Statement is not valid or it is used out of proper order - correct answer โโ Probably means you forgot a semicolon at the end of a statement 3 types of steps in SAS program - correct answer โโ DATA step, PROC step, and Global statements DATA step - correct answer โโ creates a dataset and manipulates data as desired PROC step - correct answer โโ Reads a SAS dataset and performs some canned procedure Global statements - correct answer โโ indicates some options or directive to be accessible during a future DATA or PROC step set statement - correct answer โโ reads in an existing data set to a DATA step run; - correct answer โโ used to end a step for each and every row, SAS repeats the execution of every line of code in a DATA step - correct answer โโ jsyk
When you define a dataset in SAS without specifying a library it gets stored in a temporary library called WORK - correct answer โโ So set NFL_Census; is the same statement as set WORK.NFL_Census; Creating a library - correct answer โโ libname CONGRESS '/nas/igarc04/work/ew21/users/tlawt'; commenting in SAS - correct answer โโ /* comment */ Always click rename columns to comply with SAS naming conventions when importing data - correct answer โโ jsyk PROC CONTENTS data=datasetname; - correct answer โโ shows number of records/observations in data set, number of variables in data set and list of variables in data set. PROC FREQ data=datasetname; tables variable variable etc. ; run; - correct answer โโ shows the number of records corresponding to each value of the variables you are interested in. (Just put semicolon after the last variable) In proc FREQ if you set tables
var2); run; - correct answer โโ this will remove var1 and var2 from the dataset KEEP chooses which variables to keep and is implemented similarly DATA datasetname; set orig_dataset; if missing(var1) = 1 then delete; run; - correct answer โโ this will remove all records where there is a missing value for var1. The log tab will tell you how many records you removed. PROC SORT data=datasetname; by var1; run; - correct answer โโ sorts the specified data set by var PROC SUMMARY data=datasetname; by var1; output out = summarized_datasetname; sum(var2) = sum_var; run; - correct answer โโ Will return a summary of the dataset including the created variable of sum_var. The dataset must be sorted first. By default, will output the number of observations of the variable you are aggregating by. proc sql; select variable_u_want_to_summarize_by, sum(variable_to_sum) as optional_name
avg(varialbe_to_average) as name from dataset_i_want_to_summarize group by variable_u_want_to_summarize_by; quit; - correct answer โโ Used for aggregating/summarizing data similar to PROC SORT followed by PROC SUMMARY. proc sql; create table data_with_added_fields as select a.*,b.added_field from original_dataset a left join another_dataset b on a.var_to_merge_on = b.var_to_merge_on; quit; - correct answer โโ taking added field from b and showing it as an extra column for a sorted by var_to_merge_on. puts it all in the created table. Kind of like what you thought merge should do for R.