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.