how to get second highest salary from a employee table and
how get a 5th highest salary from a employee table?
Answer Posted / pricil kurian
/*sort employee table by salary in desending order */
proc sort data=xx nodupkey;
by descending sal ;
run;
/*outputting the second and 5th largest salary to then yy
dataset */
data yy;
set xx;
if _n_ in (2, 5) then output;
run;
| Is This Answer Correct ? | 35 Yes | 13 No |
Post New Answer View All Answers
what is sas metadata server? : Sas-di
In SAS explain which statement does not perform automatic conversions in comparisons?
What is the difference between reading data from an external file and reading data from an existing data set?
What is SAS informats?
What is the difference between class statement and by statement in proc means?
What does proc print, and proc contents are used for?
what is the different between functions and procs that calculate the same simple descriptive statistics? : Sas programming
What do the PUT and INPUT functions do?
what are the considerations when picking a SAS/STAT procedure?
Explain what is the use of proc gplot?
How to test the debugging in sas?
How does SAS handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, PROCs?
In sas, what are the areas that you are most interested in? : sas-grid-administration
Hello, I have PROC SQLs results group by 3 fields and I use SUM and COUNT functions in SQL. The problem is when I try to display my result with PROC TABULATE. I am getting very big numbers. I believe I make a mistake some where in Tabulate. Here is my Proc Tabulate. PROC TABULATE DATA=OUT04_05 FORMAT=12.; CLASS YR CENTRE VISA / PRELOADFMT EXCLUSIVE; VAR NEWUSER FRAUD TRANSFER AUTUSER REISSUE; TABLE CENTRE ALL, (YR ALL)*VISA, (NEWUSER*F=COMMA12. AUTUSER*F=COMMA12. FRAUD*F=COMMA12. TRANSFER*F=COMMA12. REISSUE*F=COMMA12.) / MISSTEXT={LABEL='0'} PRINTMISS RTS=20; FORMAT VISA VISAFMT.; KEYLABEL SUM = ' ' ALL = 'TOTAL'; LABEL YR = 'DATE YEAR' NEWUSER = 'TOTAL NEW ACCT' TRANSFER = 'TOTAL TRANSFER' FRAUD = 'TOTAL FRAUD TRANSFER' AUTUSER = 'TOTAL AUTH USERS' REISSUE = 'TOTAL REISSUE'; When I code it like : NEWUSER*N*F=COMMA12. AUTUSER*N*F=COMMA12. I get same amount numbers but to find a NEWUSER I use COUNT(*) and to find AUTUSER I use SUM(xxxx) function so both result shouldn’t be the same my problem is in this point. Could you tell me where the problem in code is. How can I display my result? TX.
please can you tell me that in companies sas work are doing by through sas coding or sas wizard ??