Premium

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



Question : The following SAS program is submitted:

data test;
input animal1 $ animal2 $ mlgrams1 mlgrams2;
cards;
hummingbird ostrich 54000.39 90800000.87;
run;
Which one of the following represents the values of each variable in the output data set?
  : The following SAS program is submitted:
1. animal1 animal2 mlgrams1 mlgrams2
hummingb ostrich 54000.39 90800000
2. animal1 animal2 mlgrams1 mlgrams2
hummingb ostrich 54000.39 90800000.87
3. Access Mostly Uused Products by 50000+ Subscribers
hummingbird ostrich 54000.39 90800000
4. animal1 animal2 mlgrams1 mlgrams2
hummingbird ostrich 54000.39 90800000.87

Correct Answer : Get Lastest Questions and Answer :

Explanation: The CARDS statement is an alias for the DATALINES statement. In the INPUT statement, you must specify a dollar sign ($) after the variable name in order to define a character
variable. If you do not specify otherwise, the default storage length for a variable is 8. In the example above, the character value hummingbird is truncated to hummingb.

Value 8 byte can store a lot. And the string is not the same.
length 8 bytes say is byte, not read into the format width, informat wd w refers to the width of a column width.
" numeric variable's default length should be N8, so max length can be 2 ** 64-1"
The maximum length of the integer 8 2 ** 64-1 bytes represented by the stored energy.
-
So this figure can 8bytes that out, do not delete the bit
-
numeric length 8 bits are stored, not eight digits
But the format and informat w.d concerned with digits




Question :The SAS data sets Work.Employee and Work.Salary are shown below.

Work.Employee
fname age
Bruce 30
Dan 40

Work.Salary
fname salary
Bruce 25000
Bruce 35000
Dan 25000
The following merged SAS data set is generated:

Work.Empdata
fname age totsal
Bruce 30 60000
Dan 40 25000
Which one of the following SAS programs created the merged data set?
a. data work.empdata;
merge work.employee
work.salary; by fname; if first.fname then totsal=0;
totsal+salary; if last.fname then output; run;
b. data work.empdata(drop=salary);
merge work.employee
work.salary; by fname;
if first.fname then totsal=0; totsal+salary; if last.fname then output; run;
c. data work.empdata; merge work.employee
work.salary(drop=salary);
by fname; if first.fname then total=0; totsal+salary; if last.fname then output; run;
d. data work.empdata; merge work.employee
work.salary; by fname; if first.fname then total+salary; run;
  :The SAS data sets Work.Employee and Work.Salary are shown below.
1. a
2. b
3. Access Mostly Uused Products by 50000+ Subscribers
4. d

Correct Answer : Get Lastest Questions and Answer :
Explanation: The MERGE and BY statements allow you to match-merge two or more SAS data sets. The BY statement creates two temporary variables, First.Fname and Last.Fname
for BY group processing. The SUM statement is used to add salary for each BY group. The variable on the left side of the plus sign is the variable that is retained and has an initial
value of 0. The expression on the right side of the plus sign is added to the variable on the left side of the plus sign to create a grand total. The accumulating variable, totsal,
is reset back to 0 when you encounter a new BY group value (First.Fname is true). To output just the totals for each BY group, use the explicit OUTPUT statement when you reach the
last occurrence of each Fname value.




Question :
name age
Janice 10
Henri 11
Michele 11
Susan 12
The following SAS program is submitted using the Sasdata.Group data set as input:

libname sasdata 'SAS-data-library';
data group;
set sasdata.group;
file 'file-specification';
put name $15. @5 age 2.;
run;

Which one of the following describes the output created?
  :
1. a raw data file only
2. a SAS data set named Group only
3. Access Mostly Uused Products by 50000+ Subscribers
4. The program fails execution due to errors.

Correct Answer : Get Lastest Questions and Answer :

Explanation: The DATA step creates a temporary data set named Group and reads data from the permanent SAS data set named Sasdata.Group into it. The FILE statement creates a raw data file by
writing out values for the variables Name and Age to the file that is specified within the quotation marks.
Reading is infile, input is saved file, put
-
If you do not want to simultaneously generate a data set, you can use null
-
data _null_;
set clinic.stress;
file 'c: \ clinic \ patients \ stress.dat';
put id 1-4 name 6-25 resthr 27-29 maxhr 31-33
rechr 35-37 timemin 39-40 timesec 42-43 tolerance 45 totaltime 47-49;



Related Questions


Question : You have been given below datasets


Which of the above can be correctly read using Column Input format?

 : You have been given below  datasets
1. Image1
2. Image2
3. Access Mostly Uused Products by 50000+ Subscribers


Question : You have been given below raw data at دfolders/myfolders/hedata/wrongdata.dat

Which of the following program can generate output as below.

A.
filename allhecrs '/folders/myfolders/hedata/wrongdata.dat';
data course2017;
infile allhecrs;
input COURSE_ID COURSE_NAME$ LOCATION$ FEE ;
run;
proc print data=course2017;
run;

B.

filename allhecrs '/folders/myfolders/hedata/wrongdata.dat';
data course2017;
infile wrongdata.dat;
input COURSE_ID 1-3 COURSE_NAME$ 5-20 LOCATION$ 22-30 FEE 32-35;
run;
proc print data=course2017;
run;

C.
filename allhecrs '/folders/myfolders/hedata/wrongdata.dat';
data course2017;
infile allhecrs;
input COURSE_ID 1-3 COURSE_NAME$ 5-20 LOCATION$ 22-30 FEE 32-35;
run;
proc print data=course2017;
run;

D.
libname allhecrs '/folders/myfolders/hedata/wrongdata.dat';
data course2017;
infile allhecrs;
input COURSE_ID 1-3 COURSE_NAME$ 5-20 LOCATION$ 22-30 FEE 32-35;
run;
proc print data=course2017;
run;


 : You have been given below raw data at دfolders/myfolders/hedata/wrongdata.dat
1. A


2. B


3. Access Mostly Uused Products by 50000+ Subscribers



4. D




Question : You have been given below raw data at دfolders/myfolders/hedata/wrongdata.dat

Where column widths are like that
COURSE_ID 1 to 3
COURSE_NAME 5 to 20
LOCATION 22 to 30
FEE 32-35
DATE 36-47

Which of the following program will generate output like this.

A.
data course2017;
infile allhecrs;
input COURSE_NAME$ LOCATION$ COURSE_ID FEE DATE date10.;
run;
proc print data=course2017;
run;

B.
data course2017;
infile allhecrs;
input COURSE_NAME$ 5-20 LOCATION$ 22-30 COURSE_ID 1-3 FEE 32-35 DATE date10. 36-47;
run;
proc print data=course2017;
run;

C.
data course2017;
infile allhecrs;
input COURSE_ID 1-3 COURSE_NAME$ 5-20 LOCATION$ 22-30 FEE 32-35 DATE date10. 36-47;
run;
proc print data=course2017;
run;

D.
data course2017;
infile allhecrs;
variable COURSE_NAME$ 5-20 LOCATION$ 22-30 COURSE_ID 1-3 FEE 32-35 DATE date10. 36-47;
run;
proc print data=course2017;
run;


 : You have been given below raw data at دfolders/myfolders/hedata/wrongdata.dat
1. A


2. B


3. Access Mostly Uused Products by 50000+ Subscribers


4. D



Question :

The following SAS program is submitted:

Data _null_;
set old;
put sales 1 sales2;
run;

Where is the output written?


 :
1. to the SAS log
2. to the SAS data set _NULL_
3. Access Mostly Uused Products by 50000+ Subscribers
4. to the raw data file that was most recently opened




Question : The following SAS program is submitted:

data work.test;
array items{3} _temporary_;
run;

What are the names of the variable(s) in the WORKTEST data set?
 : The following SAS program is submitted:
1. ITEMS
2. ITEMS1, ITEMS2, ITEMS3
3. Access Mostly Uused Products by 50000+ Subscribers
4. The program fails to execute because there are no variables listed on the ARRAY statement.


Question : Read the table from left

The following SAS program is submitted:
proc freq data = sales;
(insert TABLES statement here)
run;
The output is created by the FREQUENCY procedure is also shown in left:

Which TABLES statement(s) completed the program and produced the output?

 : Read the table from left
1. tables region product;
2. tables region * product;
3. Access Mostly Uused Products by 50000+ Subscribers
4. tables product; tables region;