Question : Within the data set Furnitur.Bookcase, the variable Finish contains values such as ash/cherry/teak/matte-black. Which of the following creates a subset of the data in which the values of Finish contain the string walnut? Make the search for the string case-insensitive. 1. data work.bookcase; set furnitur.bookcase; if index(finish,walnut) = 0; run; 2. data work.bookcase; set furnitur.bookcase; if index(finish,'walnut') > 0; run; 3. Access Mostly Uused Products by 50000+ Subscribers set furnitur.bookcase; if index(lowcase(finish),walnut) = 0; run; 4. data work.bookcase; set furnitur.bookcase; if index(lowcase(finish),'walnut') > 0; run;
Use the INDEX function in a subsetting IF statement, enclosing the character string in quotation marks. Only those observations in which the function locates the string and returns a value greater than 0 are written to the data set.
Question : You have been given a library named HETRAIN, now you need to find the summary of all the files stored in this SAS library, which of the following option will be best suitable.
Correct Answer : Get Lastest Questions and Answer : Explanation: There are two proc by which you can get the summary of data stored in a SAS library. - Contents - Datasets As option is asking for the Contents proc. So see the options available with the contents proc. In this case we have to have _All_ option appended with the library name using dot. And to suppress all the information for files, you have to use nods option separated by space.
Question : Which of the following is a correct syntax with regards to referencing a file stored in a SAS permanent library?
1. data hadoopexam.subs; set courses.subscriber; if price>100; run;
2. data 2hadoop.subs; set courses.subscriber; if price>100; run;
4. data subs; set courses.subscriber; if price>100; run;
Correct Answer : Get Lastest Questions and Answer : Explanation: You need to look for the naming rules of a SAS library at first. It can not be longe than 8 character. Hence, option 1 is out. It can not start with the number, hence option 2 is out. To reference a file in a permanent library you have to have two level access, hence option 4 is out. Only option 3 is left and which is correct.