Question 1 : A SAS program is submitted and the following SAS log is produced:
2 data gt100;
3 set ia.airplanes
4 if mpg gt 100 then output;
22 202
ERROR: File WORK.IF.DATA does not exist.
ERROR: File WORK.MPG.DATA does not exist.
ERROR: File WORK.GT.DATA does not exist.
ERROR: File WORK.THEN.DATA does not exist.
ERROR: File WORK.OUTPUT.DATA does not exist.
ERROR 22-322: Syntax error, expecting one of the following: a name,
a quoted string, (, ;, END, KEY, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
5 run;
The IA libref was previously assigned in this SAS session.
Which one of the following corrects the errors in the LOG?


1.DeletethewordTHENontheIFstatement.
2.AddasemicolonattheendoftheSETstatement.
3.PlacequotesaroundthevalueontheIFstatement.
4.AddanENDstatementtoconcludetheIFstatement

CorrectAnswer2:


Exp:InSETstatementsemicolonismissing,soSASisconsideringeachwordafterSETasaseparatedatasetwhichiscreatinganError.
SoplacingthesemicoloninSETstatementwillservethepurpose.
WhatSETDoes
EachtimetheSETstatementisexecuted,SASreadsoneobservationintotheprogramdatavector.SETreadsallvariablesandallobservationsfromtheinputdatasetsunlessyoutell
SAStodootherwise.ASETstatementcancontainmultipledatasets;aDATAstepcancontainmultipleSETstatements.SeeCombiningandModifyingSASDataSets:Examples.
Uses
TheSETstatementisflexibleandhasavarietyofusesinSASprogramming.TheseusesaredeterminedbytheoptionsandstatementsthatyouusewiththeSETstatement:
readingobservationsandvariablesfromexistingSASdatasetsforfurtherprocessingintheDATAstep
concatenatingandinterleavingdatasets,andperformingone-to-onereadingofdatasets
readingSASdatasetsbyusingdirectaccessmethods.