Premium

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



Question :
The following SAS program is submitted: (left image)

What new variables are created?

  :
1. Difcount1, Difcount2 and Difcount3
2. Diff1, Diff2 and Diff3
3. Access Mostly Uused Products by 50000+ Subscribers
4. Patients1, Patients2 and Patients3

Correct Answer : Get Lastest Questions and Answer :

Explanation:




Question :
Given the raw data record in the file phone.txt:
Which SAS statement completes the program and results in a value of "James Stevens" for the
variableFullName?

  :
1. FullName=CATX(' ',EmpFName,EmpLName);
2. FullName=CAT(' ',EmpFName,EmpLName);
3. Access Mostly Uused Products by 50000+ Subscribers
4. FullName=EmpFName + EmpLName;

Correct Answer : Get Lastest Questions and Answer :

Explanation:



Question :

A realtor has two customers. One customer wants to view a list of homes selling for less than $60,000. The other customer wants
to view a list of homes selling for greater than $100,000.
Assuming the PRICE variable is numeric, which one of the following PRINT procedure steps will select all desired observations?

 :
1. proc print data = sasuser.houses;
where price lt 60000;
where price gt 100000;
run;
2. proc print data = sasuser.houses;
where price lt 60000 or price gt 100000;
run;
3. Access Mostly Uused Products by 50000+ Subscribers
where price lt 60000 and price gt 100000;
run;
4. proc print data = sasuser.houses;
where price lt 60000 or where price gt 100000;
run;
Ans : 2
Exp : 'OR' gives either of one condition whereas we need both condition results , so answer is B. 'OR' means either one of d conditions shd b true. In this case both the
conditions are true, so it will give desired observations. Here if we use 'AND' it will search for the observations in which both the conditions are true at d same time. ie. the
obs where the price is ln 60000 and also the preice is gt100000. Hence answer is not correct.

'OR' means either one of d conditions shd b true. In this case both the conditions are true, so it will give desired observations. Here if we use 'AND' it will search for the
observations in which both the conditions are true at d same time. ie. the obs where the price is ln 60000 and also the preice is gt100000. Hence answer is not correct.




Question : The value is stored in a numeric variable.
Which one of the following SAS formats is used to display the value as $110,700.00 in a report?
 :
1. comma8.2
2. comma11.2
3. Access Mostly Uused Products by 50000+ Subscribers
4. dollar11.2
Ans : 4

Exp : the total width is 11 not 8, so it comes down to either of dollar11.2 or comma11.2. But comma11.2 does not insert dollar sign along with comma. So the answer is 4.

when you use comma11.2 as an informat, sas removes dollar signs, commas and percent signs(if they exist in the value you are trying to read) whereas the format dollar11.2 inserts a
dollar sign and a comma.




Question :
The SAS data set BANKS is listed below:
BANKS
name rate
FirstCapital 0.0718
DirectBank 0.0721
VirtualDirect 0.0728
The following SAS program is submitted:
data newbank;
do year = 1 to 3;
set banks;
capital + 5000;
end;
run;
Which one of the following represents how many observations and variables will exist in the SAS data set NEWBANK?


 :
1. 0 observations and 0 variables
2. 1 observations and 4 variables
3. Access Mostly Uused Products by 50000+ Subscribers
4. 9 observations and 2 variables

Ans : 2
Exp :

The four variables are Name, Rate, Year, Capital. we have three variables in the dataset, when we set the dataset in the do loop it reads the three observations from data set
banks (as the set statement is called thrice) when they do loop terminates the value for year is 4 and the implicit output is executed at run;

this causes the observation to be written in the new data set. since all three observations are read in the the do loop the data step gets terminated and only one observations is
written since we have two additional variables in the data step year and capital we get total of 4 variables




Question :

The following SAS program is submitted:
data work.clients;
calls = 6;
do while (calls le 6);
calls + 1;
end;
run;
Which one of the following is the value of the variable CALLS in the output data set?



 :
1. 4
2. 5
3. Access Mostly Uused Products by 50000+ Subscribers
4. 7
Ans : 4
Exp : Please note the difference between do while and do until:


DO WHILE
The while test is evaluated at the top of the loop.

DO UNTIL
The until test is evaluated at the bottom of the loop.

DO WHILE (evaluates at the top of the loop) Now, calls=6 is equal to 6 therefore calls le 6 is TRUE. DO LOOP is executed. So, calls = calls +1 = 7

Now, calls=7 is greater than 6 therefore calls le 6 is FALSE. DO LOOP is not executed.

Hence, the value of calls remains 7

here, note that the operator is LE (less than or equal to). So the condition is true the first time.
Calls = 6 and it becomes Calls + 1 => 6+1 = 7.

The loop stops executing as the value of calls becomes greater than 6. Thus, output is 7.




Question :

The following SAS program is submitted:
data work.pieces;
do while (n lt 6);
n + 1;
end;
run;
Which one of the following is the value of the variable N in the output data set?



 :
1. 4
2. 5
3. Access Mostly Uused Products by 50000+ Subscribers
4. 7
Ans : 3
Exp : DO WHILE
The while test is evaluated at the top of the loop.

DO UNTIL
The until test is evaluated at the bottom of the loop.


DO WHILE (evaluates at the top of the loop). [Remember: SAS gives value starting from 0, if value not defined] n=0, 1, 2, 3, 4, 5 than n is lt (less than) 6 therefore n lt 6 is TRUE.
DO LOOP is executed.
Adding plus 1 at every iteration.
Now, when n=6 at top, it is not less than 6 therefore condition n lt 6 is FALSE. DO LOOP is not executed.
Hence, the value of n remains 6

because of n+1 statement we assume a implicit retain n 0; statment.
First loop (0 lt 6) => true => n = 1
Second loop (1 lt 6) => true => n= 2
......
last loop (6 lt 6) => false => do while exits and pdv writes 6 as value of n in output dataset.




Question :

Suppose the YEARCUTOFF= system option is set to 1920. An input file contains the date expression 12/08/1925,
which is being read with the MMDDYY8. informat. Which date will appear in your data?


 :
1. 08DEC1920
2. 08DEC1925
3. Access Mostly Uused Products by 50000+ Subscribers
4. 08DEC2025
Ans : 3
Exp : The w value of the informat MMDDYY8. is too small to read the entire value, so the last two digits of the year are truncated. The last two digits thus become 19 instead of 25.
Because the YEARCUTOFF= system option is set to 1920, SAS interprets this year as 2019. To avoid such errors, be sure to specify an informat that is wide enough for your date
expressions



Question :

Suppose your program creates two variables from an input file. Both variables are stored as
SAS date values: FirstDay records the start of a billing cycle, and LastDay records the end of that cycle.
The code for calculating the total number of days in the cycle would be:


 :
1. TotDays=lastday-firstday;
2. TotDays=lastday-firstday+1;
3. Access Mostly Uused Products by 50000+ Subscribers
4. You cannot use date values in calculations.
Ans : 2
Exp : To find the number of days spanned by two dates, subtract the first day from the last day and add one. Because SAS date values are numeric values, they can easily be used in
calculations





Question :

You can position the input pointer on a specific record by using


 :
1. column pointer controls
2. column specifications.
3. Access Mostly Uused Products by 50000+ Subscribers
4. line hold specifiers.

Ans : 3
Exp : Information for one observation can be spread out over several records. You can write one INPUT statement that contains line pointer controls to specify the record(s) from
which values are read.



Question : When you are creating a custom format using FORMAT procedure, than which of the following statement is correct?

 :
1. Format name and Data set name should be same.

2. Format name should be longer the 2 character

3. Access Mostly Uused Products by 50000+ Subscribers

4. Format name should start with the $ sign only in case, it is applied to the character variable

5. Format name should start with the $ sign only in case, it is applied to the character variable


Correct Answer : Get Lastest Questions and Answer :
Explanation: Format name should start with the $ sign if that needs to be applied to the character variable.


Related Questions


Question : The following code was modified to
generate the results further below:

proc format;
value agegrp
low-12 ='Pre-Teen'
13-high = 'Teen';
run;
proc means data=SASHELP.CLASS;
var Height;
class Sex Age;
format Age agegrp.;
run;
The following results were generated to display
only specific statistics and limit the decimals with the
modification: Which statement below was
modified or added to generate the results above:
 : The following code was modified to
1. var Height / nobs min max mean maxdec=1;
2. proc means data=SASHELP.CLASS maxdec=1 ;
3. Access Mostly Uused Products by 50000+ Subscribers
4. output nobs min max mean maxdec=1;



Question :

The following SAS program is submitted:

What types of variables are DayOfMonth, MonthOfYear, and Year?
 :
1. DayOfMonth, Year, and MonthOfYear are character.
2. DayOfMonth, Year, and MonthOfYear are numeric.
3. Access Mostly Uused Products by 50000+ Subscribers
4. DayOfMonth, Year, and MonthOfYear are date values.


Question :

The following SAS program is submitted:
data ONE TWO SASUSER.TWO
set SASUSER.ONE;
run;
Assuming that SASUSER.ONE exists, how many temporary and permanent SAS data sets are created?
 :
1. 2 temporary and 1 permanent SAS data sets are created
2. 3 temporary and 2 permanent SAS data sets are created
3. Access Mostly Uused Products by 50000+ Subscribers
4. there is an error and no new data sets are created


Question :

Which statement is true concerning the SAS automatic variable _ERROR_?
 :
1. It cannot be used in an if/then condition.
2. It cannot be used in an assignment statement.
3. Access Mostly Uused Products by 50000+ Subscribers
4. It is automatically dropped.



Question :
Given the SAS data set WORK.TEMPS:
 :
1. a
2. b
3. Access Mostly Uused Products by 50000+ Subscribers
4. d



Question :
The following SAS program is submitted:
data WORK.ACCOUNTING;
set WORK.DEPARTMENT;
label Jobcode='Job Description';
run;
Which statement is true about the output dataset?
 :
1. The label of the variable Jobcode is Job (only the first word).
2. The label of the variable Jobcode is Job Desc (only the first 8 characters).
3. Access Mostly Uused Products by 50000+ Subscribers
4. The program fails to execute due to errors. Labels must be defined in a PROC step.