SAS Programming Interview Questions & Answers

  1. Question 1. Describe 5 Ways To Do A “table Lookup” In Sas?

    Answer :

    • Match Merging,
    • Direct Access,
    • Format Tables,
    • Arrays,
    • PROC SQL.
  2. Question 2. What Are Some Good Sas Programming Practices For Processing Very Large Data Sets?

    Answer :

    Sampling method using OBS option or subsetting, commenting the Lines, Use Data Null.

  3. Logistics Interview Questions

  4. Question 3. Under What Circumstances Would You Code A Select Construct Instead Of If Statements?

    Answer :

    I think Select statement is used when you are using one condition to compare with severalconditions like.
    Data exam;
    Set exam;
    select (pass);
    when Physics gt 60;
    when math gt 100;
    when English eq 50;
    otherwise fail;
    run;

  5. Question 4. What Is The One Statement To Set The Criteria Of Data That Can Be Coded In Any Step?

    Answer :

    Options statement.

  6. SASS (Syntactically Awesome Style sheets) Tutorial

  7. Question 5. What Is The Effect Of The Options Statement Errors=1?

    Answer :

    The –ERROR- variable has a value of 1 if there is an error in the data for that observation and 0 if it is not.

  8. SAS Programming,SQL server Interview Questions

  9. Question 6. What Do The Sas Log Messages “numeric Values Have Been Converted To Character” Mean? What Are The Implications?

    Answer :

    It implies that automatic conversion took place to make character functions possible.

  10. Question 7. Why Is A Stop Statement Needed For The Point= Option On A Set Statement?

    Answer :

    Because POINT= reads only the specified observations, SAS cannot detect an end-of-file condition as it would if the file were being read sequentially.

  11. R Programming language Tutorial
    Clinical SAS Interview Questions

  12. Question 8. How Do You Control The Number Of Observations And/or Variables Read Or Written?

    Answer :

    FIRSTOBS and OBS option.

  13. Question 9. Approximately What Date Is Represented By The Sas Date Value Of 730?

    Answer :

    INPUT, DATA and RUN.

  14. SASS (Syntactically Awesome Style sheets) Interview Questions

  15. Question 10. Does Sas ‘translate’ (compile) Or Does It ‘interpret’?

    Answer :

    Compile.

  16. Question 11. What Does The Run Statement Do?

    Answer :

    When SAS editor looks at Run it starts compiling the data or proc step, if you have more than one data step or proc step or if you have a proc step. Following the data step then you can avoid the usage of the run statement.

  17. SQL Server Analysis Services (SSAS) Interview Questions

  18. Question 12. Why Is Sas Considered Self-documenting?

    Answer :

    SAS is considered self documenting because during the compilation time it creates and stores all the information about the data set like the time and date of the data set creation later No. of the variables later labels all that kind of info inside the dataset and you can look at that info using proc contents procedure.

  19. Logistics Interview Questions

  20. Question 13. What Is The Different Between Functions And Procs That Calculate Thesame Simple Descriptive Statistics?

    Answer :

    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.

  21. Question 14. What Is A Method For Assigning First.var And Last.var To The By Groupvariable On Unsorted Data?

    Answer :

    In unsorted data you can’t use First. or Last.

  22. Question 15. How Do You Debug And Test Your Sas Programs?

    Answer :

    First thing is look into Log for errors or warning or NOTE in some cases or use the debugger in SAS data step.

  23. R Programming language Interview Questions

  24. Question 16. What Areas Of Sas Are You Most Interested In?

    Answer :

    BASE, STAT, GRAPH, ETSBriefly.

  25. Question 17. What Versions Of Sas Have You Used (on Which Platforms)?

    Answer :

    SAS 9.1.3,9.0, 8.2 in Windows and UNIX, SAS 7 and 6.12.

  26. SAS DI Interview Questions

  27. 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 missing value will result in missing value. Most SAS statistical procedures exclude observations with any missing variable values from an analysis.

  28. SAS Programming,SQL server Interview Questions

  29. 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.

  30. 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 results can be sent to a different dataset. Functions usually affect the existing datasets.

  31. Advanced SAS Interview Questions

  32. 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 number of variables in the record and then used Do loop Proc Transpose with VAR statement.

  33. Question 22. What Are _numeric_ And _character_ And What Do They Do?

    Answer :

    Will either read or writes all numeric and character variables in dataset.

  34. Question 23. How Would You Create Multiple Observations From A Single Observation?

    Answer :

    Using double Trailing @@.

  35. Base Sas Interview Questions

  36. Question 24. For What Purpose Would You Use The Retain Statement?

    Answer :

    The retain statement is used to hold the values of variables across iterations of the data step. Normally, all variables in the data step are set to missing at the start of each iteration of the data step. What is the order of evaluation of the comparison operators: + – * / ** ()?A) (), **, *, /, +, -.

  37. Clinical SAS Interview Questions

  38. Question 25. How Could You Generate Test Data With No Input Data?

    Answer :

    Using Data Null and put statement.

  39. Question 26. What Can You Learn From The Sas Log When Debugging?

    Answer :

    It will display the execution of whole program and the logic. It will also display the error with line number so that you can and edit the program.

  40. SAS Macro Interview Questions

  41. Question 27. What Is The Purpose Of _error_?

    Answer :

    It has only to values, which are 1 for error and 0 for no error.

  42. SASS (Syntactically Awesome Style sheets) Interview Questions

  43. Question 28. How Can You Put A “trace” In Your Program?

    Answer :

    By using ODS TRACE ON.

  44. Question 29. How Does Sas Handle Missing Values In: Assignment Statements, Functions, A Merge, An Update, Sort Order, Formats, Procs?

    Answer :

    Missing values will be assigned as missing in Assignment statement. Sort order treats missing as second smallest followed by underscore.

  45. Clinical Data Management Interview Questions

  46. Question 30. How Do You Test For Missing Values?

    Answer :

    Using Subset functions like IF then Else, Where and Select.

  47. Question 31. How Are Numeric And Character Missing Values Represented Internally?

    Answer :

    Character as Blank or  and Numeric as.

  48. Question 32. Which Date Functions Advances A Date Time Or Date/time Value By A Given Interval?

    Answer :

    INTNX.

  49. Question 33. In The Flow Of Data Step Processing, What Is The First Action In A Typical Data Step?

    Answer :

    When you submit a DATA step, SAS processes the DATA step and then creates a new SAS data set.( creation of input buffer and PDV)
    Compilation Phase
    Execution Phase.

  50. SQL Server Analysis Services (SSAS) Interview Questions

  51. Question 34. What Are Sas/access And Sas/connect?

    Answer :

    SAS/Access only process through the databases like Oracle, SQL-server, Ms-Access etc.
    SAS/Connect only use Server connection.

  52. Question 35. What Is The Purpose Of Using The N=ps Option?

    Answer :

    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.

  53. Question 36. What Are The Scrubbing Procedures In Sas?

    Answer :

    Proc Sort with nodupkey option, because it will eliminate the duplicate values.

  54. R Programming language Interview Questions

  55. Question 37. What Are The New Features Included In The New Version Of Sas I.e., Sas9.1.3?

    Answer :

    The main advantage of version 9 is faster execution of applications and centralized access of data and support.

    There are lots of changes has been made in the version 9 when we compared with the version 8. The following are the few:

    • SAS version 9 supports Formats longer than 8 bytes & is not possible with version 8.
    • Length for Numeric format allowed in version 9 is 32 where as 8 in version 8.
    • Length for Character names in version 9 is 31 where as in version 8 is 32.
    • Length for numeric informat in version 9 is 31, 8 in version 8.

    Length for character names is 30, 32 in version 8.3 new informats are available in version 9 to convert various date, time and datetime forms of data into a SAS date or SAS time.

    • ANYDTDTEW. – Converts to a SAS date value
    • ANYDTTMEW. – Converts to a SAS time value.
    • ANYDTDTMW. -Converts to a SAS datetime value.CALL SYMPUTX Macro statement is added in the version 9 which creates a macro variable at execution time in the data step by
    • Trimming trailing blanks
    • Automatically converting numeric value to character.

    New ODS option (COLUMN OPTION) is included to create a multiple columns in the output.

  56. Question 38. What Differrence Did You Find Among Version 6 8 And 9 Of Sas?

    Answer :

    The SAS 9 Architecture is fundamentally different from any prior version of SAS. In the SAS 9 architecture, SAS relies on a new component, the Metadata Server, to provide an information layer between the programs and the data they access. Metadata, such as security permissions for SAS libraries and where the various SAS servers are running, are maintained in a common repository.

  57. Question 39. What Has Been Your Most Common Programming Mistake?

    Answer :

    Missing semicolon and not checking log after submitting program, Not using debugging techniques and not using Fsview option vigorously.

  58. Question 40. Name Several Ways To Achieve Efficiency In Your Program?

    Answer :

    Efficiency and performance strategies can be classified into 5 different areas.
    •CPU time
    •Data Storage
    • Elapsed time
    • Input/Output
    • Memory CPU Time and Elapsed Time- Base line measurements.

  59. SAS DI Interview Questions

  60. Question 41. What Other Sas Products Have You Used And Consider Yourself Proficient In Using?

    Answer :

    Data _NULL_ statement, Proc Means, Proc Report, Proc tabulate, Proc freq and Proc print, Proc Univariate etc.

  61. 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 might not be interpreted as we expect. For example the function above calculates the sum of a1 minus a4 plus a6 and a9 and not the whole sum of a1 to a4 & a6 and a9. It is true for mean option also.

  62. Advanced SAS Interview Questions

  63. Question 43. What Do The Put And Input Functions Do?

    Answer :

    INPUT function converts character data values to numeric values.
    EX: for INPUT: INPUT (source, informat).

    PUT function converts numeric values to character values.
    For PUT: PUT (source, format).

  64. Question 44. Which Date Function Advances A Date, Time Or Datetime Value By A Given Interval?

    Answer :

    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-of-increments,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.

  65. Question 45. What Do The Mod And Int Function Do? What Do The Pad And Dim Functions Do?

    Answer :

    MOD: Modulo is a constant or numeric variable, the function returns the reminder after numeric value divided by modulo.

    INT: It returns the integer portion of a numeric value truncating the decimal portion.

    PAD: it pads each record with blanks so that all data lines have the same length. It is used in the INFILE statement. It is useful only when missing data occurs at the end of the record.

    CATX: concatenate character strings, removes leading and trailing blanks and inserts separators.

    SCAN: it returns a specified word from a character value. Scan function assigns a length of 200 to each target variable.

    SUBSTR: extracts a sub string and replaces character values.Extraction of a substring:
    Middleinitial=substr(middlename,1,1); Replacing character values: substr (phone,1,3)=’433’; If SUBSTR function is on the left side of a statement, the function replaces the contents of the character variable.

    TRIM: trims the trailing blanks from the character values.

    SCAN vs. SUBSTR: SCAN extracts words within a value that is marked by delimiters. SUBSTR extracts a portion of the value by stating the specific location. It is best used when we know the exact position of the sub string to extract from a character value.

  66. Question 46. How Might You Use Mod And Int On Numeric To Mimic Substr On Character Strings?

    Answer :

    The first argument to the MOD function is a numeric, the second is a non-zero numeric; the result is the remainder when the integer quotient of argument-1 is divided by argument-2. The INT function takes only one argument and returns the integer portion of an argument, truncating the decimal portion. Note that the argument can be an expression.

    DATA NEW ;
    A = 123456 ;
    X = INT( A/1000 ) ;
    Y = MOD( A, 1000 ) ;
    Z = MOD( INT( A/100 ), 100 ) ;
    PUT A= X= Y= Z= ;
    RUN ;

    Result:
    A=123456
    X=123
    Y=456
    Z=34.

  67. Question 47. In Array Processing, What Does The Dim Function Do?

    Answer :

    DIM: It is used to return the number of elements in the array. When we use Dim function we would have to re –specify the stop value of an iterative DO statement if u change the dimension of the array.

  68. Question 48. How Would You Determine The Number Of Missing Or Nonmissing Values In Computations?

    Answer :

    To determine the number of missing values that are excluded in a computation, use the NMISS function.

    data _null_;
    m = . ;
    y = 4 ;
    z = 0 ;
    N = N(m , y, z);
    NMISS = NMISS (m , y, z);
    run;

    The above program results in N = 2 (Number of non missing values) and NMISS = 1 (number of missing values).

  69. Question 49. Do You Need To Know If There Are Any Missing Values?

    Answer :

    Just use: missing_values=MISSING(field1,field2,field3);
    This function simply returns 0 if there aren’t any or 1 if there are missing values.If you need to know how many missing values you have then use num_missing=NMISS(field1,field2,field3);
    You can also find the number of non-missing values with non_missing=N (field1,field2,field3);

  70. Question 50. What Is The Difference Between: X=a+b+c+d; And X=sum (of A, B, C ,d);?

    Answer :

    Is anyone wondering why you wouldn’t just use total=field1+field2+field3;

  71. Question 51. First, How Do You Want Missing Values Handled?

    Answer :

    The SUM function returns the sum of non-missing values. If you choose addition, you will get a missing value for the result if any of the fields are missing. Which one is appropriate depends upon your needs.However, there is an advantage to use the SUM function even if you want the results to be missing. If you have more than a couple fields, you can often use shortcuts in writing the field names If your fields are not numbered sequentially but are stored in the program data vector together then you can use: total=SUM(of fielda–zfield); Just make sure you remember the “of” and the double dashes or your code will run but you won’t get your intended results. Mean is another function where the function will calculate differently than the writing out the formula if you have missing values.There is a field containing a date. It needs to be displayed in the format “ddmonyy” if it’s before 1975, “dd mon ccyy” if it’s after 1985, and as ‘Disco Years’ if it’s between 1975 and 1985.

  72. Question 52. What Is The Difference Between Calculating The ‘mean’ 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 only the mean values.

  73. Question 53. What Are Some Differences Between Proc Summary And Proc Means?

    Answer :

    Proc means by default give you the output in the output window and you can stop this by the option NOPRINT and can take the output in the separate file by the statement OUTPUTOUT= , But, proc summary doesn’t give the default output, we have to explicitly give the output statement and then print the data by giving PRINT option to see the result.

  74. Question 54. Which Data Set Is The Controlling Data Set In The Merge Statement?

    Answer :

    Dataset having the less number of observations control the data set in the merge statement.

  75. Question 55. How Do The In= Variables Improve The Capability Of A Merge?

    Answer :

    The IN=variablesWhat if you want to keep in the output data set of a merge only the matches (only those observations to which both input data sets contribute)? SAS will set up for you special temporary variables, called the “IN=” variables, so that you can do this and more. Here’s what you have to do: signal to SAS on the MERGE statement that you need the IN= variables for the input data set(s) use the IN= variables in the data step appropriately, So to keep only the matches in the match-merge above, ask for the IN= variables and use them:data three;merge one(in=x) two(in=y); /* x & y are your choices of names */by id; /* for the IN= variables for data */if x=1 and y=1; /* sets one and two respectively */run;

  76. Question 56. What Techniques And/or Procs Do You Use For Tables?

    Answer :

    Proc Freq, Proc univariate, Proc Tabulate & Proc Report.

  77. Question 57. Do You Prefer Proc Report Or Proc Tabulate? Why?

    Answer :

    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 doesn’t produce n (%) in the desirable format.

  78. Question 58. What Is The Difference Between Nodup And Nodupkey Options?

    Answer :

    NODUP compares all the variables in our dataset while NODUPKEY compares just the BY variables.

  79. Question 59. What Is The Main Difference Between Rename And Label?

    Answer :

    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.

  80. Question 60. What Is Enterprise Guide? What Is The Use Of It?

    Answer :

    It is an approach to import text files with SAS (It comes free with Base SAS version 9.0).

  81. Question 61. What Are Input Dataset And Output Dataset Options?

    Answer :

    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.

  82. Question 62. How Can You Create Zero Observation Dataset?

    Answer :

    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.
    In the editor window we write%include ‘path of the sas file’;run;if it is with non-windowing environment no need to give run statement.

  83. Question 63. How Can You Import .csv File In To Sas?

    Answer :

    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;
  84. Question 64. What Is The Use Of Proc Sql?

    Answer :

    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 compared 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.

  85. Question 65. What Is Sas Graph?

    Answer :

    SAS/GRAPH software creates and delivers accurate, high-impact visuals that enable decision makers to gain a quick understanding of critical business issues.

  86. Question 66. Why Is A Stop Statement Needed For The Point=option On A Set Statement?

    Answer :

    When you use the POINT= option, you must include a STOP statement to stop DATA step processing, programming logic that checks for an invalid value of the POINT= variable, or Both. Because POINT= reads only those observations that are specified in the DO statement, SAS cannot read an end-of-file indicator as it would if the file were being read sequentially. Because reading an end-of-file indicator ends a DATA step automatically, failure to substitute another means of ending the DATA step when you use POINT= can cause the DATA step to go into a continuous loop.

SAS Programming,SQL server Interview Questions & Answers

  1. Question 1. Which Tcp/ip Port Does Sql Server Run On? How Can It Be Changed?

    Answer :

    SQL Server runs on port 1433. It can be changed from the Network Utility TCP/IP properties.

  2. Question 2. What Are The Difference Between Clustered And A Non-clustered Index?

    Answer :

    A clustered index is a special type of index that reorders the way records in the table are physically stored. Therefore table can have only one clustered index. The leaf nodes of a clustered index contain the data pages.
    A non clustered index is a special type of index in which the logical order of the index does not match the physical stored order of the rows on disk. The leaf node of a non clustered index does not consist of the data pages. Instead, the leaf nodes contain index rows.

  3. Data Mining Interview Questions

  4. Question 3. What Are The Different Index Configurations A Table Can Have?

    Answer :

    A table can have one of the following index configurations:

    • No indexes
    • A clustered index
    • A clustered index and many nonclustered indexes
    • A nonclustered index
    • Many nonclustered indexes
  5. Question 4. What Are Different Types Of Collation Sensitivity?

    Answer :

    1. Case sensitivity – A and a, B and b, etc.
    2. Accent sensitivity
    3. Kana Sensitivity – When Japanese kana characters Hiragana and Katakana are treated differently, it is called Kana sensitive.
    4. Width sensitivity – A single-byte character (half-width) and the same character represented as a double-byte character (full-width) are treated differently than it is width sensitive.
  6. Data Mining Tutorial

  7. Question 5. What Is Oltp (online Transaction Processing)?

    Answer :

    In OLTP – online transaction processing systems relational database design use the discipline of data modeling and generally follow the Codd rules of data normalization in order to ensure absolute data integrity. Using these rules complex information is broken down into its most simple structures (a table) where all of the individual atomic level elements relate to each other and satisfy the normalization rules.

  8. SAS Programming Interview Questions

  9. Question 6. What’s The Difference Between A Primary Key And A Unique Key?

    Answer :

    Both primary key and unique key enforces uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique creates a nonclustered index by default. Another major difference is that, primary key doesn’t allow NULLs, but unique key allows one NULL only.

  10. Question 7. What Is Difference Between Delete And Truncate Commands?

    Answer :

    Delete command removes the rows from a table based on the condition that we provide with a WHERE clause. Truncate will actually remove all the rows from a table and there will be no data in the table after we run the truncate command.
    TRUNCATE:

    1. TRUNCATE is faster and uses fewer system and transaction log resources than DELETE.
    2. TRUNCATE removes the data by deallocating the data pages used to store the table’s data, and only the page deallocations are recorded in the transaction log.
    3. TRUNCATE removes all rows from a table, but the table structure, its columns, constraints, indexes and so on, remains. The counter used by an identity for new rows is reset to the seed for the column.
    4. You cannot use TRUNCATE TABLE on a table referenced by a FOREIGN KEY constraint. Because TRUNCATE TABLE is not logged, it cannot activate a trigger.
    5. TRUNCATE cannot be rolled back.
    6. TRUNCATE is DDL Command.
    7. TRUNCATE Resets identity of the table

    DELETE:

    1. DELETE removes rows one at a time and records an entry in the transaction log for each deleted row.
    2. If you want to retain the identity counter, use DELETE instead. If you want to remove table definition and its data, use the DROP TABLE statement.
    3. DELETE Can be used with or without a WHERE clause
    4. DELETE Activates Triggers.
    5. DELETE can be rolled back.
    6. DELETE is DML Command.
    7. DELETE does not reset identity of the table.

    Note: DELETE and TRUNCATE both can be rolled back when surrounded by TRANSACTION if the current session is not closed. If TRUNCATE is written in Query Editor surrounded by TRANSACTION and if session is closed, it can not be rolled back but DELETE can be rolled back.

     

  11. SAS Programming Tutorial
    Clinical SAS Interview Questions

  12. Question 8. When Is The Use Of Update_statistics Command?

    Answer :

    This command is basically used when a large processing of data has occurred. If a large amount of deletions any modification or Bulk Copy into the tables has occurred, it has to update the indexes to take these changes into account. UPDATE_STATISTICS updates the indexes on these tables accordingly.

  13. Question 9. What Is The Difference Between A Having Clause And A Where Clause?

    Answer :

    They specify a search condition for a group or an aggregate. But the difference is that HAVING can be used only with the SELECT statement. HAVING is typically used in a GROUP BY clause. When GROUP BY is not used, HAVING behaves like a WHERE clause. Having Clause is basically used only with the GROUP BY function in a query whereas WHERE Clause is applied to each row before they are part of the GROUP BY function in a query.

  14. SASS (Syntactically Awesome Style sheets) Interview Questions

  15. Question 10. What Are The Properties And Different Types Of Sub-queries?

    Answer :

    Properties of Sub-Query

    • A sub-query must be enclosed in the parenthesis.
    • A sub-query must be put in the right hand of the comparison operator, and
    • A sub-query cannot contain an ORDER-BY clause.
    • A query can contain more than one sub-query.

    Types of Sub-Query

    • Single-row sub-query, where the sub-query returns only one row.
    • Multiple-row sub-query, where the sub-query returns multiple rows,. and
    • Multiple column sub-query, where the sub-query returns multiple columns
  16. SASS (Syntactically Awesome Style sheets) Tutorial

  17. Question 11. What Is Sql Profiler?

    Answer :

    SQL Profiler is a graphical tool that allows system administrators to monitor events in an instance of Microsoft SQL Server. You can capture and save data about each event to a file or SQL Server table to analyze later. For example, you can monitor a production environment to see which stored procedures are hampering performances by executing too slowly.
    Use SQL Profiler to monitor only the events in which you are interested. If traces are becoming too large, you can filter them based on the information you want, so that only a subset of the event data is collected. Monitoring too many events adds overhead to the server and the monitoring process and can cause the trace file or trace table to grow very large, especially when the monitoring process takes place over a long period of time.

  18. Data analyst Interview Questions

  19. Question 12. What Are The Authentication Modes In Sql Server? How Can It Be Changed?

    Answer :

    Windows mode and Mixed Mode – SQL and Windows. To change authentication mode in SQL Server click Start, Programs, Microsoft SQL Server and click SQL Enterprise Manager to run SQL Enterprise Manager from the Microsoft SQL Server program group. Select the server then from the Tools menu select SQL Server Configuration Properties, and choose the Security page.

  20. Data Mining Interview Questions

  21. Question 13. Which Command Using Query Analyzer Will Give You The Version Of Sql Server And Operating System?

    Answer :

    SELECT SERVERPROPERTY (‘productversion’), SERVERPROPERTY (‘productlevel’), SERVERPROPERTY (‘edition’).

  22. Question 14. What Is Sql Server Agent?

    Answer :

    SQL Server agent plays an important role in the day-to-day tasks of a database administrator (DBA). It is often overlooked as one of the main tools for SQL Server management. Its purpose is to ease the implementation of tasks for the DBA, with its full- function scheduling engine, which allows you to schedule your own jobs and scripts.

  23. Question 15. Can A Stored Procedure Call Itself Or Recursive Stored Procedure? How Much Level Sp Nesting Is Possible?

    Answer :

    Yes. Because Transact-SQL supports recursion, you can write stored procedures that call themselves. Recursion can be defined as a method of problem solving wherein the solution is arrived at by repetitively applying it to subsets of the problem. A common application of recursive logic is to perform numeric computations that lend themselves to repetitive evaluation by the same processing steps. Stored procedures are nested when one stored procedure calls another or executes managed code by referencing a CLR routine, type, or aggregate. You can nest stored procedures and managed code references up to 32 levels.

  24. SAS DI Interview Questions

  25. Question 16. What Is Log Shipping?

    Answer :

    Log shipping is the process of automating the backup of database and transaction log files on a production SQL server, and then restoring them onto a standby server. Enterprise Editions only supports log shipping. In log shipping the transactional log file from one server is automatically updated into the backup database on the other server. If one server fails, the other server will have the same db and can be used this as the Disaster Recovery plan. The key feature of log shipping is that it will automatically backup transaction logs throughout the day and automatically restore them on the standby server at defined interval.

  26. Question 17. Name 3 Ways To Get An Accurate Count Of The Number Of Records In A Table?

    Answer :

    1. SELECT * FROM table1 
    2. SELECT COUNT(*) FROM table1 
    3. SELECT rows FROM sysindexes WHERE id = OBJECT_ID(table1) AND indid < 2
  27. Advanced SAS Interview Questions

  28. Question 18. What Does It Mean To Have Quoted_identifier On? What Are The Implications Of Having It Off?

    Answer :

    When SET QUOTED_IDENTIFIER is ON, identifiers can be delimited by double quotation marks, and literals must be delimited by single quotation marks. When SET QUOTED_IDENTIFIER is OFF, identifiers cannot be quoted and must follow all Transact-SQL rules for identifiers.

  29. SAS Programming Interview Questions

  30. Question 19. What Is The Difference Between A Local And A Global Temporary Table?

    Answer :

    A local temporary table exists only for the duration of a connection or, if defined inside a compound statement, for the duration of the compound statement.
    A global temporary table remains in the database permanently, but the rows exist only within a given connection. When connection is closed, the data in the global temporary table disappears. However, the table definition remains with the database for access when database is opened next time.

  31. Question 20. What Is The Stuff Function And How Does It Differ From The Replace Function?

    Answer :

    STUFF function is used to overwrite existing characters. Using this syntax, STUFF (string_expression, start, length, replacement_characters), string_expression is the string that will have characters substituted, start is the starting position, length is the number of characters in the string that are substituted, and replacement_characters are the new characters interjected into the string. REPLACE function to replace existing characters of all occurrences. Using the syntax REPLACE (string_expression, search_string, replacement_string), where every incidence of search_string found in the string_expression will be replaced with replacement_string.

  32. Oracle Data Guard Interview Questions

  33. Question 21. What Is Primary Key?

    Answer :

    A PRIMARY KEY constraint is a unique identifier for a row within a database table. Every table should have a primary key constraint to uniquely identify each row and only one primary key constraint can be created for each table. The primary key constraints are used to enforce entity integrity.

  34. Question 22. What Is Unique Key Constraint?

    Answer :

    A UNIQUE constraint enforces the uniqueness of the values in a set of columns, so no duplicate values are entered. The unique key constraints are used to enforce entity integrity as the primary key constraints.

  35. Question 23. What Is Foreign Key?

    Answer :

    A FOREIGN KEY constraint prevents any actions that would destroy links between tables with the corresponding data values. A foreign key in one table points to a primary key in another table. Foreign keys prevent actions that would leave rows with foreign key values when there are no primary keys with that value. The foreign key constraints are used to enforce referential integrity.

  36. Base Sas Interview Questions

  37. Question 24. What Is Check Constraint?

    Answer :

    A CHECK constraint is used to limit the values that can be placed in a column. The check constraints are used to enforce domain integrity.

  38. Clinical SAS Interview Questions

  39. Question 25. What Is Not Null Constraint?

    Answer :

    A NOT NULL constraint enforces that the column will not accept null values. The not null constraints are used to enforce domain integrity, as the check constraints.

  40. Question 26. How To Get @@error And @@rowcount At The Same Time?

    Answer :

    If @@Rowcount is checked after Error checking statement then it will have 0 as the value of @@Recordcount as it would have been reset. And if @@Recordcount is checked before the error-checking statement then @@Error would get reset. To get @@error and @@rowcount at the same time do both in same statement and store them in local variable.
    SELECT @RC = @@ROWCOUNT, @ER = @@ERROR

  41. Data Visualization Interview Questions

  42. Question 27. What Is A Scheduled Jobs Or What Is A Scheduled Tasks?

    Answer :

    Scheduled tasks let user automate processes that run on regular or predictable cycles. User can schedule administrative tasks, such as cube processing, to run during times of slow business activity. User can also determine the order in which tasks run by creating job steps within a SQL Server Agent job. E.g. back up database, Update Stats of Tables. Job steps give user control over flow of execution. If one job fails, user can configure SQL Server Agent to continue to run the remaining tasks or to stop execution.

  43. SASS (Syntactically Awesome Style sheets) Interview Questions

  44. Question 28. What Are The Advantages Of Using Stored Procedures?

    Answer :

    • Stored procedure can reduced network traffic and latency, boosting application performance.
    • Stored procedure execution plans can be reused, staying cached in SQL Server’s memory, reducing server overhead.
    • Stored procedures help promote code reuse.
    • Stored procedures can encapsulate logic. You can change stored procedure code without affecting clients.
    • Stored procedures provide better security to your data.
  45. Question 29. What Is A Table Called, If It Has Neither Cluster Nor Non-cluster Index? What Is It Used For?

    Answer :

    Unindexed table or Heap. Microsoft Press Books and Book on Line (BOL) refers it as Heap. A heap is a table that does not have a clustered index and, therefore, the pages are not linked by pointers. The IAM pages are the only structures that link the pages in a table together. Unindexed tables are good for fast storing of data. Many times it is better to drop all indexes from table and then do bulk of inserts and to restore those indexes after that.

  46. SAS Macro Interview Questions

  47. Question 30. Can Sql Servers Linked To Other Servers Like Oracle?

    Answer :

    SQL Server can be linked to any server provided it has OLE-DB provider from Microsoft to allow a link. E.g. Oracle has an OLE-DB provider for oracle that Microsoft provides to add it as linked server to SQL Server group.

  48. Question 31. What Is Bcp? When Does It Used?

    Answer :

    BulkCopy is a tool used to copy huge amount of data from tables and views. BCP does not copy the structures same as source to destination. BULK INSERT command helps to import a data file into a database table or view in a user-specified format.

  49. Question 32. How To Implement One-to-one, One-to-many And Many-to-many Relationships While Designing Tables?

    Answer :

    One-to-One relationship can be implemented as a single table and rarely as two tables with primary and foreign key relationships. One-to-Many relationships are implemented by splitting the data into two tables with primary key and foreign key relationships. Many-to-Many relationships are implemented using a junction table with the keys from both the tables forming the composite primary key of the junction table.

  50. SAS BI Interview Questions

  51. Question 33. What Is An Execution Plan? When Would You Use It? How Would You View The Execution Plan?

    Answer :

    An execution plan is basically a road map that graphically or textually shows the data retrieval methods chosen by the SQL Server query optimizer for a stored procedure or ad- hoc query and is a very useful tool for a developer to understand the performance characteristics of a query or stored procedure since the plan is the one that SQL Server will place in its cache and use to execute the stored procedure or query. From within Query Analyzer is an option called “Show Execution Plan” (located on the Query drop-down menu). If this option is turned on it will display query execution plan in separate window when query is ran again.

  52. Data analyst Interview Questions

  53. Question 34. What Sas Statements Would You Code To Read An External Raw Data File To A Data Step?

    Answer :

    INFILE statement.

  54. Question 35. How Do You Read In The Variables That You Need?

    Answer :

    Using Input statement with the column pointers like @5/12-17 etc.

  55. Question 36. Are You Familiar With Special Input Delimiters? How Are They Used?

    Answer :

    DLM and DSD are the delimiters that I’ve used. They should be included in the infile statement. Comma separated values files or CSV files are a common type of file that can be used to read with the DSD option. DSD option treats two delimiters in a row as MISSING value.
    DSD also ignores the delimiters enclosed in quotation marks.

  56. SAS DI Interview Questions

  57. Question 37. If Reading A Variable Length File With Fixed Input, How Would You Prevent Sas From Reading The Next Record If The Last Variable Didn’t Have A Value?

    Answer :

    By using the option MISSOVER in the infile statement.If the input of some data lines are shorter than others then we use TRUNCOVER option in the infile statement.

  58. Question 38. What Do The Put And Input Functions Do?

    Answer :

    • INPUT function converts character data values to numeric values.
    • PUT function converts numeric values to character values.EX: for INPUT: INPUT (source, informat)
    • For PUT: PUT (source, format)
    • Note that INPUT function requires INFORMAT and PUT function requires FORMAT.
    • If we omit the INPUT or the PUT function during the data conversion, SAS will detect the mismatched variables and will try an automatic character-to-numeric or numeric-to-character conversion. But sometimes this doesn’t work because $ sign prevents such conversion. Therefore it is always advisable to include INPUT and PUT functions in your programs when conversions occur.
  59. Question 39. What Is The Significance Of The ‘of’ In X=sum (of A1-a4, A6, A9);

    Answer :

    If don’t use the OF function it might not be interpreted as we expect. For example the function above calculates the sum of a1 minus a4 plus a6 and a9 and not the whole sum of a1 to a4 & a6 and a9. It is true for mean option also.

     

  60. Question 40. What Other Sas Products Have You Used And Consider Yourself Proficient In Using?

    Answer :

    Data _NULL_ statement, Proc Means, Proc Report, Proc tabulate, Proc freq and Proc print, Proc Univariate etc.

     

  61. Advanced SAS Interview Questions

  62. Question 41. Name Several Ways To Achieve Efficiency In Your Program.

    Answer :

    Efficiency and performance strategies can be classified into 5 different areas.
    ·CPU time
    ·Data Storage
    · Elapsed time
    · Input/Output
    · Memory CPU Time and Elapsed Time- Base line measurements

  63. Question 42. What Has Been Your Most Common Programming Mistake?

    Answer :

    Missing semicolon and not checking log after submitting program, Not using debugging techniques and not using Fsview option vigorously.

  64. Oracle Data Guard Interview Questions

  65. Question 43. Explain What Is Sas? What Are The Functions Does It Performs?

    Answer :

    SAS means Statistical Analysis System, which is an integrated set of software products.
    • Information retrieval and data management
    • Writing reports and graphics
    • Statistical analysis, econometrics and data mining
    • Business planning, forecasting and decision support
    • Operation research and Project management
    • Quality Improvement
    • Data Warehousing
    • Application Development

  66. Question 44. Explain What Is The Basic Structure Of Sas Programming?

    Answer :

    The basic structure of SAS are
    • Program Editor
    • Explorer Window
    • Log Window

  67. Question 45. What Is The Basic Syntax Style In Sas?

    Answer :

    To run program successfully, and you have following basic elements:
    • There should be a semi-colon at the end of every line
    • A data statement that defines your data set
    • Input statement
    • There should be at least one space between each word or statement
    • A run statement

    For example: Infile ‘H: StatHWyourfilename.dat’;

  68. Question 46. Explain What Is Data Step?

    Answer :

    The Data step creates an SAS dataset which carries the data along with a “data dictionary.” The data dictionary holds the information about the variables and their properties.

  69. Question 47. Explain What Is Pdv?

    Answer :

    The logical area in the memory is represented by PDV or Program Data Vector. At the time, SAS creates a database of one observation at a time. An input buffer is created at the time of compilation which holds a record from an external file. The PDV is created following the input buffer creation 

     

  70. Question 48. Mention What Are The Data Types Does Sas Contain?

    Answer :

    The data types in SAS are Numeric and Character.

  71. Question 49. In Sas Explain Which Statement Does Not Perform Automatic Conversions In Comparisons?

    Answer :

    In SAS, the “where” statement does not perform automatic conversions in comparisons.

     

  72. Question 50. Explain How You Can Debug And Test Your Sas Program?

    Answer :

    You can debug and test your SAS program by using Obs=0 and systems options to trace the program execution in log

  73. Question 51. Mention What Is The Difference Between Nodupkey And Nodup Options?

    Answer :

    The difference between the NODUP and NODUPKEY is that, NODUP compares all the variables in our dataset while NODUPKEY compares just the BY variables

  74. Question 52. Mention The Validation Tools Used In Sas?

    Answer :

    For DataSet : Data set name/ debug Data set: Name/stmtchk
    For Macros: Options: mprint mlogic symbolgen

  75. Question 53. Explain What Does Proc Print, And Proc Contents Are Used For?

    Answer :

    To display the contents of the SAS dataset PROC print is used and also to assure that the data were read into SAS correctly. While, PROC CONTENTS display information about an SAS dataset.

  76. Question 54. Explain What Is The Use Of Function Proc Summary?

    Answer :

    The syntax of proc summary is same as that of proc means, it computes descriptive statistics on numeric variables in the SAS dataset.

     

  77. Question 55. Explain What Proc Glm Does?

    Answer :

    Proc glm performs simple and multiple regression, analysis of variance (ANOVAL), analysis of covariance, multivariate analysis of variance and repeated measure analysis of variance.

  78. Question 56. Explain What Is Sas Informats?

    Answer :

    SAS INFORMATS are used to read, or input data from external files known as Flat Files ASCII files, text files or sequential files). The informat will tell SAS on how to read data into SAS variables.

  79. Question 57. Mention The Category In Which Sas Informats Are Placed?

    Answer :

    SAS informats are placed in three categories,
    • Character Informats : $INFORMATw
    • Numeric Informats : INFORMAT w.d
    • Date/Time Informats: INFORMAT w.

  80. Question 58. What Function Catx Syntax Does?

    Answer :

    CATX syntax concatenate character strings remove trailing and leading blanks and inserts separators.

  81. Question 59. Explain What Is The Use Of Proc Gplot?

    Answer :

    PROC gplot has more options and can create more colorful and fancier graphics.

  82. Question 60. What Are The Scrubbing Procedures In Sas?

    Answer :

    Proc Sort with nodupkey option, because it will eliminate the duplicate values.