Sas Question

Embed Size (px)

Citation preview

  • 7/25/2019 Sas Question

    1/30

    qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnm

    qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnm

    qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnm

    qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnm

    qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnm

    qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnm

    qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnm

    qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnm

    rtyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwe

    rtyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwe

    rtyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwe

    rtyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwe

    rtyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwe

    rtyuiopasdfghjklzxcvbnmrtyuiopasdfghjklzxcvbnmqwertyu

    iopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyu

    opasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyui

    opasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyui

    opasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyui

    opasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmrtyuiopa

    sdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopa

    sdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopa

    sdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopa

    sdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopa

    sdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopa

    sdfghjklzxcvbnmrtyuiopasdfghjklzxcvbnmqwertyuiopasdfg

    hjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfg

    hjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfg

    hjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfg

    hjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfg

    hjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmrtyuiopasdfghjklz

    SASs

    Theor

    yQuest

    ions

  • 7/25/2019 Sas Question

    2/30

    Sas Question Related to Codys Book

    Sas graph

    Q1. What is the use of sas graph?

    Sas graph help in to get quik look

    at the data in the graphial for!.Q". #o$ the appearane of the sas graphand harts an %e ontrolled?

    &t an %e ontrolled %y the graphioptions and glo%al state!ent likesy!%ol and pattern. &t $ill re!aineffet until it hanges.

    Q'. What is the Reset ( all option does in

    sas graph? Reset ( all option $ill reset all of

    the graphis options to theirdefault )alues. &t $ill also eli!inateall title and footnote state!ent*e)en also in non+graphi data.

    Q,. -ist so!e graphis options $hih an%e used in the /0T&/S?

    options reset ( all 2te3t ( 4Arial #te3t ( 1.5 2title ( 4arial6%o #title ( ".5 7si8e ( , Colors ( 9%lak* green * yello$:;

    Q

  • 7/25/2019 Sas Question

    3/30

    &nterpol @ it is used to oin dot inthe satter plotting. We an use &instead of &nterpol

    Width ( $idth defines the $idth ofthe line

    &nterpol ( s!s @ gi)es thes!oothness in the hart oin lineDsE represent the sort also help insorting data .

    -ine ( 1 @ gi)es the stiffness to theonneted line. By 5 @ FF )alues 5is the too s!ooth and FF is thestraight. efault )alue is 5.

    QF. Can $e use for!at state!ent in the

    sas graph? 2or!at an %e used in the pro

    ghart and pro gplot hart asfor!at are used to $rite the dataand it an %e used in the in %othdata step and pro step.

    Q15. What is satter plot?

    Satter plot display 3+y plot and

    sho$ the relationship %et$een ")aria%les $ith the help of progplot.

    0ro sql

    Q1. What is pro sql?

    0ro sql is a strutured querylanguage $hih offers an

    alternati)e to the data step forquerying and o!%ining sas dataset. There are so!e task that prosql an perfor! %etter and easier.

    Q". Write the sas ter!s in sql?

    ata set are ta%les in sql

    /%ser)ations are the ro$s 7aria%les are the olu!ns

    Q'. What selet* fro!* G* reatestate!ent !ean?

    Selet state!ent selet the)aria%le $hih you to represent*fro! state!ent o!es under in theselet state!ent $hih read thedata initial point or $e an sayfro! $here is the data o!ing.

    DGE is use to selet the entire)aria%le in the data.

    Create state!ent reate ne$ ta%lein the sas %y pro sql state!ent.

    Q,. Why dont $e need run state!ent inthe pro sql?

    Beause pro sql e3eutes as soonas a o!plete query has %eenspeified. &t $ill re!ain in the!e!ory for other query.

    Q. Whih state!ent is use to see!isspelled o%ser)ation?

    Spedis

  • 7/25/2019 Sas Question

    4/30

    Q. What is left* right* full oin? What isthe default oin?

    -eft oin inlude all the ro$s fro!the left ta%le and those ro$s$hih are orrespond to the )aluein the other ta%le.

    Right oin inlude all the ro$s inthe right ta%le and !athing )aluefro! the left ta%le

    2ull oin inlude %oth ro$s fro!%oth the ta%lesefault oin inner oin.

    QF. #o$ to onatenate t$o dataset insas and in pro sql?

    &n sas $e use set state!ent toonatenate the data and in prosql $e use union operator.

    Q15. I3plain different types of union?

    Jnion @ oin %oth ta%le and dropdupliate

    Jnion all @ oin %oth ta%leo!pletely

    Jnion orresponding @ !ath theolu!n na!e and drop dupliate

    Jnion orresponding all @ !ath theolu!n na!e and drop dupliateand it is equi)alent to setstate!ent

    I3ept + !ath olu!n na!e anddrop !athing ro$ in %oth ta%le

    &ntersetion @ !ath the olu!nna!e and keep unique ro$ in theta%le.

    Q11. #o$ to do sorting in the pro sql %yspeifi )aria%le?

    By using order %y lause

    Q1". What group %y state!ent do?

    roup %y state!ent group the dataaording to the gi)en )aria%le.

    Q1'. What is self oin?self oin is the oin in $hih ta%le oin

    itself.

    /S

    Q1. What is /S?

    /ds is the output deli)er syste!$hih help to send sas data outputinto different for!ats like ht!l*rtf* pdf et.

    Q". What is ods output ?

    Create the ne$ data set.

    Q'. Write the state!ent to send datainto ht!l file?

    /ds ht!l file 4pathKfile na!e.ht!l;LCodeM/ds ht!l lose;

    Q,. What is ta%le of ontents? #o$ toreate ta%le of ontent?

    Ta%le of ontents are the e!%edslinks to eah separate part of theoutput.

    Ta%le of ontent an %e reated %y' output files. 1: ain file $hihontain the proedure output ":ontents file ': fra!e file to

    display !ain file and ontent file./ds ht!l %ody ( 4filena!eContents ( 4filena!e2ra!e ( 4filena!e0ath ( 4path 9JR- ( none:;

  • 7/25/2019 Sas Question

    5/30

    Q. #o$ to selet data portion of sas

    output %y ods? By using /S SI-ICT and /S

    INIC-JI and to get theinfor!ation on eah output in log$e need to use trae on and traeoff-ike ods selet e3tre!eo%s;But it is not per!anent for thisneed to use 9persist: to re!ain for

    other proedure.Al$ays lose the open ods option

    Q. What is pro printto?

    &t is used to apture sas outputfro! a proedure and use it asinput to a data steps.

    Q15. What is pro uni)ariate?

    0R/C J&7AR&ATI is an e3ellent

    e3ploratorydata analysis tool. &t pro)ides !oreinfor!ation*%oth desripti)ely and graphially* in asingle pass of the data than any otherBASI SAS 0R/C.

    Q11. What is pro ttest?

    0ro ttest is used to for! t test

    aro

    Q1. What is aro?

    aros is useful to !ake sasprogra! !ore fle3i%le and allo$the! to %e used in differentsituation $ithout re$riting theprogra!.

    Q". When o!piling the sas !aroprogra! $hat happen?

    &t heks for the O and P sign inthe progra! and all for !aroproessor

    Q'. What are the " useful %uilt @ in sas)aria%les?

    OsysdateF and Osysti!e

    Q,. oes sas !aro )aria%le resol)e inquotes only?

    es

    Q. #o$ the atual !aro progra!sstart?

    P!aro na!e; start and P!end na!e; end

    Q. What is !aro )aria%le?

    &t is the tool that ena%les you todyna!ially !odify the te3t in asas progra!.

  • 7/25/2019 Sas Question

    6/30

    QF. What are the different $ays ofreating !aro )aria%le?

    By Pglo%al By P loal By pro sql into

    Plet Call sy!put

    Q15. oes se!iolon needed $hy alling!aro progra!?

    o

    Q11. #o$ to all !aro?

    P!aro na!e

    Q1". Write the differene %et$eenkey$ord and positional para!eter !aroprogra!.

    0ositional para!eters are definedin any order %ut the )alue !ust!ath the order you define andkey$ord para!eter are follo$ed %ythe equal sign. &n the key$ord

    para!eter you an define )alue %yequal to sign.

    Q1'. Why t$o period 9.: is used in!aros? What does it represent?

    &t tells the !aro proessor $herethe !aro )aria%les end.

    Q1,. What all routine do?

    Call routine assign )alue of a data

    step )aria%le to a !aro )aria%le

    Q1. What is the differene %et$eenglo%al and loal !aro )aria%le?

    -oal )aria%le only used in !aroprogra! and in !aro progra!!ing%ut glo%al !aro )aria%le an %eused any$here in the progra!.

    Q1. What is the differene %et$een allsy!put and all sy!get?

    Sy!get is used resol)e !aro

    )aria%le CA-- S0JT takes a )alue fro! a

    ATA step and assigns it to a!aro )aria%le. ou an then usethis !aro )aria%le in later steps.

    LIKE THIS - CALL

    SYMPUT(macro-variable-

    name,value)

    The ATA J-- step uses a CA--routine alled S0JT. This CA--routine assigns the )alue of a ATAstep )aria%le to a !aro )aria%le. ouannot use a P-IT state!ent here%eause you dont kno$ the )alue of)aria%les.

    Q1F. #o$ an $e reate %lank data%ase?

    By using data null state!ent.

    Q"5. #o$ to print output in log $indo$?

    By Pput state!ent

  • 7/25/2019 Sas Question

    7/30

    Q"1. aro is harater language ornu!eri?

    aro is a harater language.

    Q"". #o$ an all !aros $ithin data

    step? We an all the !aro $ith all+

    sy!put3

    ultiple o%s

    Q1. What happen if $e use /0R&T?

    oprint o!!and help in to not to

    sho$ data as listing output.Q". What rena!e* drop and keepstate!ent do? And does it per!anent?

    Rena!e $ill hange the na!e ofthe )aria%le and it $ill effet onthe output result only.

    rop $ill delete the seleted)aria%le

    eep $ill print the )aria%les $hihare listed in the keep state!ent.

    Q'. What lag funtion do? Any otheralternati)e is possi%le?

    -ag funtion defines thedifferene %et$een "o%ser)ations.-ike ne$)ar ( old)ar @ lag9old)aria%le:

    Retain state!ent $ill re!e!%erthe )alue fro! pre)iouso%ser)ation. &t is the proessed ato!piling ti!e not at thee3euta%le ti!e

    Q,. What the differene is %et$eenretain state!ent and lag funtion?

    Retain and lag do the sa!e thingust si!ple differene is the retainis the state!ent and lag is the

    funtion.

    0ro Ta%ulate

    Q1. What is pro ta%ulate?

    Jnderused* underappreiatedproedure that an reate a $ide)ariety of ta%ular reports* displayfrequeny* perentage anddesripti)e statistis.

    Q". What are the three operators thatontrol a ta%les appearane?

    Class speify the )aria%le thatrepresents ategories. &t sho$s in)ertial $ay.

    Ta%les speifies the ta%leappearane. The )aria%les $hihare listed in ta%les state!ent!ust %e listed in the lassstate!ent as $ell.

    7ar )aria%le $hih you $ant tosho$ in ta%le. 2or desripti)eportion like su! !ean !in !a3.efault is su!

    Q'. #o$ onatenate t$o ta%le )alues?

    By adding spae %et$een the t$o)aria%le like

    Ta%le )ar1 )ar";Q,. #o$ to define di!ensions in theta%le?

    By o!!a 9*: in ta%le state!ent

    Q

  • 7/25/2019 Sas Question

    8/30

    By applying asterisk 9G: in ta%les

    Q=. What A-- key$ord do?

    All key$ord in ta%le state!entalulate the )aria%le.-ike ta%le )ar1 all;

    Q>. What is eyla%el?

    eyla%el allo$ you to pro)ide ala%el for any of the key$ords used%y the proedure. -ikeeyla%el all ( 4total; ( 4ount 0tn ( 4perentage

    Q. #o$ to eli!inate the 4 ro$ in the

    ta%le?

    By gi)ing this state!entTa%le 7arGn( 4;

    QF. #o$ to re!o)e internal lines in theta%les?

    oseps

    Q15. 0tn sho$ $hat follo$ing?

    Sho$ing the perentage likeTa%le )ar1G 9n 0tn:;

    Q11. #o$ an $e inrease ro$ title?

    RTS (

    Q1". #o$ to hange thee !issing )alueperiod to $ord?

    By using !isste3t ( 4nodata;

    Q1'. What is olptn and ro$ptn?

    Colptn $ill o!pute the olu!npertange and ro$ptn $ill o!pute thero$ perentage.

    Q1,. What for!at ( =. eans?

    &t !eans that it $ill apply for!atto all the ell in the ta%les.

    0ro print

    Q1. What pro print do?

    0ro print helps to print the list ofo%ser)ation in the data set.

    Q". #o$ you an use 7AR state!ent?What is the use of 7ar state!ent in sas?

    7ar state!ent ontrol the)aria%les appear in the state!entand as $ell as the order of the)aria%les.

    Q'. #o$ you an re!o)e /BS fro! theoutput?

    By using & state!ent.-ike & e!pid;&t $ill replae the o%s olu!n $iththe )aria%le !entioned in the idstate!ent. &t appears in the left!ost side. ou ant list the sa!e)aria%le in the 7ar state!ent.

    /ther $ay to delete o%s fro!output %y using noo%s.

    Q,. DC/A>.E Why it is used?

    &t is used to apply o!!a in digitson >thplae.

    Q

  • 7/25/2019 Sas Question

    9/30

    one title is !issing %et$een thetitles6footnote? #o$ an you anel alltitle6footnote?

    is the no. fro! 1 to 15 $hihallo$ you to speify !ultiple title

    lines-ike title1 DhelloE;Title" De)ery%odyE;2ootnote1 Dthe endE;

    Blank line $ill %e sho$ as theoutput.

    By using title; state!ent.

    Q>. What is n ( state!ent tell?

    &t $ill tell no. of o%ser)ation at the%otto! of output.

    Q. #o$ to use la%el as olu!n heading?

    By using la%el state!ent in datastep as $ell as in pro print. Andusing -ABI- option in pro print.

    &f you dont use la%el option in proprint then la%el $ill not %e printed.

    QF. What is the use of 0age%ystate!ent?

    &t $ill display data on the ne3tpage.

    Q15. What is /JB-I option?

    This option used $ith pro print to

    reate dou%le spae %et$een theo%ser)ation

    Q11. &f $e $ant to sho$ first 5o%ser)ations or !ore $hat $ill %e used?

    9/%s(5: $ith pro print.

    Q1". #o$ an you set the )aria%le na!ein the hori8ontal for!at?

    By using linesi8e option. /r %y using heading(hori8ontal

    Q1'. &f $e $ant to display data in%et$een the data then $hat $ill %e used?

    9firsto%s(, o%s(F:#ere data start fro! , and end onF.

    0R/C S/RT

    Q1. Why pro sort is used?

    0ro sort is used to sort the datain asending or desending for!at%y partiular )aria%le using Bstate!ent. efault for!at isasending. /ther$ise you an useDdesendingE to sho$ output ashighest to lo$est.

    Q". What is /JT( option?

    /ut option helps to reate ne$!odified data%ase. &t is i!portant

    $hen you are perfor!ing sort.Q'. What is !ulti+le)el sorting !eans?

    Sorting $ith !ore than one)aria%le

    Q,. &f $e use B state!ent in pro printthen $hat happen?

    &t $ill sort the data %y Bstate!ent.

    Q

  • 7/25/2019 Sas Question

    10/30

    0ro freq

    Q1. What is pro freq? What outputpro)ided %y pro freq? What are thedefault options of pro freq?

    &t is used to ount frequeny of%oth harater and nu!eri)aria%les in one $ay* t$o $ay* andthree $ay.

    /utput pro)ided %y the pro freqis the 1: )aria%le ": u! freq ':freq ,: perentage freq

  • 7/25/2019 Sas Question

    11/30

    +harater ( all harater)aria%les

    all ( all )aria%le. all it the )aria%le $hih annot

    %e used in !ultiple t$o $ay ta%le

    0ro Transpose

    Q1. What is the pro transpose?

    Transpose is also alledrestruturing $hih !eans on)ertdata fro! ro$ to olu!n andolu!n to ro$. 2or transport $eneed use %y state!ent so that $ean transpose ro$ to olu!n and

    olu!n to ro$.Q". What is prefi3 option?

    0refi3 option $ill add )alue0refi3 ( d3;Will add )alue to like d31* d3"* d3'

    Array

    Q1. What array state!ents do?

    &t is used to reate the array.

    Q". o $e an only use all harater ornu!eri )aria%les in array?

    es $e ant !i3 %oth )aria%les$hile reating an array.

    Q'. What is sas array? #o$ it isdifferent fro! other array in otherprogra!!ing?

    Sas array is a olletion of

    ele!ents like )aria%les that allo$you to $rite sas state!entsreferening this group of )aria%les

    Sas array is different %eause itdoes not hold )alues and they allo$

    you to refer to a olletion of sas)aria%les in a on)enient !anner.

    Q,. Why to use G in the array progra!?

    G &t is used $hen you dont kno$the no. of )aria%les in the data set.

    Q

  • 7/25/2019 Sas Question

    12/30

    &n sas ta%les are the sas data set Ro$ are the o%ser)ations Colu!n are the )aria%les

    Q'. What is sas progra!? What it isontains e3plains it uses?

    Sas progra! are the sequene ofstep that user su%!its fore3eution.

    Sas progra! ontains the data stepand pro step.

    ata step is used to reate sas

    data set. &t reates te!porarydata set in $ork li%rary. &t is usedto !anipulate the data andperfor! alulations

    0ro step are the proedure stepsthat helps in generating report andgraphs and used to !anage data*sorting of data and datasu!!ari8ations.

    Q,. #o$ data step end?

    &t is end %y RJ state!ent.

    Q. What are the rules for sas na!es?

    o longer than '" harater ust %egin $ith letter or

    undersore ash and spae are not allo$ed

    Q. What do you !ean %y sas data set?

    Sas store data in its o$n speialfor!at $hih is kno$n as sas dataset. /nly sas an read its data.

    QF. Whih are the t$o parts in $hih sasdata set are di)ided?

    esriptor portions and dataportions

    Q15. What types of )aria%les used in the

    sas?

    Charater )aria%les and nu!eri)aria%le 9 %yte: it has fi3edstorage length. 1 %yte ( 1 har. And%yte for nu!eri ontain 1, +1