Premium

SAS Base Latest Interview Preparation (Q&A)



Question-: What is the use of VARNUM variable in the CONTENTS or DATASETS proc?

Answer: If you see by default CONTENTS proc print all variable information in the alphabetical order but if you want to print them in their creation order or logical position then you have to use VARNUM option in the CONTENTS proc. For instance, you can as below
proc datasets;
contents data=he_sas.le_learner varnum;



Question-: What is the difference between libref and fileref?

Answer: We use the fileref to temporary point to the external file location while libref reference to the SAS data set. Similarly, libref is created using the LIBNAME while fileref is created using FILENAME statement.



Question-: What is the use of IMPORT proc?

Answer: IMPORT proc as name suggests, import the data from external data source and writes it to a SAS Data set. Using this you can import both structured and unstructured data. Example files which you can import are
- Delimited files (Comma, tilde, blank, tab etc.)
- Excel files
- JMP 7 files (If using SAS 9.4)
However, be default IMPORT proc assume that first row has the header information. And to guess the correct number of variables, their informats and formats it scans first 20 (which you can change) rows in the file. Internally IMPORT proc create DATA step to read the contents of the file. The generated DATA step code you can see in the log information generated as part of the SAS IMPORT statement.



Question-: What is the use of VALIDMEMNAME= system option?

Answer: Using system option VALIDNAME= we can enhance the rule for having SAS Name datasets like having special character or international character in the SAS Data set name if we use VALIDMEMNAME=EXTEND.

Related Questions


Question-: How do you cancel the previously assigned FOOTNOTE and TITLE statement?

Question-: In the output report you want to change the header of the column which is different than variable name, how can you achieve that?

Question-: If you want to have label assigned permanently for a variable then how can you achieve that?

Question-: When you use the SUM statement then it is mandatory to provide the var statement?

Question-: With the PROC SORT step which is statement is mandatory?

Question-: What is the default output look like for the PRINT proc?

Question-: During the compilation phase of DATA step what SAS creates?

Question-: Is it true that PDV (Program Data vector) holds all the observations and then at the end of Data step it written to new Data set?