SAS Interview Question and Answer

Interview Types
Photograph of candidates ready for a job interview

Here’s a listing of prime 50 SAS interview query and reply for 2021:

1.What’s SAS?

Ans: SAS (Statistical evaluation system) is an analytical software program developed by the SAS institute. It’s extensively in style for knowledge administration, knowledge evaluation and reporting activity. SAS can be used for knowledge mining, multivariate evaluation, Predictive analytics and enterprise intelligence.

2.Distinction between if and the place in SAS

Ans:
IF assertion used to create a subset of the enter dataset by specifying situations and operators, whereas WHERE assertion is used for choosing observations and worth by specifying situations and operators. |
IF assertion can not be utilized in PROC procedures, The WHERE assertion can be utilized in each PROC and DATA step
IF assertion can not be used to seek for all comparable character values that sound alike, WHERE assertion can be used to seek for all comparable character values that sound alike
IF assertion can be utilized on automated variables (_N_, First., Final. Variables) WHERE assertion can not be utilized on automated variables.

Three.What’s the different identify for knowledge preparation stage of information discovery course of SAS?

Ans: Knowledge preparation stage is properly often called knowledge mining stage wherein the processes consists of like – Number of knowledge, Cleaning of information, Development of recent datasets, Integration of the brand new datasets with the already current knowledge sources, Formatting of the information to provide it the appropriate dimension and look.

Four.What’s PDV in SAS?

Ans: In the course of the compilation part SAS creates program knowledge vector (PDV), which is a logical space in reminiscence the place SAS construct a knowledge set, one statement at a time.

5. The way to create library in SAS?

Ans: SAS Library is created through the use of LIBNAME key phrase together with legitimate SAS identify, no more than eight characters and the trail with the identify of the listing enclosed in citation. Syntax-

LIBNAME mydata 'bodily Pathdirectoryname'; Run;

6. What’s SAS storage?
Ans:SAS knowledge units (tables), the default SAS storage format to retailer knowledge of any granularity within the type of observations (rows) and variables (columns) and likewise descriptor data equivalent to knowledge sorts, column lengths, and the SAS engine is makes use of within the storage of information.

7. The way to import knowledge in SAS?

Ans: SAS PROC IMPORT process is used to learn uncooked knowledge from the supply and writes it to a SAS knowledge set. SAS Import process can learn quite a lot of knowledge file like EXCEL, CSV, delimited file(Tab, clean, comma).
Syntax

PROC IMPORT datafile=" bodily Pathfilename" DBMS=identifier OUT=SAS knowledge set REPLACE; run;

eight. The way to set up SAS?

Ans: SAS college version which is free SAS software program with limitations for people which may be obtain from the SAS web site on a unique working methods like Home windows, Linux and Mac. For setup and set up will need to have oracle digital field and downloaded SAS College version software program in a folder. To configure we are going to import the SAS UA into Digital field and share created folder with digital field for launch.

9.What’s SAS used for?

Ans : It’s extensively in style for knowledge administration, knowledge evaluation and reporting activity. SAS can be used for knowledge mining, multivariate evaluation, Predictive analytics and enterprise intelligence.

10. What’s knowledge step in SAS?

Ans: Knowledge step is essential assertion is SAS which is use to create, modify, making subset, merging, updating of current knowledge set and likewise to compute knowledge values.

11. What number of methods to create macro variables in SAS?

Ans: SAS macros variable may be created by a number of methods like- Through the use of %LET, By defining Macro parameters, By iterative %DO assertion, Through the use of the INTO in PROC SQL and likewise through the use of the CALL SYMPUTX routine.

12. The way to create a library in SAS?

Ans: SAS Library is created through the use of LIBNAME key phrase together with legitimate SAS identify no more than eight character and the trail and identify of the listing enclosed in citation. Syntax-

LIBNAME mydata 'bodily Path'; Run;

13. The way to delete codecs in SAS?

Ans:

To delete assigned codecs from dataset we are going to use PROC Datasets assertion with Lib= possibility and Modify assertion with the dataset identify.

Syntax

<!-- wp:paragraph -->
<p><sturdy>Syntax</sturdy> - PROC DATASETS LIB=work;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>MODIFY New;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>FORMAT _all_;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>INFORMAT _all_;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>RUN;</p>
<!-- /wp:paragraph -->

14. The way to create a dataset in SAS?

Ans: Knowledge set is created through the use of knowledge step assertion together with set assertion, The information set identify should be started with letter or underscore and less then 32 character lengthy. Syntax

Knowledge mydataset; Set newdataset; Run;

15. What’s ODS in SAS?

Ans: ODS stand for Output supply system which convert SAS output knowledge in consumer outline report format output like HTML, PDF, EXCEL RTF. Syntax are- ODS outputtype File =’ path and file identify’ ; PROC step assertion ; run; ODS outputtype shut;

16. What’s enter buffer in SAS?

Ans: The enter buffer is created firstly of the compilation part which is used to carry the uncooked knowledge.

17. The way to learn csv file in SAS?

Ans: SAS PROC IMPORT process is a handy option to import/Learn CSV knowledge file into SAS knowledge set.

Syntax

PROC IMPORT datafile=" bodily Pathfilename.CSV" DBMS=CSV OUT=SAS knowledge set REPLACE; Run;

18. The way to create a desk in SAS?

Ans: All one-dimension, two-dimension or three- dimension tables may be created through the use of PROC Tabulate assertion. TABULATE can computes and add quite a lot of statistics and ends in the tables and creates skilled trying desk.

19. The way to discover lacking values in SAS?

Ans: SAS PROC MEANS process is use for descriptive statistical evaluation for the numeric variable in a knowledge set. Within the imply process we are able to embody the key phrase referred to as NMISS, which can outcomes the variety of lacking values in numeric variables of the identical dataset.
Syntax

PROC MEANS knowledge= mydata; NMISS; Run;

20. The way to create everlasting dataset in SAS?

Ans: SAS everlasting dataset should be comply with the 2 stage identify, for that we now have to create SAS libarary first through the use of Libname assertion and assign that created library identify with knowledge setname in prefix.

21. The way to take away duplicate rows in SAS?

Ans: Duplicate rows in a dataset may be take away in the course of the PROC SORT process, through the use of NODUP possibility is knowledge set identify

22. The way to import sas dataset into SAS?

Ans: SAS dataset is import through the use of SET assertion. The next syntax is use to import or copy SAS dataset. DATA mydata; SET newdata; RUN;

23. The way to debug SAS program?
Ans: Debugging is the method of figuring out and resolving errors from a program. It might be Syntax error, Semantic error, Logic error or Knowledge error. We might debug this system by testing every a part of this system and there syntax, BY testing program with small datasets, By studying log and figuring out warning and errors, By looking of lacking semicolon, By including PUT assertion into this system.

24. What’s knowledge strains in SAS?

Ans: DATALINES is an announcement used with an INPUT assertion in DATA step to learn knowledge that we enter straight in this system.

25. The way to enhance font dimension in SAS?

Ans: Altering SAS font dimension might be executed manually in three programming interface- SAS studio, SAS Windowing atmosphere, and SAS Enterprises information. In SAS studio Open the “extra software choices” menu, and choose “Preferences.” then new field will seem on the display. Select “Editor” from the listing on the left, then search for a dropdown menu labeled “Font Dimension.”

In widowing atmosphere click on within the enhanced editor window, Choose “Instruments” from the toolbar, and click on “Choices” then “Enhanced Editor. Double test that the improved editor window is lively. A brand new field will seem then select the “Look” tab, then use the “Dimension” dropdown to pick out your font dimension. In SAS Enterprises information Choose “Program” from the instrument bar, then click on “Editor Choices. A brand new field will seem in your display, select the “Look” tab, then use the “Dimension” dropdown to pick out your font dimension.

26. The way to kind dataset in SAS?

Ans: To kind the dataset, the PROC SORT process is use in ascending or descending order, by default the type is ascending.

SYNTAX

PROC SORT knowledge=mydata OUT=outdata; RUN;

27. What capabilities does SAS carry out?

Ans: SAS has all kinds of in constructed capabilities which assist in analyzing and processing the information. Particular Perform in SAS are categorized in Character, Numeric and Date. Few frequent and vital SAS character capabilities are SUBSTR, TRIM, COMPRESS, SCAN. Helpful Numeric perform are- SUM, COUNT, ROUND, MIN, MAX and likewise we are able to use perform in Date like- DATE, TODAY, MDY and many others.

28. What’s the fundamental construction of a SAS base program?

Ans: SAS program line started with a key phrase DATA or PROC step with dataset identify and every line finish with a semicolon. To finish the SAS program we are going to use the RUN assertion on the finish with semicolon.

29. What’s PDV?

Ans: In the course of the compilation part SAS creates program knowledge vector (PDV), which is a logical space in reminiscence the place SAS construct a knowledge set, one statement at a time.

30. What’s the distinction between nodupkey and the nodup choices?

Ans: SAS nodupkey and nodup key phrases are use to take away the duplicate in the course of the PROC SORT process in sorting the dataset. During which nodupkey test and eliminates statement with duplicate BY variables values evaluating whereas nodup checks for and eliminates duplicate observations by evaluating all of the variables

31. Identify sorts of class wherein SAS Informats are positioned

Ans:SAS Informats are used to learn or enter knowledge from exterior information in three informats classes character, numeric, and date/time.

32. Checklist out some key idea of SAS

Ans:
1-SAS program can include a DATA step, a PROC step, or any mixture of DATA and the PROC steps.
2- DATA steps usually create or modify SAS knowledge units.
Three-PROC steps are pre- written routines that allows you to analyze and course of the information within the SAS knowledge set and to current the information within the type of a report.
Four- PROC steps generally create new SAS knowledge units that comprise the outcomes of the process like-Proc kind, Proc Transpose.
5-A SAS assertion normally begins with a ‘SAS key phrase’ and all the time ends with a semicolon.
6-Every time a step is executed, SAS generates a log of the processing actions and the outcomes of the processing.
7-The SAS log collects messages in regards to the processing of the SAS packages and about any errors that happen.

33. What’s issue evaluation?

Ans: Issue evaluation is a statistical methodology use to analyze relationships and variability amongst noticed, correlated variables when it comes to a probably decrease variety of unobserved variables .

34. How SAS treats the DSD delimiters?

Ans: In SAS infile assertion the DSD possibility specifies that when knowledge values are enclosed in citation marks, delimiters inside the worth are handled as character knowledge. After we specify DSD, SAS treats two consecutive delimiters as a lacking worth and removes citation marks from character values.

35. What are the methods to do a “desk lookup” in SAS?

Ans: A desk lookup method used to find out the worth of a variable within the major desk to find out the worth of one other variable that’s current in a secondary desk. There are a variety of methods for performing these desk lookup- DATA Step Merges, SQL Joins, Utilizing Codecs and likewise Utilizing Indexes

36. What are the distinction between CEIL and FLOOR capabilities in SAS?

Ans: CEIL is a numeric perform which returns the smallest integer that’s higher than or equal to the argument, whereas FLOOR Returns the most important integer lower than or equal to a numeric worth expression.

37. What’s using STOP assertion?

Ans: The STOP assertion causes SAS to cease processing the present DATA step instantly and resume processing statements after the top of the present DATA step. The STOP assertion can be utilized alone or in an IF-THEN assertion or SELECT group.

38. What’s SLIBREF?

Ans: SLIBREF=server-libref which specifies the libref that’s utilized by the distant session to determine the SAS knowledge library when no bodily identify is specified and the native session’s libref is completely different from the distant session’s libref.

39. What’s using the %embody assertion?

Ans: The %INCLUDE assertion causes SAS to learn from the file that’s referenced by SASTERM.

40. Checklist down the explanations for selecting SAS over different knowledge analytics instruments.

Ans:

1- SAS has been the undisputed market chief in industrial analytics area.

2- SAS provides big array of statistical capabilities and has good GUI (Enterprise Information & Miner) for folks to study shortly additionally supplies simple possibility (PROC SQL) for individuals who already know SQL.

Three- It supplies superior technical assist and has devoted customer support together with the neighborhood.

41. Point out few capabilities of SAS Framework.

Ans: The next are the capabilities of SAS Framework : 1- Entry knowledge from a number of sources, 2- Administration of entry knowledge, Three- Easy to Advance stage Knowledge Evaluation, Four- Reporting within the type of listing, abstract and graphs.

42. Given an unsorted knowledge set, the best way to learn the final statement to a brand new knowledge set? Give examples.

Ans: To pick the final statement of given knowledge set we first kind the information set utilizing BY assertion utilizing proc kind process, the DATA step creates two non permanent variables for every variable within the BY assertion. The names of those variables are FIRST. Variable and its worth 1 for the primary statement in every BY group and LAST. Variable has the worth 1 for the final statement in every BY group. Now through the use of IF situation the final document in BY group can learn.

Syntax

<!-- wp:paragraph -->
<p><sturdy>Syntax-</sturdy> proc kind knowledge=sashelp.vehicles out= new;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>by sort;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>run;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>knowledge new1;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>set new;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>by sort;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>if final. Sort;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>run;</p>
<!-- /wp:paragraph -->

43. What are the variations between sum perform and utilizing “+” operator

Ans: SUM is a numeric perform for aggregating numeric variables the place as “+” is a Arithmetic operator for including two or extra variables. SUM perform returns the sum of non lacking and lacking arguments the place as “+” operator returns a lacking values (arguments) if any of the values are lacking.

44. How do you specify the variety of iterations and particular situation inside a single do loop?

Ans: In SAS iterative DO Loop assertion begins with DO XYZ = begin TO cease and END assertion marks the top of the loop, the place xyz is an index variable with begin and cease values, which specifies the variety of iterations of a Do assertion which is mounted and for conditionally executing do loops the DO WHILE and DO UNTIL statements assist us to execute do loop on whether or not a situation is true of false.

Syntax

<!-- wp:paragraph -->
<p><sturdy>Syntax- Do Loop with out situation </sturdy>knowledge A;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>do I = 1 to Four;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>y = I**2;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>output;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>finish;</p>
<!-- /wp:paragraph -->

Syntax

<!-- wp:paragraph -->
<p><sturdy>Syntax- Do Loop with situation </sturdy>knowledge Check;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>cash = 10000;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>newCounter = zero;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>do till (cash > zero);</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>cash = cash - 1000;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>newCounter = newCounter + 1;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>finish;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>run;</p>
<!-- /wp:paragraph -->

45. What’s the distinction between One to One Merge and Match Merge? Give an instance.

Ans: One-to-one merging combines observations from two or extra SAS knowledge units right into a single statement in a brand new knowledge set the place as Match-merging combines observations from two or extra SAS knowledge units right into a single statement in a brand new knowledge set in keeping with the values of a typical variable. To carry out a one-to-one merge, use the MERGE assertion with no BY assertion the place as In match-merge, use a BY assertion instantly after the MERGE assertion.

Instance- One-to-One knowledge New3;

merge New1 New3;

run; Instance- Match-Merge knowledge New3;

merge New1 New3;

By Id ; run;

46. What’s interleaving in SAS?

Ans:

Interleaving combines particular person sorted SAS knowledge units into one huge sorted knowledge set based mostly on the variables listed in a BY assertion.

Syntax

<!-- wp:paragraph -->
<p>DATA three;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>set one two;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>by yr;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>run;</p>
<!-- /wp:paragraph -->

47. The way to create listing output for crosstabulations in proc freq?

Ans: To create listing output we use PROC FREQ process together with tables assertion and variable names.

Syntax

PROC FREQ knowledge=mydata; Tables Var1*Var2/listing; Run;

49. What’s the distinction between CLASS assertion and BY assertion in proc means?

Ans: Each CLASS and BY assertion is use to categorizes/grouping the variable values on ascending or descending order. In Class assertion we don’t must kind the dataset the place as in BY variable assertion the dataset should be sorted first.

50. What may be the dimensions of largest dataset in SAS?

Ans: The utmost file dimension for a SAS knowledge set is 2 gigabytes.

zero

Supply

Leave a Comment