Premium

SAS Base Latest Interview Preparation (Q&A)



Question-: Can you please explain PUT and INPUT in detail?

Answer: Whenever you want to convert NUMERIC to CHARACTER and vice versa you would be using PUT and INPUT function. However, it depends what is your target and source variable. Hence, keep the following things in mind.

- PUT() function always creates a new character variables
- INPUT() function can create character or numeric variables based on what informat you are using.
- The source format must match the source variable type in PUT()
- The source variable type for INPUT() must always be character variables.



Question-: What is the difference when you define order using “- “single hyphen and double hyphen (“--�)?

Answer: When you use – hyphen then it would ignore any in-between variable which does not matches for example below

‘FEE1, FEE2, COURSNAME, FEE3, FEE4’

If you provide range as “FEE1-FEE4’ it would produce the following

‘FEE1, FEE2, FEE3, FEE4’

If you use double hyphen it would not remove the variable in between for example FEE1--FEE4 it would produce the output as below.

‘FEE1, FEE2, COURSNAME, FEE3, FEE4’



Question-: When do you use %include statement?

Answer: You should use %include statement brings a SAS programming statement, data line or both into a current SAS program. The %INCLUDE statement references lines from an external file and process them immediately like you have copied code from somewhere else and pasted it to be executed immediately.



Question-: What is the difference between Match merge vs One-to-one merge?

Answer: Using the match merge you connate the two-dataset based on one column like ID. For example, first dataset has 3 fields and second datasets has 4 fields and based on the ID match both datasets would be combined and having each observation 7 fields, obviously it has some restriction like both data should have matching ID values.

And in case of ONE to ONE merge you have to first sort both the datasets on the same column and then merge them together.

Related Questions


Question-: In the DATA Step what is the implicit Output and explicit output?

Question-: When and where the OUTPUT statement writes the observation?

Question-: What delimited file by default read by the IMPORT proc?

Question-: While importing fixed length file how to use IMPORT proc?

Question-: What is the Syntax and semantic errors in SAS?

Question-: What is the use of the STOP statement in SAS?

Question-: What is the effect if you use “drop=� option in DATA statement and SET statement?

Question-: What all are the data types in SAS?