Question : You have created a filref as below. Till when this fileref will be available filename allhecrs '/folders/myfolders/hedata/hecourses2017t.dat';
A. If you update this, it will be changed B. If you clear this C. You closed your session
Correct Answer : Get Lastest Questions and Answer : Explanation: fileref and libref will have the same scope. As soon as you update it, clear it or close the session they will be removed and you have to create again.
Question : You have created a fileref as below, now you want to use this fileref and restrict the dataset to be upto first records. Which of the following statement you will be using for this given requirement? filename allhecrs '/folders/myfolders/hedata/hecourses2017t.dat';
Correct Answer : Get Lastest Questions and Answer : Explanation: You can use fileref in the infile statement to read the data. However, you can use direct file path as well instead of fileref. Using obs=15 will restrict to read observation from 1 to 15.
Question : You have been given below SAS dataset named work.hadoopexam
Now you need to write this dataset to a raw file on UNIX platform, how can you do that?
1. data _null_; set work.hadoopexam; file "/folders/myfolders/hedata/filtered.dat"; put COURSE_ID COURSE_NAME LOCATION$ FEE DATE ; run;
2. data hetrain.hadoopexam; set work.hadoopexam; file "/folders/myfolders/hedata/filtered.dat"; put COURSE_ID COURSE_NAME LOCATION$ FEE DATE ; run;
4. data _null_; set work.hadoopexam; file "/folders/myfolders/hedata/filtered.dat"; put COURSE_ID COURSE_NAME LOCATION$ FEE DATE ; run;
Correct Answer : Get Lastest Questions and Answer : Explanation: Creating a raw file using SAS RAW DATASET is given below. _NULL_: It means you are avoiding to create a new SAS dataset. We just want to create a new data file. PUT: It will help you select columns from the existing source dataset in this case work.course2017. FILE PRINT : This option help you to print the contents in the file.