The contents of the raw data file AMOUNT are listed below:
--------10-------20-------30
$1,234
The following SAS program is submitted:
data test;
infile 'amount';
input @1 salary 6.;
if _error_ then description = 'Problems';
else description = 'No Problems';
run;
Which one of the following is the value of the DESCRIPTION variable?
A. Problems
B. No Problems
C. ' ' (missing character value)
D. The value can not be determined as the program fails to execute due to errors.
Click Comment link to get answer
The Answer will be A. as the program has an error which is compilation error so this will falg _ERROR_ to 1.
ReplyDeletei think the error occurs in "infile" statement.
Any suggestions!!!!
THE ANSWER WILL BE A. BUT NOT DUE TO COMPILATION ERROR, IT IS DUE TO DATA ERROR.
DeleteIN COMPILATION ERROR THE PROGRAMM STOP NOT EXECUTED. HERE THE PROGRAMM EXECUTE FULLY WITH ERROR IN LOG WINDOW.
I agree with you Anonymous.
DeleteWhich Anonymous you agreeing with ? Every body is bloody anonymous here.
Delete:D :D
DeleteThis comment has been removed by the author.
ReplyDeleteAnswer A
ReplyDeleteAnswer is A
ReplyDeleteIts' A
ReplyDeleteyes A us answer, if we follow informat dollar8. what is value of desc variable ?
ReplyDeleteyes A us answer, if we follow informat dollar8. what is value of desc variable ?
ReplyDeleteAns is A.. madhu
ReplyDeleteAnswer is A. But if use the informat COMMA6.0 in input function then it will not give any error.
ReplyDeleteThe Answer is ultimately A. Problems
ReplyDeleteReason:
Input statment should be like below;
input @1 salary dollar6.;
or
input @1 salary comma6.;
No problem ans B
ReplyDeleteThe answer is A if your SAS environment allows variable names longer than 8 characters. If not (like mine) then the answer is D as it fails to execute.
ReplyDeleteThe Answer is "A" as the informat provided in incorrect & sas cannot read $ and , symbols by giving 6. informat.....
ReplyDeleteso, it gives _error_ = 1
so it will take the value to be "problem" for the description variable..
the answer is A
ReplyDeleteit is data error so the program executes and salary will have a missing numeric value which is period and description as problems
D
ReplyDeleteSalary is in non-standard numeric format and hence SAS cannot read without using informat. SAS generates error and print the decription as problems in list file and sets salary as missing value.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteI agree
Deleteans is D.....
ReplyDeleteAnswer is D ; As infile 'amout" says physical file doesnot exist
ReplyDeleteA?
ReplyDeleteD is the correct answer
ReplyDeleteIts A, SAS will throw an error in compiling the statement , there is a "Problem" in the code
ReplyDeleteMy friends here he ask about variable description so answer is "A"........ :)
ReplyDelete3
ReplyDeleteyes ans is B coz programe is successully run. but salary is missing their not issue
ReplyDeleteA
ReplyDeleteI think I agree with hayder, that the ans is B It is a data error and that won;t stop the program from executing.
ReplyDeleteCan the admin plz comment
correct answer is D
ReplyDeleteANSWER A
ReplyDeleteAnswer A:
ReplyDeleteIncorrect informat in the input statement, salary is missing '.' during execution, the if statement executes, assigning the description text, with _error_ = 1.
B is ruled out, for another reason - because the length of the variable description is determined in the if statement by the character string first encountered: 'Problems' during compilation, so that if _error_ = 0 a truncated 'No Probl' (8 characters) would be stored in the variable and appear in the dataset not 'No Problems'.
(That's almost funny. :-/)
The statement:
length description $ 11;
prior to the if statement is required to avoid this.
Nigel
d
ReplyDeleteI guessed D but then I tried it (SAS 9.3) and A is correct.
ReplyDeletethe answer is C.
ReplyDeleteThe only problem is that of informat. The correct one is input @1 salary DOLLAR6.
no its A or D..will the SAS run a program if a wrong informat is written for a variable value???
ReplyDeleteSAME QUESTION HERE
DeleteI will do the exam and with this dicussion i can't understand the correct answer.
ReplyDeleteFor me the corret answer is D, but i any tried.
answer is A, i had copy paste it on sas 9.2 and gt d result error =problems means A
ReplyDeleteA is the correct answer for sure.
ReplyDeleteA
ReplyDeleteAnswer is A:
ReplyDeleteans is A. I THINK THE PROBLEM IS IN INPUT METHOD.
ReplyDeleteA, problems.
ReplyDeleteA can be the answer
ReplyDelete/* this syntax will generate $1,234 No Problem out put; use length statement in order not to truncate No Problem; as per the error is in the salary 6 statement */
ReplyDeletedata amount;
input @1 salary dollar6.;
format salary dollar6.;
length description $12;
if _error_ then description = 'Problems';
else description = 'No Problems';
datalines;
$1,234
;
run;
ans is a
ReplyDeleteDoes it matter that the file is in all caps "AMOUNT" but the statement calls for infile 'amount' ?? The SAS base 9 guide says things in ' ' are usually case-sensitive...
ReplyDeleteAnswer: A
ReplyDeleteTry the below problem for extra practice:
http://sascert3.blogspot.com/2013/03/base-sas-example-question-21.html
Good luck!
the informat provided in the input statement is wrong.
ReplyDelete$1,234 should be read as a character type, so the informat should be $6. not 6. Hence there is an error.
So value of _error_=1 there fore value of description='Problems'.
This comment has been removed by the author.
ReplyDeleteAnswer is D. The error is an execution time error which is mainly of two types- Invalid Data and Invalid Fileref. In the first case the program will compile and execute but in the latter case the program compiles but does not execute and writes out an ERROR: "Invalid Fileref".
ReplyDeleteYes the answer is D no execution happened so that no any value will be assigned to description.
Deleteyep, I agree it should be D. There is no path mentioned in 'infile' statement or does it refer to work.amount where amount refers to work.amount?
ReplyDeleted
ReplyDeleteA
ReplyDeletea
ReplyDeleteA
ReplyDeleteA
ReplyDeleteA
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteHere is the output from sas 9.4:
ReplyDeleteObs salary description
1 4 No probl
For latest and updated SAS certification dumps in PDF format. contact us at completeexamcollection@gmail.com.
ReplyDeleteRefer our blog for more details: http://completeexamcollection.blogspot.in/2015/12/sas-certification-dumps.html
Very useful and informative blog and article , thank you for sharing with us keep posting selenium training,selenium online training,selenium training in bangalore, selenium job oriented training in bangalore
ReplyDeleteA
ReplyDeletewelcome to glub casino for play games online !
ReplyDeletegclub
gclub casino online
It's interesting that many of the bloggers to helped clarify a few things for me as well as giving.Most of ideas can be nice content.The people to give them a good shake to get your point and across the command.
ReplyDeleteTableau Online Training|
SAS Online Training
R Programming Online Training|
This comment has been removed by the author.
ReplyDeletethose who are interested to learning the sas program this very helpful..learn the sas program to achieve economical benchmark.SAS Training in Chennai
ReplyDeleteCan anyone please explain use of below line in this question
ReplyDelete——–10——-20——-30
A
ReplyDeleteSerial key for VRay Next 5.10.05 for SketchUp 2017-2021 can be found and viewed here. We have the largest serial numbers data base.
ReplyDeleteRelated searches VRay Crack
pg slot 6g มาแรง ที่สุด ในตอนนี้ เป็นเรื่องที่น่าสนใจอย่างมากในวงการเกม PG สล็อตออนไลน์ในปัจจุบัน ซึ่งมีการพัฒนาและนวัตกรรมที่ทันสมัยเข้ามาเพื่อให้ผู้เล่นได้สัมผัสประสบการณ์การเล่นที่ยิ่งใหญ่และเพลิดเพลินไปกับความตื่นเต้น
ReplyDelete