Premium

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



Question :

The following SAS program is submitted:
data work.month;
date = input('13mar2000',date9.);
run;
Which one of the following represents the type and length of the variable DATE in the output data set?


 :
1. numeric, 8 bytes
2. numeric, 9 bytes
3. Access Mostly Uused Products by 50000+ Subscribers
4. character, 9 bytes

Correct Answer : Get Lastest Questions and Answer :
As input function converts character variable to numeric variables and numeric variables are always stored in 8 bytes. Input function converts character data to numeric. Numbers are
always stored in 8 byte even when number is as low as 0 or as high as 10000000...

So correct answer is A, date will be numeric variable with 8 byte length.






Question :

The following SAS program is submitted:
data work.products;
Product_Number = 5461;
Item = '1001';
Item_Reference = Item'/'Product_Number;
run;
Which one of the following is the value of the variable ITEM_REFERENCE in the output data set?
 :
1. 1001/5461
2. 1001/ 5461
3. Access Mostly Uused Products by 50000+ Subscribers
4. The value cannot be determined as the program fails to execute due to errors.

Correct Answer : Get Lastest Questions and Answer :
Explanation: The program fails to execute due to errors. Since there is no concatenate symbol between them.
133 Item_Reference = Item '/' Product_Number;
--- --------------
388 202
ERROR 388-185: Expecting an arithmetic operator.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
1) Item_Reference = Item'/'Product_Number;
SAS tries to solve it as an arithmetic operation but quotation
puzzles SAS as it expects arithmetic operator here
Ans: 4. The value can not be determined as the program fails to execute due to errors.

(2) Item_Reference = Item/Product_Number;
Just removing qoutation marks
Ans: Value of Item_Reference is 0.1832997619

(3) Item_Reference = Item||'/'||Product_Number;
Just adding concatenating operator
Ans : B. 1001/ 5461

(4) Item_Reference = compress(item||'/'||product_number);
Item_Reference = Item||'/'||put(Product_Number, 4.);
Item_Reference = CATX('/',Item,Product_Number);
Item_Reference = Item||'/'||strip(Product_Number);

To get the output as given in option 1
Ans: . 1001/5461





Question : The following SAS program is submitted:
data work.retail;
cost = '20000';
total = .10 * cost;
run;
Which one of the following is the value of the variable TOTAL in the output data set?

 : The following SAS program is submitted:
1. 2000
2. '2000'
1. . (missing numeric value)
2. ' ' (missing character value)

Correct Answer : Get Lastest Questions and Answer :

Explanation: to an extent, SAS automatically converts character to numeric. Even though cost is character due to automatic conversion here we are getting 2000
Because the character value is automaticaly converted to numberic by SAS.

Here's the log results
"NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column)"
cost is automatically converted to numeric.

To avoid seeing this message in log- Character values have been converted to numeric values at the places given by:
(Line):(Column).

You can explicitly convert the character values of char variable (in this case cost to numeric values by using the INPUT function.)
use informat with input. here informat is 5 becoz 20000 value:
use this prgm- msg will disappear from log. as a good programmer, your log be clear.
data work.retail;
cost = '20000';
total = .10 * cost;
run; *char values converted to num in log- to avoid this msg, give input stmt;

data work.retail1;
cost = '20000';
cost1= input (cost, 5.);
total = .10 * cost1;
run;





Related Questions


Question : Select the correct defined format from below

 : Select the correct defined format from below
1. proc format lib=library;
value location ;
1='Mumbai'
2='Pune'
3='Chennai';
run;


2. proc format lib=library;
value location
1='Mumbai'
2='Pune'
3='Chennai';
run;


3. Access Mostly Uused Products by 50000+ Subscribers
value location
1='Mumbai'
2='Pune'
3='Chennai'
run;


4. proc format lib=library;
value location ;
1='Mumbai' ;
2='Pune';
3='Chennai';
run;



Question : While creating a user defined formats, what all are possible values?
A. You can use single value like 100 or 'H'
B. You can use the range of values like 0-100
C. You can use character range like 'A'-'G'
D. You can define a list which can contain anything lile 'A' ,100, 200, 'SAS' etc.


 : While creating a user defined formats, what all are possible values?
1. A,B,C
2. B,C,D
3. Access Mostly Uused Products by 50000+ Subscribers
4. A,B,D


Question : Which pointer control can be used to read records non-sequentially?

  : Which pointer control can be used to read records non-sequentially?
1. @n
2. #n
1. +n
2. /
Ans : 2
Exp : The #n line pointer control is used to read records non-sequentially. The #n specifies the absolute number of the line to which you want to move the pointer.


Question : While creating user defined format and you want to specify particular label for a particular value in data set. What is the maximum
possible character length for a label?

  : Which pointer control can be used to read records non-sequentially?
1. 32

2. 8

3. Access Mostly Uused Products by 50000+ Subscribers

4. 256

5. 32,767



Question : While creating a user defined format, you are creating a format for the numeric values. However, you know in your dataset it is possible
some values are missing than you also want to give label to the missing values as well. So what keyword you will be using as part of PROC FORMAT VALUE
statement?

 : While creating a user defined format, you are creating a format for the numeric values. However, you know in your dataset it is possible
1. NULL

2. MISSING

3. Access Mostly Uused Products by 50000+ Subscribers

4. OTHER

5. UNKNOWN



Question : Which of the following statement is correct with regards to the FORMAT PROCEDURE?
 : Which of the following statement is correct with regards to the FORMAT PROCEDURE?
1. When you use FORMAT as part of DATA step than FORMAT definition will be stored permanently with the data.

2. When you use FORMAT as part of PROC step than FORMAT definition will be stored permanently with the data.

3. Access Mostly Uused Products by 50000+ Subscribers

4. When you use FORMAT as part of PROC step than FORMAT definition will replace the existing label.



Question : You have created a format named HEFORMAT, when you want to apply this format to COURSE_NAME, what is the correct code syntax?

 : You have created a format named HEFORMAT, when you want to apply this format to COURSE_NAME, what is the correct code syntax?
1. Format COURSE_NAEM HEFORMAT;

2. Format COURSE_NAEM HEFORMAT. ;

3. Access Mostly Uused Products by 50000+ Subscribers

4. Format COURSE_NAEM=HEFORMAT;