欢迎来到天天文库
浏览记录
ID:48024644
大小:311.63 KB
页数:25页
时间:2020-01-23
《SAS_Adv最强机经.pdf》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、我的机经补充leftjoinandin-lineviewProductProduct_idProduct110012100231003SalesProduct_idSales310012005100120031001100Procsql;Selectp.products.totalsalesFromproductaspleftjoin(selectsum(sales)astotalsalesfromsalesass)onp.product_id=s.product_id;quit;Whatistheoutput?Answer:ProductTotalsales10015001
2、002.1003200No.4from63题库干扰选项:intogroupseparate=’,’正确选项into:GROUPSseparatedby','关于view考了三道题,(1)哪个个view的命名code正确?dataxxx/view=xxx(view和dataset的命名必须一样)(2)q.11变型,改了dataset命名,并且只生成一个dataset。选项原理木有改。(2)生成了view之后在procmean中如何引用?和普通dataset一样。(后面机经总结中也有)Procsortdata=xxxNodupkey;Byvar;考了三道(1)q.45题目明确un
3、sorteddataset,所以first那个不能用(2)给了dataset和desiredoutput,要求选code。发现是要生成uniquevalueofkeyvariable.只有procsortnodupkey;byvar的选项对,有干扰选项procsortnodup;byvar;(3)后面机经中提到的q.45变型Iin-lineview另外还考了一道题,给了一段code明确告知in-lineview中给定的condition有multiplyobservationssatisfiedthecondition,问program运行结果。答案是运行出错没有结果,因为i
4、n-lineviewreturnmultipleresults.考到的填空题目(后面论坛机经总结中有详细题目)outunioncorraverageof…is7%put_Global_;HashAlpha人大经济论坛机经总结NewquestionsSQL1.填空Datathree;setonetwo;run;procAppendbase=onedata=two;run;procsql;select*fromoneOUTUNIONCORRselect*fromtwo;quit;2.Mergestatementindataprocedureprocsql;FULLjoinw
5、ithcoalesce()function63题库q.13变型Note:beforeusingmergeprocedure,weneedtosortvariablefirst.Inthequestion,onetableisunsorted,sowecannotusemergeprocedure.3.in-lineview考了两道题(i)procsql;createtableforecastasselecta.*,b.salesfromactuala,_________wherea.dept=b.dept;quit;Answer:(selectavg(revenue)asav
6、eragefromBudegtgroupby1)bNote,ifselectisoutoftheparentheses,thenitiswrong.Beside,in-lineviewcannotuseorderbystatement.e.g.thefollowingcodeiswrongselect(avg(revenue)asaveragefromBudegtgroupby1)b(ii)givenafailedprogram,askthereasonoffailure.Procsql;selectJobcode,Salary,(selectavg(Salary)fromW
7、ORK.PILOTSorderbyJobcode)asAvgfromWORK.PILOTSorderbyID;quit;Answer:OrderBystatementcannotbeusedinsideofanin-lineview.Warning:Thereisanotherchoicesaysthatifusingin-lineviewthenwecannotuseOrderBystatement.Thisisnottrue.TheORDERBYIDstatementintheoutsidequer
此文档下载收益归作者所有