Premium

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



Question : Select the correct statement which is not an advantage of column input, while Reading Raw Data with the INPUT Statement?

  : Select the correct statement which is not an advantage of column input, while Reading Raw Data with the INPUT Statement?
1. It can be used to read character variables that contain embedded blanks
2. No placeholder is required for missing data.
3. Access Mostly Uused Products by 50000+ Subscribers
4. Fields do not have to be separated by blanks or other delimiters

Correct Answer : Get Lastest Questions and Answer :


Explanation: Column input is useful for reading standard values only.

Column input enables you to read standard data values that are aligned in columns in the data records. Specify the variable name, followed by a dollar sign ($) if it is a character
variable, and specify the columns in which the data values are located in each record:
data scores;
infile datalines truncover;
input name $ 1-12 score2 17-20 score1 27-30;
datalines;
Riley 1132 987
Henderson 1015 1102
;
Note: Use the TRUNCOVER option in the INFILE statement to ensure that SAS handles data values of varying lengths appropriately. [cautionend]
To use column input, data values must be:
in the same field on all the input lines
in standard numeric or character form.
Note: You cannot use an informat with column input. [cautionend]
Features of column input include the following:
Character values can contain embedded blanks.
Character values can be from 1 to 32,767 characters long.
Placeholders, such as a single period (.), are not required for missing data.
Input values can be read in any order, regardless of their position in the record.
Values or parts of values can be reread.
Both leading and trailing blanks within the field are ignored.
Values do not need to be separated by blanks or other delimiters.




Question : Which of the following program correctly reads the instream data


 : Which of the following program correctly reads the instream data
1. A
2. B
3. Access Mostly Uused Products by 50000+ Subscribers

Correct Answer : Get Lastest Questions and Answer :
Explanation: Because, it is fixed width data. Hence, column positions are required. And at the same time you have to provide datalines; or
cards; statement to read inline data. If condition is required only for filtering out the data. Based on this option B is correct.




Question : You have been given below dataset

You need to process the dataset which has either MUMBAI or AHMEDABAD as a location and fee is higher than 500, which of the following statement is
correct for this?

 : You have been given below dataset
1. if fee=5000 and location NOT in ('MUMBAI' ,'AHMEDABAD');

2. if fee>=5000 and location AND ('MUMBAI' ,'AHMEDABAD');

3. Access Mostly Uused Products by 50000+ Subscribers

4. if fee>5000 OR location OR ('MUMBAI' ,'AHMEDABAD');


Correct Answer : Get Lastest Questions and Answer :
Explanation: To filter the data you can use if statement. However, you should be aware how the operators can be used. In this case IN clause
will help you to filter the records which only satisfy the one of the condition in parenthesis. As well as greater than symbol will be used to satisfy
fee condition. To satisfy all the conditions together you can use and operator for that.


Related Questions


Question :
The following SAS program is submitted:
data work.accounting;
set work.dept1 work.dept2;
run;
A character variable named JOBCODE is contained in both the WORK.DEPT1 and WORK.DEPT2 SAS data sets. The variable
JOBCODE has a length of 5 in the WORK.DEPT1 data set and a length of 7 in the WORK.DEPT2 data set.
Which one of the following is the length of the variable JOBCODE in the output data set?

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



Question :
The following SAS DATA step is submitted:
data work.accounting;
set work.department;
length jobcode $ 12;
run;
The WORK.DEPARTMENT SAS data set contains a character variable named JOBCODE with a length of 5.
Which one of the following is the length of the variable JOBCODE in the output data set?


  :
1. 5
2. 8
3. Access Mostly Uused Products by 50000+ Subscribers
4. The length can not be determined as the program fails to execute due to errors.


Question :
Which one of the following SAS statements renames two variables?

  :
1. set work.dept1
work.dept2(rename = (jcode = jobcode)
(sal = salary));
2. set work.dept1
work.dept2(rename = (jcode = jobcode
sal = salary));
3. Access Mostly Uused Products by 50000+ Subscribers
work.dept2(rename = jcode = jobcode
sal = salary);
4. set work.dept1
work.dept2(rename = (jcode jobcode)
(sal salary));




Question :

The following SAS program is submitted:
data work.company;
set work.dept1(keep = jobcode)
work.dept2(rename = (jcode = jobcode));
run;
Which one of the following is the result?

  :
1. The variable JCODE is written to the output data set.
2. The variable JOBCODE is written to the output data set.
3. Access Mostly Uused Products by 50000+ Subscribers
4. The program fails to execute due to errors.


Question :

The following SAS program is submitted:
data work.passengers;
if OrigPassengers = . then
OrigPassengers = 100;
TransPassengers = 100;
OrigPassengers = .;
NonPaying = 10;
TotalPassengers = sum (OrigPassengers, TransPassengers);
run;
Which one of the following is the value of the TOTALPASSENGERS variable in the output data set?



  :
1. 100
2. 110
3. Access Mostly Uused Products by 50000+ Subscribers
4. . (missing numeric value)




Question :

The following SAS program is submitted:
data work.staff;
JobCategory = 'FA';
JobLevel = '1';
JobCategory = JobCategory || JobLevel;
run;
Which one of the following is the value of the variable JOBCATEGORY in the output data set?

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