Академический Документы
Профессиональный Документы
Культура Документы
FREQ;
ID;
2. Or, compare number of obs of original data set and data after
proc
SORT
nodups
or
is
that
proc SORT nodupkey
3. use first.ID in data step to write non-unique to separate data set
if first.ID and last.ID then output UNIQUE; else output DUPS;
What is SAS?
SAS is an integrated set of software products. The acronym stands for Statistical Analysis System
1.
What is a PDV?
A PDV or Program Data Vector is a logical area in the memory. SAS creates a database of one observation at a
time. At the time of compilation an input buffer is created which holds a record from and external file. The PDV is
created following this input buffer creation.
1.
Question: What would be the result of following SAS function(given that 31 Dec, 2000 is Sunday)?
Weeks = intck (week,31 dec 2000d,01jan2001d);
Years = intck (year,31 dec 2000d,01jan2001d);
Months = intck (month,31 dec 2000d,01jan2001d);
Answer: Weeks=0, Years=1,Months=1
Question: Give some example where PROC REPORTs defaults are different than PROC
PRINTs defaults?
Answer:
Question: What is the difference between Order and Group variable in proc report?
Answer:
If the variable is used as group variable, rows that have the same values are collapsed.
Group variables produce list report whereas order variable produces summary report.
Question: Give some ways by which you can define the variables to produce the summary
report (using proc report)?
Computed variables.
Question: What is the difference between CLASS statement and BY statement in proc
means?
Answer:
Unlike CLASS processing, BY processing requires that your data already be sorted or
BY group results have a layout that is different from the layout of CLASS group results.
If you were told to create many records from one record, show how you would do this
using arrays and with PROC TRANSPOSE?
A) I would use TRANSPOSE if the variables are less use arrays if the var are more .................
depends
What is the different between functions and PROCs that calculate thesame simple
descriptive statistics?
A) Functions can used inside the data step and on the same data set but with proc's you can
create a new data sets to output the results.
What is the different between functions and PROCs that calculate the same simple
descriptive statistics?
A) Proc can be used with wider scope and the results can be sent to a different dataset.
Functions usually affect the existing datasets.
If you were told to create many records from one record, show how you would do this
using array and with PROC TRANSPOSE?
A) Declare array for number of variables in the record and then used Do loop Proc Transpose
with VAR statement
Which date functions advances a date time or date/time value by a given interval?
A) INTNX.
What are SAS/ACCESS and SAS/CONNECT?
A) SAS/Access only process through the databases like Oracle, SQL-server, Ms-Access etc.
SAS/Connect only use Server connection.
What is the one statement to set the criteria of data that can be coded in any step?
A) OPTIONS Statement, Label statement, Keep / Drop statements.
What is the purpose of using the N=PS option?
A) The N=PS option creates a buffer in memory which is large enough to store PAGESIZE (PS)
lines and enables a page to be formatted randomly prior to it being printed.
Which date function advances a date, time or datetime value by a given interval?
INTNX:
INTNX function advances a date, time, or datetime value by a given interval, and returns a
date, time, or datetime value. Ex: INTNX(interval,start-from,number-ofincrements,alignment)
INTCK: INTCK(interval,start-of-period,end-of-period) is an interval functioncounts the
number of intervals between two give SAS dates, Time and/or datetime.
DATETIME () returns the current date and time of day.
DATDIF (sdate,edate,basis): returns the number of days between two dates.
What is the difference between calculating the 'mean' using the mean function and
PROC MEANS?
A) By default Proc Means calculate the summary statistics like N, Mean, Std deviation,
Minimum and maximum, Where as Mean function compute only the mean values.
Which data set is the controlling data set in the MERGE statement?
A) Dataset having the less number of observations control the data set in the merge
statement.
Do you prefer PROC REPORT or PROC TABULATE? Why?
A) I prefer to use Proc report until I have to create cross tabulation tables, because, It gives
me so many options to modify the look up of my table, (ex: Width option, by this we can
change the width of each column in the table) Where as Proc tabulate unable to produce
some of the things in my table. Ex: tabulate doesnt produce n (%) in the desirable format.
What is the difference between nodup and nodupkey options?
A) NODUP compares all the variables in our dataset while NODUPKEY compares just the
BY variables.
What is the main difference between rename and label?
A) 1. Label is global and rename is local i.e., label statement can be used either in proc or
data step where as rename should be used only in data step. 2. If we rename a variable, old
name will be lost but if we label a variable its short name (old name) exists along with its
descriptive name.
What is Enterprise Guide? What is the use of it?
A) It is an approach to import text files with SAS (It comes free with Base SAS version 9.0)
What are input dataset and output dataset options?
A) Input data set options are obs, firstobs, where, in output data set options compress,
reuse.Both input and output dataset options include keep, drop, rename, obs, first obs.
How can u create zero observation dataset?
A) Creating a data set by using the like clause.ex: proc sql;create table latha.emp like
oracle.emp;quit;In this the like clause triggers the existing table structure to be copied to the
new table. using this method result in the creation of an empty table.
How can u import .CSV file in to SAS? tell Syntax?
A) To create CSV file, we have to open notepad, then, declare the variables.
proc import datafile='E:\age.csv'
out=sarath dbms=csv replace;
getnames=yes;
run;
What is the use of Proc SQl?
A) PROC SQL is a powerful tool in SAS, which combines the functionality of data and proc
steps. PROC SQL can sort, summarize, subset, join (merge), and concatenate datasets,
create new variables, and print the results or create a new dataset all in one step! PROC
SQL uses fewer resources when compard to that of data and proc steps. To join files in
PROC SQL it does not require to sort the data prior to merging, which is must, is data
merge.
What is SAS GRAPH?
A) SAS/GRAPH software creates and delivers accurate, high-impact visuals that enable
decision makers to gain a quick understanding of critical business issues.
Answer :%Put statement is similar to the PUT statement in data step, What it does is it
writes text and values of macro variable after execution to the SAS System LOG. If you
want to make sure your macro variable resolves as expected, you can make sure it with
%PUT statement.
Unique advantage of %PUT over PUT is you can use %PUT outside the data step
whereas you cannot with PUT.
Question :
Answer :
Answer :
The program data vector (PDV) is a logical block of data that contains the variables used
in a data step or proc step. Variables are added to the program data vector in order of
appearance, and this is what determines their position (or variable number) attribute.
The drastic differences in syntax between a proc step and a macro call