how to shift the rows to cols?
eg:
i have like
field1 field2 field3
10 20 20
this should be displayed as
field1 10
field2 20
field3 30
(without the obs col)
how do this?can i use transpose or tell me suitable way to
do this?
Answer Posted / haritha
by using proc transpose procedure
ur data should be like this
data hyd;
input a$ b$ c$;
datalines;
field1 field2 field3
10 20 30
;
run;
solution will be like this:
proc tranpose data=hyd out=mum;
var a b c;
run;
proc print data=mum noobs;
run;
Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
Explain how merging helps to combine data sets.
what is the effect of the options statement errors=1? : Sas programming
What do you understand by the term Normal Distribution?
How will you generate test data with no input data?
Do we follow ADAM in analysis dataset development?How? Usually which version? Why is it necessary?
Explain how you can debug and test your SAS program?
What is by-group processing?
Give an example where SAS fails to convert character value to numeric value automatically?
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.
For a user to have access to a standard workspace server, is internal authentication alone is sufficient? : sas-grid-administration
How might you use MOD and INT on numeric to mimic SUBSTR on character Strings?
What is the sas data set? : sas-grid-administration
How would you define the end of a macro? : sas-macro
If money were no object, what would you like to do?
What is the role of unrestrictive users? : sas-grid-administration