Premium

Base SAS Certified Associate: Programming Fundamentals Using SAS Questions and Answers (Dumps and Practice Questions)



Question :

A raw data file is listed below:

RANCH,1250,2,1,Sheppard Avenue,"$64,000"
SPLIT,1190,1,1,Rand Street,"$65,850"
CONDO,1400,2,1.5,Market Street,"80,050"
TWOSTORY,1810,4,3,Garris Street,"$107,250"
RANCH,1500,3,3,Kemble Avenue,"$86,650"
SPLIT,1615,4,3,West Drive,"94,450"
SPLIT,1305,3,1.5,Graham Avenue,"$73,650"

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';
input sqfeet bedrooms baths street $ price : dollar10.;
run;

How many observations will the output data set contain?

  :
1. 0
2. 3
3. Access Mostly Uused Products by 50000+ Subscribers
4. 7

Correct Answer : Get Lastest Questions and Answer :

Explanation: style = 'CONDO' or style = 'RANCH';

The Ans is: B. 3

RANCH,1250,.....
CONDO,1400,.....
RANCH,1500,.....

once you tell sas some condition as we have here if style = 'CONDO' or style = 'RANCH'; then it want do anything else.







Question :

A raw data file is listed below:

RANCH,1250,2,1,Sheppard Avenue,"$64,000"
SPLIT,1190,1,1,Rand Street,"$65,850"
CONDO,1400,2,1.5,Market Street,"80,050"
TWOSTORY,1810,4,3,Garris Street,"$107,250"
RANCH,1500,3,3,Kemble Avenue,"$86,650"
SPLIT,1615,4,3,West Drive,"94,450"
SPLIT,1305,3,1.5,Graham Avenue,"$73,650"

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?


  :
1. 0
2. 3
3. Access Mostly Uused Products by 50000+ Subscribers
4. 7

Correct Answer : Get Lastest Questions and Answer :

Explanation: RANCH......
SPLIT......
CONDO......
TWOSTORY...
RANCH......
SPLIT......
SPLIT......

RANCH 1250 2 1 Sheppard Avenue $64,000
SPLIT
CONDO 1400 2 1.5 Market Street $80,050
TWOSTORY
RANCH 1500 3 3 Kemble Avenue $86,650
SPLIT
SPLIT

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?

  :
1. table
2. ,table
3. Access Mostly Uused Products by 50000+ Subscribers
4. ' ' (missing character value)

Correct Answer : Get Lastest Questions and Answer :

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.





Related Questions


Question : You have been given below dataset

And program as below
data course100;
merge course101 (rename=(FEE=TRAINING_FEE))
course102 (rename=(FEE=REGISTRATION_FEE)) ;
by COURSE_ID;
run;

What is the expected once you run above program?

 : You have been given below dataset
1. All the observation which does not have same course_id in both the dataset will be discarded.

2. Merged output will be generated and FEE columns will be re-named in the output.

3. Access Mostly Uused Products by 50000+ Subscribers

4. Program will generate error



Question : Which of the following statements is true regarding direct access of data sets?


  : Which of the following statements is true regarding direct access of data sets?
1. a
2. b
3. Access Mostly Uused Products by 50000+ Subscribers
4. d

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?


  : Which of the following statements is true regarding direct access of data sets?
1. missing
2. $30,000
3. Access Mostly Uused Products by 50000+ Subscribers
4. you cannot concatenate these data sets

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?

  : Which of the following statements is true regarding direct access of data sets?
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.

3. Access Mostly Uused Products by 50000+ Subscribers

4. In output only Fee column will be dropped.



Question : You have been given below datasets

Now you merge all these three datasets using course_id, what would be values of location column in 5th observation?

 : You have been given below datasets
1. MUMBAI

2. PUNE

3. Access Mostly Uused Products by 50000+ Subscribers

4. HYDERABAD

5. CHENNAI



Question : You have been working as a data analysts in HadoopExam Inc. recently you have moved from Python programming to SAS programming, and start
using Do looping of SAS. Which of the following statement is correct with regards to Do loop?

A. You can use conditions in the Do loop.
B. It will always generate one observations.
C. It can be used in both DATA and PROC steps
D. It can be used read data as well as producing multiple observation using output statement.

 : You have been working as a data analysts in HadoopExam Inc. recently you have moved from Python programming to SAS programming, and start
1. A,B
2. B,C
3. Access Mostly Uused Products by 50000+ Subscribers
4. A,D
5. B,D


Question : You have been given below SAS program

data course100;
Fee=5000;
FEE_HIKE=0.1;

do month=1 to 12;
put _all_;
TOTALFEE+(FEE+TOTALFEE)*FEE_HIKE;
end;
run;

How many time do loop will be iterated?

 : You have been given below SAS program
1. 0

2. 1

3. Access Mostly Uused Products by 50000+ Subscribers

4. 11



Question :
Which function calculates the average of the variables Var1, Var2, Var3, and Var4?
  :
1. mean(var1,var4)
2. mean(var1-var4)
3. Access Mostly Uused Products by 50000+ Subscribers
4. mean(of var1-var4)
Ans : 4
Exp : Use a variable list to specify a range of variables as the function argument. When specifying a variable list, be sure to precede the list with the word OF. If you omit the
word OF, the function argument might not be interpreted as expected.



Question : You have been given below program

data course100 ;
Fee=5000;
FEE_HIKE=0.1;

XXXXX
put _all_;
INCREASE+(FEE+INCREASE)*FEE_HIKE;
iteration+1;
output;
end;
run;

Replace XXXXX values with the DO statement, so that code under which will be executed 20 times?

  :
1. do month=20 to 1 by -1;

2. do month=20 to 1 by 1;

3. Access Mostly Uused Products by 50000+ Subscribers

4. do month++=20 to 1 by -1;