The following SAS program is submitted using the raw data file as input:
data work.condo_ranch; infile 'file-specification' dsd; input style $ @; if style = 'CONDO' or style = 'RANCH' then input sqfeet bedrooms baths street $ price : dollar10.; run; How many observations does the WORK.CONDO_RANCH data set contain?
Output looks similar to this fashion. Since we have input style $ @; then comes if then.
Question :
The contents of the raw data file FURNITURE are listed below: --------10-------20-------30 chair,,table chair,couch,table
The following SAS program is submitted: data stock; infile 'furniture' dsd; input item1 $ item2 $ item3 $; run; Which one of the following is the value of the variable named ITEM2 in the first observation of the output data set?
Explanation: with DSD option two consecutive delimiters are not consider as one, so missing value is assigned to item2 and as item2 is character variable it has missing character value " ". Without DSD Item2 will be table. Hopefully that helps. without dsd it will be error.else you should use dlm=',' option.then consecutive commas will be considered as one.the dataset will have only one observation.for the second reord it will go past the record.
Ans : 1 Exp : Concatenating appends the observations from one data set to another data set. The new data set contains the total number of records from all input data sets, so b is incorrect. All the variables from all the input data sets appear in the new data set, so c is incorrect.
Question : If you concatenate the data sets below in the order shown, what is the value of Sale in observation 2 of the new data set?
Ans : 1 Exp : The concatenated data sets are read sequentially, in the order in which they are listed in the SET statement. The second observation in Sales.Reps does not contain a value for Sale, so a missing value appears for this variable. (Note that if you merge the data sets, the value of Sale for the second observation is $30,000.)
Question : You have been given below dataset
You run the below program
data course100 (drop=COURSE_ID); merge course101 (in=in_first rename=(DATE=TRAINING_DATE)) course102 (drop=FEE in=in_second rename=(DATE=REGISTRATION_DATE)) ; by COURSE_ID; if in_first and in_second; run;
What is the output?
1. Merged data will be generated wherever column name matches and course_id will be dropped.
2. In merged data DATE columns will not be renamed.