Correct Answer : Get Lastest Questions and Answer : Explanation: As you can see data is separated by the blank space consistently. Hence we can use list input to read this data.
Question : You have been given below dataset named data.
And you need to generate data as below in a file called gen_course43.txt which of the following code segment is correct?
A. data gen_course43.txt; set data41; file ' data41 dsd; put course_name FEE1: comma7. FEE2 : comma7. FEE3: comma7. FEE4 : comma7.; run;
B. data _null_; set data41; file '/folders/myfolders/hedata/gen_course43.txt' dsd; put course_name FEE1: comma7. FEE2 : comma7. FEE3: comma7. FEE4 : comma7.; run;
C. data _null_; set data41; file '/folders/myfolders/hedata/gen_course43.txt'; put course_name FEE1: comma7. FEE2 : comma7. FEE3: comma7. FEE4 : comma7.; run;
D. data _null_; set data41; file '/folders/myfolders/hedata/gen_course43.txt' dlm=; put course_name FEE1: comma7. FEE2 : comma7. FEE3: comma7. FEE4 : comma7.; run;
Correct Answer : Get Lastest Questions and Answer : Explanation: As given dataset, we can clearly see that we need to read data from data41. Hence, it should be part of set statement, as well as we are not generating new dataset, we need to generate file. Hence data step should be line _null_ , hence option 1 is out. Now we need to read data and needs to be generated comma separated vaues. However, all the values which has comma as part of their values than we have to use dsd option, which will make sure that data values will be separated by comma and any values format which has comma in the values will be generated on double quote. So option 2 is correct.
Question : You have been given below raw data
You need to read it correctly which of the following code fragment is correct
Correct Answer : Get Lastest Questions and Answer : Explanation: As you can see in the raw data values are not fixed column. Hence, you cannot use column format. You can read blank space separated value using list input. However, for similar field you can use range like fee1-fee4. However, you need to provide format as well for these values. Hence both fields and format should be in parenthesis. As character by default will be 16 character. So based on all this requirement we can say option 1 is correct.