113. When the following SAS program is submitted, the data set SASDATA.PRDSALES contains 5000 observations:
libname sasdata 'SAS-data-library';
options obs = 500;
proc print data = sasdata.prdsales (firstobs = 100);
run;
options obs = max;
proc means data = sasdata.prdsales (firstobs = 500);
run;
How many observations are processed by each procedure?
A. 400 for PROC PRINT
4500 for PROC MEANS
B. 401 for PROC PRINT
4501 for PROC MEANS
C. 401 for PROC PRINT
4500 for PROC MEANS
D. 500 for PROC PRINT
5000 for PROC MEANS
libname sasdata 'SAS-data-library';
options obs = 500;
proc print data = sasdata.prdsales (firstobs = 100);
run;
options obs = max;
proc means data = sasdata.prdsales (firstobs = 500);
run;
How many observations are processed by each procedure?
A. 400 for PROC PRINT
4500 for PROC MEANS
B. 401 for PROC PRINT
4501 for PROC MEANS
C. 401 for PROC PRINT
4500 for PROC MEANS
D. 500 for PROC PRINT
5000 for PROC MEANS
114. In the following SAS program, the input data files are sorted by the NAMES variable:
libname temp 'SAS-data-library';
data temp.sales;
merge temp.sales
work.receipt;
by names;
run;
Which one of the following results occurs when this program is submitted?
A. The program executes successfully and a temporary SAS data set is created.
B. The program executes successfully and a permanent SAS data set is created.
C. The program fails execution because the same SAS data set is referenced for both read and write operations.
D. The program fails execution because the SAS data sets on the MERGE statement are in two different libraries.
input a $ b;libname temp 'SAS-data-library';
data temp.sales;
merge temp.sales
work.receipt;
by names;
run;
Which one of the following results occurs when this program is submitted?
A. The program executes successfully and a temporary SAS data set is created.
B. The program executes successfully and a permanent SAS data set is created.
C. The program fails execution because the same SAS data set is referenced for both read and write operations.
D. The program fails execution because the SAS data sets on the MERGE statement are in two different libraries.
cards;
$ 250 $100
;
What will be the value of b in the above step?
a)$100 b)100 c) . d) character missing”;
151. Which SAS function below returns an argument with leading blanks moved to the end of the value?
- infile x obs=100 lastobs=200;
- infile x firstobs=101 lastobs=201;
- infile x obs=101 lastobs=200;
- infile x firstobs=101 obs=201;
- infile x firstobs=100 obs=200;
- You must put &LIB in %NRSTR().
- You must put &DSN in %STR().
- You must add a period.
- You must add OPTIONS DLM='.' before the PROC step.
- Nothing - the sample code is correct.
- Yes.
- No. if ABS(x,.0001)=.3333 then
- No. if ROUND(x,.0001)=.3333 then
- No. if MOD(x,3)=0 then
- No. if PUT(x,.00001)=.3333 then
- If VAR1's value was repeated in TEST, then all but one of the observations with that value were removed.
- If VAR1's value was repeated in TEST, then all the observations with that value were removed, but only if the rest of the variables had identical values.
- If VAR1's value was repeated in TEST, then all the observations with that value were removed.
- The value of first.VAR1 and last.VAR1 are both equal to zero.
- If VAR1's value was repeated in TEST, then all the by variables are set to missing.
- It specifies a width of the decimal value - in this case 3 decimal places.
- It indicates that if a variable falls within .3 of the value specified in the value statement, the corresponding label is used to print the value.
- It prints the label defined in the value if the variable value contains a .3.
- It multiplies the value of the variable times .3, and if the result equals the label (a certain number as defined in the DATA step), then prints the label.
- It divides the value of the variable by .3, and if the result equals the label (a certain number as defined in the DATA step), then prints the label.
- The variable VAR1 is a character variable, and if it has a non-blank value, then assign 'added to income' to salary.
- If the variable VAR1 earned is present, then go to label marked salary=added to income.
- If the variable VAR1 is in the program data vector, then assign 'added to income' to salary.
- Select all of the observations where salary is 'added to income'.
- If the variable VAR1 is not equal to '.' or 0, then salary = 'added to income'.
- It advances the pointer to column 5 of the next input line.
- It moves the column pointer to column 5.
- It moves the pointer 5 columns.
- It moves the pointer to the line 5.
- It inputs 5 lines into one observation.
- A=1 B=4 C=wren D=not missing E=1
- A=1 B=3 C=W D=missing E=1
- A=3 B=3 C=blank D=missing E=1
- A=1 B=3 C=wren D=wren E=1
- A=1 B=4 C=W D=not missing E=1
data employee;
infile 'employee.dat'; /* Assuming directory-based system */
input id $6. name $20. @30 locale $10.;
run;
A. List
B. Column
C. Formatted
D. Mixed
E. Standard
192. True or False...(Choose one)
The extesion of ".sas" is required for sas program files.
A. True
B. False
193. Which of the following are valid statements concerning reading raw data files using list input: (Choose all
that apply)
A. The DLM= is an option for the infile statement for specifying delimiters.
B. All variables have a default length of 8 bytes.
C. When the input statement runs into an end-of-line marker, it stops reading data even
though there are more fields specified.
D. You use a $ after a variable name to specify a character variable.
E. Fields are read from left to right.
194. Given the following raw data file, offices.dat, in a directory-based system, which data step would create a
SAS data set with one observation for each region: (Choose One)
1 1 2 2 3 3 4
1234567890123456789012345678901234567890
East Maryland Vermont Maine
Central Illinois Iowa Kansas Missouri
West California Washington
195. The double trailing "@@" in an input statement...(Choose all that apply)
A. holds the current data line in the buffer for another input statement to process
B. can be used to read multiple observations from a single data line
C. loads a new record into the input buffer if an end-of-record is found in the current record
D. is a syntax error.
E. None of the above.
196. Which SAS statement below will change the characteristics of a variable if it was used in a data step?
A. SCAN
B. ATTRIB
C. FORMAT
D. PUT
E. ARRAY
197. Which X variable has a value of 1 at the end of an input file?
A. END = X
B. OBS = X
C. EOF = X
D. LASTOBS = X
198. Given a data file with 100 columns of data, you only need to read in the first 70 columns. Which of the
following could you use:
A. infile x line = 70;
B. infile x length = 71;
C. infile x missover = 70;
D. infile x ls=70;
E. infile x linesize=70;
199. In the following code sample:
data xyz;
infile abc;
input h i +3 j;
run;
What does the +3 do?
A. It moves the pointer down 3 records
B. It moves the column pointer to column 3
C. It adds 3 to the value read into variable i
D. It advances the column pointer 3 places
E. It advances the column pointer 4 places
200. What does the following SAS statement do?
if location =: 'C';
A. It selects the observation if there is a 'C' in the location value.
B. It selects the observation if there is a 'C' at the first position in the location value.
C. It selects the observation if the location value is 'C'.
D. It selects the observation if the location value contains a lowercase 'c'.
E. None of the above, it's a typo.
is there any discussion from the group members on these SAS questions? thank you.
ReplyDeleteYa sure .
Delete