Top 100+ Sas Programming Interview Questions And Answers
Question 1. Describe five Ways To Do A "table Lookup" In Sas?
Answer :
Match Merging,
Direct Access,
Format Tables,
Arrays,
PROC SQL.
Question 2. What Are Some Good Sas Programming Practices For Processing Very Large Data Sets?
Answer :
Sampling method the use of OBS option or subsetting, commenting the Lines, Use Data Null.
Logistics Interview Questions
Question three. Under What Circumstances Would You Code A Select Construct Instead Of If Statements?
Answer :
I suppose Select statement is used whilst you are the usage of one situation to evaluate with severalconditions like.
Data exam;
Set exam;
pick out (skip);
while Physics gt 60;
when math gt 100;
whilst English eq 50;
otherwise fail;
run;
Question four. What Is The One Statement To Set The Criteria Of Data That Can Be Coded In Any Step?
Answer :
Options assertion.
SASS (Syntactically Awesome Style sheets) Tutorial
Question five. What Is The Effect Of The Options Statement Errors=1?
Answer :
The –ERROR- variable has a price of one if there may be an mistakes within the facts for that statement and zero if it is not.
SAS Programming,SQL server Interview Questions
Question 6. What Do The Sas Log Messages "numeric Values Have Been Converted To Character" Mean? What Are The Implications?
Answer :
It means that automatic conversion took place to make character functions feasible.
Question 7. Why Is A Stop Statement Needed For The Point= Option On A Set Statement?
Answer :
Because POINT= reads most effective the required observations, SAS can't discover an end-of-file circumstance as it would if the file have been being examine sequentially.
R Programming language Tutorial Clinical SAS Interview Questions
Question 8. How Do You Control The Number Of Observations And/or Variables Read Or Written?
Answer :
FIRSTOBS and OBS option.
Question 9. Approximately What Date Is Represented By The Sas Date Value Of 730?
Answer :
INPUT, DATA and RUN.
SASS (Syntactically Awesome Style sheets) Interview Questions
Question 10. Does Sas 'translate' (collect) Or Does It 'interpret'?
Answer :
Compile.
Question 11. What Does The Run Statement Do?
Answer :
When SAS editor looks at Run it starts offevolved compiling the data or proc step, if you have a couple of information step or proc step or when you have a proc step. Following the records step then you may keep away from using the run declaration.
SQL Server Analysis Services (SSAS) Interview Questions
Question 12. Why Is Sas Considered Self-documenting?
Answer :
SAS is taken into consideration self documenting because in the course of the compilation time it creates and shops all the facts about the statistics set like the time and date of the statistics set creation later No. Of the variables later labels all that type of info inside the dataset and you could observe that information using proc contents process.
Logistics Interview Questions
Question thirteen. What Is The Different Between Functions And Procs That Calculate Thesame Simple Descriptive Statistics?
Answer :
Functions can used inside the facts step and at the same facts set but with proc's you could create a new data sets to output the consequences.
Question 14. What Is A Method For Assigning First.Var And Last.Var To The By Groupvariable On Unsorted Data?
Answer :
In unsorted information you can not use First. Or Last.
Question 15. How Do You Debug And Test Your Sas Programs?
Answer :
First factor is check out Log for mistakes or warning or NOTE in a few cases or use the debugger in SAS information step.
R Programming language Interview Questions
Question 16. What Areas Of Sas Are You Most Interested In?
Answer :
BASE, STAT, GRAPH, ETSBriefly.
Question 17. What Versions Of Sas Have You Used (on Which Platforms)?
Answer :
SAS nine.1.Three,9.Zero, 8.2 in Windows and UNIX, SAS 7 and 6.12.
SAS DI Interview Questions
Question 18. What Are Some Problems You Might Encounter In Processing Missing Values? In Data Steps? Arithmetic? Comparisons? Functions? Classifying Data?
Answer :
The result of any operation with lacking fee will bring about lacking cost. Most SAS statistical techniques exclude observations with any missing variable values from an evaluation.
SAS Programming,SQL server Interview Questions
Question 19. How Would You Create A Data Set With 1 Observation And 30 Variables From A Data Set With 30 Observations And 1 Variable?
Answer :
Using PROC TRANSPOSE.
Question 20. What Is The Different Between Functions And Procs That Calculate The Same Simple Descriptive Statistics?
Answer :
Proc can be used with wider scope and the outcomes can be sent to a exceptional dataset. Functions commonly affect the present datasets.
Advanced SAS Interview Questions
Question 21. If You Were Told To Create Many Records From One Record, Show How You Would Do This Using Array And With Proc Transpose?
Answer :
Declare array for variety of variables inside the record and then used Do loop Proc Transpose with VAR declaration.
Question 22. What Are _numeric_ And _character_ And What Do They Do?
Answer :
Will both examine or writes all numeric and man or woman variables in dataset.
Question 23. How Would You Create Multiple Observations From A Single Observation?
Answer :
Using double Trailing @@.
Base Sas Interview Questions
Question 24. For What Purpose Would You Use The Retain Statement?
Answer :
The maintain statement is used to preserve the values of variables throughout iterations of the records step. Normally, all variables within the data step are set to lacking on the begin of every new release of the records step. What is the order of assessment of the comparison operators: + - * / ** ()?A) (), **, *, /, +, -.
Clinical SAS Interview Questions
Question 25. How Could You Generate Test Data With No Input Data?
Answer :
Using Data Null and put announcement.
Question 26. What Can You Learn From The Sas Log When Debugging?
Answer :
It will display the execution of complete application and the common sense. It will also show the mistake with line variety so that you can and edit this system.
SAS Macro Interview Questions
Question 27. What Is The Purpose Of _error_?
Answer :
It has handiest to values, that are 1 for mistakes and 0 for no blunders.
SASS (Syntactically Awesome Style sheets) Interview Questions
Question 28. How Can You Put A "trace" In Your Program?
Answer :
By the usage of ODS TRACE ON.
Question 29. How Does Sas Handle Missing Values In: Assignment Statements, Functions, A Merge, An Update, Sort Order, Formats, Procs?
Answer :
Missing values may be assigned as missing in Assignment declaration. Sort order treats missing as 2d smallest accompanied via underscore.
Clinical Data Management Interview Questions
Question 30. How Do You Test For Missing Values?
Answer :
Using Subset capabilities like IF then Else, Where and Select.
Question 31. How Are Numeric And Character Missing Values Represented Internally?
Answer :
Character as Blank or and Numeric as.
Question 32. Which Date Functions Advances A Date Time Or Date/time Value By A Given Interval?
Answer :
INTNX.
Question 33. In The Flow Of Data Step Processing, What Is The First Action In A Typical Data Step?
Answer :
When you put up a DATA step, SAS tactics the DATA step and then creates a new SAS information set.( introduction of enter buffer and PDV)
Compilation Phase
Execution Phase.
SQL Server Analysis Services (SSAS) Interview Questions
Question 34. What Are Sas/get right of entry to And Sas/connect?
Answer :
SAS/Access only method through the databases like Oracle, SQL-server, Ms-Access and so on.
SAS/Connect handiest use Server connection.
Question 35. What Is The Purpose Of Using The N=playstation Option?
Answer :
The N=PS alternative creates a buffer in memory that is big sufficient to shop PAGESIZE (PS) traces and enables a web page to be formatted randomly previous to it being published.
Question 36. What Are The Scrubbing Procedures In Sas?
Answer :
Proc Sort with nodupkey choice, because it will cast off the reproduction values.
R Programming language Interview Questions
Question 37. What Are The New Features Included In The New Version Of Sas I.E., Sas9.1.Three?
Answer :
The major gain of model 9 is quicker execution of packages and centralized get right of entry to of data and aid.
There are masses of changes has been made inside the version 9 when we compared with the model eight. The following are the few:
SAS version 9 helps Formats longer than 8 bytes & is not feasible with version 8.
Length for Numeric format allowed in model nine is 32 where as 8 in model eight.
Length for Character names in version 9 is 31 wherein as in version eight is 32.
Length for numeric informat in model 9 is 31, eight in version 8.
Length for person names is 30, 32 in model 8.Three new informats are available in version 9 to transform numerous date, time and datetime forms of information right into a SAS date or SAS time.
ANYDTDTEW. - Converts to a SAS date cost
ANYDTTMEW. - Converts to a SAS time cost.
ANYDTDTMW. -Converts to a SAS datetime price.CALL SYMPUTX Macro assertion is introduced within the model nine which creates a macro variable at execution time inside the data step by means of
Trimming trailing blanks
Automatically converting numeric value to character.
New ODS alternative (COLUMN OPTION) is included to create a more than one columns inside the output.
Question 38. What Differrence Did You Find Among Version 6 eight And 9 Of Sas?
Answer :
The SAS nine Architecture is essentially extraordinary from any prior version of SAS. In the SAS 9 structure, SAS is based on a new component, the Metadata Server, to offer an data layer between the applications and the data they get entry to. Metadata, such as security permissions for SAS libraries and in which the numerous SAS servers are strolling, are maintained in a common repository.
Question 39. What Has Been Your Most Common Programming Mistake?
Answer :
Missing semicolon and no longer checking log after filing software, Not the use of debugging techniques and now not the use of Fsview choice vigorously.
Question forty. Name Several Ways To Achieve Efficiency In Your Program?
Answer :
Efficiency and performance strategies may be categorised into 5 specific areas.
•CPU time
•Data Storage
• Elapsed time
• Input/Output
• Memory CPU Time and Elapsed Time- Base line measurements.
SAS DI Interview Questions
Question 41. What Other Sas Products Have You Used And Consider Yourself Proficient In Using?
Answer :
Data _NULL_ declaration, Proc Means, Proc Report, Proc tabulate, Proc freq and Proc print, Proc Univariate and so on.
Question 42. What Is The Significance Of The 'of' In X=sum (of A1-a4, A6, A9);
Answer :
If don’t use the OF function it may not be interpreted as we anticipate. For instance the feature above calculates the sum of a1 minus a4 plus a6 and a9 and no longer the whole sum of a1 to a4 & a6 and a9. It is proper for suggest alternative additionally.
Advanced SAS Interview Questions
Question forty three. What Do The Put And Input Functions Do?
Answer :
INPUT characteristic converts person information values to numeric values.
EX: for INPUT: INPUT (source, informat).
PUT feature converts numeric values to person values.
For PUT: PUT (source, format).
Question 44. Which Date Function Advances A Date, Time Or Datetime Value By A Given Interval?
Answer :
INTNX: INTNX feature advances a date, time, or datetime price by way of a given c program languageperiod, and returns a date, time, or datetime value.
Ex: INTNX(c language,begin-from,quantity-of-increments,alignment)
INTCK: INTCK(c program languageperiod,start-of-length,give up-of-period) is an interval functioncounts the number of intervals among two supply SAS dates, Time and/or datetime.
DATETIME () returns the contemporary date and time of day.
DATDIF (sdate,edate,foundation): returns the range of days among two dates.
Question 45. What Do The Mod And Int Function Do? What Do The Pad And Dim Functions Do?
Answer :
MOD: Modulo is a consistent or numeric variable, the feature returns the reminder after numeric fee divided by using modulo.
INT: It returns the integer part of a numeric price truncating the decimal element.
PAD: it pads every file with blanks so that every one information traces have the same period. It is used within the INFILE announcement. It is useful only whilst lacking records occurs on the give up of the document.
CATX: concatenate person strings, eliminates main and trailing blanks and inserts separators.
SCAN: it returns a detailed phrase from a character price. Scan feature assigns a duration of two hundred to every goal variable.
SUBSTR: extracts a sub string and replaces individual values.Extraction of a substring:
Middleinitial=substr(middlename,1,1); Replacing man or woman values: substr (telephone,1,3)=’433’; If SUBSTR function is at the left side of a declaration, the feature replaces the contents of the person variable.
TRIM: trims the trailing blanks from the individual values.
SCAN vs. SUBSTR: SCAN extracts words inside a fee that is marked by using delimiters. SUBSTR extracts a portion of the value by using stating the precise area. It is fine used whilst we know the precise role of the sub string to extract from a person value.
Question forty six. How Might You Use Mod And Int On Numeric To Mimic Substr On Character Strings?
Answer :
The first argument to the MOD characteristic is a numeric, the second one is a non-zero numeric; the result is the the rest whilst the integer quotient of argument-1 is split by using argument-2. The INT function takes best one argument and returns the integer part of an argument, truncating the decimal portion. Note that the argument can be an expression.
DATA NEW ;
A = 123456 ;
X = INT( A/a thousand ) ;
Y = MOD( A, one thousand ) ;
Z = MOD( INT( A/one hundred ), a hundred ) ;
PUT A= X= Y= Z= ;
RUN ;
Result:
A=123456
X=123
Y=456
Z=34.
Question forty seven. In Array Processing, What Does The Dim Function Do?
Answer :
DIM: It is used to go back the range of elements inside the array. When we use Dim function we would need to re –specify the stop fee of an iterative DO declaration if u change the measurement of the array.
Question 48. How Would You Determine The Number Of Missing Or Nonmissing Values In Computations?
Answer :
To decide the number of missing values which might be excluded in a computation, use the NMISS characteristic.
Facts _null_;
m = . ;
y = 4 ;
z = 0 ;
N = N(m , y, z);
NMISS = NMISS (m , y, z);
run;
The above application outcomes in N = 2 (Number of non missing values) and NMISS = 1 (quantity of lacking values).
Question 49. Do You Need To Know If There Are Any Missing Values?
Answer :
Just use: missing_values=MISSING(field1,field2,field3);
This feature truly returns zero if there aren't any or 1 if there are missing values.If you want to recognize what number of missing values you have got then use num_missing=NMISS(field1,field2,field3);
You can also find the range of non-missing values with non_missing=N (field1,field2,field3);
Question 50. What Is The Difference Between: X=a+b+c+d; And X=sum (of A, B, C ,d);?
Answer :
Is every body thinking why you wouldn’t just use general=field1+field2+field3;
Question fifty one. First, How Do You Want Missing Values Handled?
Answer :
The SUM characteristic returns the sum of non-missing values. If you pick addition, you will get a lacking cost for the result if any of the fields are lacking. Which one is appropriate relies upon upon your wishes.However, there's a bonus to apply the SUM feature even in case you need the consequences to be lacking. If you have greater than a pair fields, you can regularly use shortcuts in writing the sector names If your fields are not numbered sequentially however are stored within the application information vector together then you could use: general=SUM(of fielda--zfield); Just make sure you don't forget the “of” and the double dashes or your code will run but you won’t get your meant results. Mean is another function wherein the function will calculate differently than the writing out the formulation when you have missing values.There is a area containing a date. It wishes to be displayed inside the format "ddmonyy" if it's before 1975, "dd mon ccyy" if it's after 1985, and as 'Disco Years' if it's among 1975 and 1985.
Question 52. What Is The Difference Between Calculating The 'imply' Using The Mean Function And Proc Means?
Answer :
By default Proc Means calculate the summary statistics like N, Mean, Std deviation, Minimum and maximum, Where as Mean function compute simplest the imply values.
Question 53. What Are Some Differences Between Proc Summary And Proc Means?
Answer :
Proc means by way of default come up with the output inside the output window and you may forestall this by using the choice NOPRINT and might take the output inside the separate record by the declaration OUTPUTOUT= , But, proc precis would not deliver the default output, we need to explicitly deliver the output announcement after which print the data by using giving PRINT choice to see the result.
Question 54. Which Data Set Is The Controlling Data Set In The Merge Statement?
Answer :
Dataset having the less number of observations manipulate the information set in the merge declaration.
Question fifty five. How Do The In= Variables Improve The Capability Of A Merge?
Answer :
The IN=variablesWhat if you want to keep within the output statistics set of a merge simplest the matches (simplest those observations to which both input information sets make contributions)? SAS will installation for you unique transient variables, known as the "IN=" variables, so you can do this and extra. Here's what you have to do: signal to SAS at the MERGE assertion that you need the IN= variables for the input data set(s) use the IN= variables inside the facts step appropriately, So to maintain handiest the fits inside the match-merge above, ask for the IN= variables and use them:records three;merge one(in=x) two(in=y); /* x & y are your selections of names */through identity; /* for the IN= variables for records */if x=1 and y=1; /* units one and respectively */run;
Question 56. What Techniques And/or Procs Do You Use For Tables?
Answer :
Proc Freq, Proc univariate, Proc Tabulate & Proc Report.
Question fifty seven. Do You Prefer Proc Report Or Proc Tabulate? Why?
Answer :
I favor to use Proc record till I must create cross tabulation tables, due to the fact, It offers me so many alternatives to alter the look up of my table, (ex: Width alternative, via this we can trade the width of each column inside the table) Where as Proc tabulate unable to provide some of the matters in my desk. Ex: tabulate doesn’t produce n (%) inside the perfect layout.
Question fifty eight. What Is The Difference Between Nodup And Nodupkey Options?
Answer :
NODUP compares all of the variables in our dataset while NODUPKEY compares just the BY variables.
Question 59. What Is The Main Difference Between Rename And Label?
Answer :
1. Label is worldwide and rename is nearby i.E., label declaration may be used both in proc or records step wherein as rename have to be used most effective in records step. 2. If we rename a variable, old name will be misplaced however if we label a variable its quick name (old name) exists along side its descriptive call.
Question 60. What Is Enterprise Guide? What Is The Use Of It?
Answer :
It is an approach to import textual content documents with SAS (It comes unfastened with Base SAS version nine.Zero).
Question 61. What Are Input Dataset And Output Dataset Options?
Answer :
Input records set options are obs, firstobs, where, in output facts set options compress, reuse.Both enter and output dataset options encompass keep, drop, rename, obs, first obs.
Question 62. How Can You Create Zero Observation Dataset?
Answer :
Creating a facts set by the use of the like clause.Ex: proc square;create table latha.Emp like oracle.Emp;cease;In this the like clause triggers the existing desk shape to be copied to the new desk. Using this technique bring about the creation of an empty table.
In the editor window we writep.Cinclude 'path of the sas record';run;if it's miles with non-windowing surroundings no need to present run statement.
Question sixty three. How Can You Import .Csv File In To Sas?
Answer :
To create CSV report, we need to open notepad, then, claim the variables.
Proc import datafile='E:age.Csv'
out=sarath dbms=csv update;
getnames=sure;
run;
Question sixty four. What Is The Use Of Proc Sql?
Answer :
PROC SQL is a effective tool in SAS, which combines the capability of data and proc steps. PROC SQL can kind, summarize, subset, join (merge), and concatenate datasets, create new variables, and print the effects or create a new dataset multi functional step! PROC SQL uses fewer assets when as compared to that of statistics and proc steps. To be part of documents in PROC SQL it does now not require to type the data previous to merging, which is should, is information merge.
Question sixty five. What Is Sas Graph?
Answer :
SAS/GRAPH software program creates and grants accurate, high-effect visuals that allow decision makers to benefit a short expertise of important commercial enterprise troubles.
Question 66. Why Is A Stop Statement Needed For The Point=option On A Set Statement?
Answer :
When you operate the POINT= option, you should consist of a STOP statement to stop DATA step processing, programming logic that assessments for an invalid price of the POINT= variable, or Both. Because POINT= reads handiest the ones observations which can be special inside the DO assertion, SAS can't study an give up-of-document indicator as it'd if the record were being read sequentially. Because analyzing an end-of-file indicator ends a DATA step automatically, failure to substitute some other manner of finishing the DATA step whilst you operate POINT= can motive the DATA step to go into a non-stop loop.

