SAS Certified Base Programmer 123 Questions (72)
The following SAS program is submitted:
data work.test; First = 'Ipswich, England'; City = substr(First,1,7); City_Country= City!!'; '!!'England'; run;
Which one of the following is the value of the variable CITY_COUNTRY in the output data set?
A. Ipswich!!
B. Ipswich, England
C. Ipswich, ‘England’
D. Ipswich , England
Topics:
SAS Base Questions |
6 Comments »
D
none of the above
by default the length is determined by the length of the first argument. so the answer would be:
Ipswich_________; England
(had to replace the blanks with unerscores because of the auto formatting, please delete the first comment)
@nurba is right
The answer would be Ipswich ; England
Please change the option D as above.
Also there would be a semicolon instead of comma.
The answer choices are wrong. the correct answer is Ipswich ; England.
try inserting put statement in DATA step
put city_country=;
you will find what nurba describes in log (I repeat, log)
use PROC print instead,
you will get the semicolon option D
This is weird