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?




Answers were Sorted based on User's Feedback



how to shift the rows to cols? eg: i have like field1 field2 field3 10 20 20 this sh..

Answer / luclyl

proc transpose data=hyd out=mum (drop=_NAME_);
var a b c;
run;

Is This Answer Correct ?    7 Yes 2 No

how to shift the rows to cols? eg: i have like field1 field2 field3 10 20 20 this sh..

Answer / 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

how to shift the rows to cols? eg: i have like field1 field2 field3 10 20 20 this sh..

Answer / guest

you can also use arrays to shift rows into columns.

Is This Answer Correct ?    2 Yes 3 No



Post New Answer



More SAS Interview Questions

IS SAS COMPILER OR INTERPRETER? EXPLAIN?

3 Answers   TCS, HSBC, SCL, Aon Hewitt,


What is a macro routine?

0 Answers  


Write a SAS macro to calculate number of numbers in an email address

2 Answers  


differnce between 8.2 and 9.1.3

1 Answers  


How would you remove a format that has been permanently associated with a variables?

3 Answers  






Are you involved in writing the inferential analysis plan? Tables specfications?

0 Answers  


What is the one statement to set the criteria of data that can be coded in any step?

4 Answers   Accenture,


Suppose there is a SAS dataset with following values - Parent Child A B B C D E F G G H H I and so on….. This goes onto 1000s of observations/rows. Now how do we identify from this dataset Grandparents and Grandchildrens ?

5 Answers   Barclays, American Express,


if i having variables named a b c d e f ,how to find total of each variable ????give syntax...??

6 Answers   Accenture,


what is the use of catalog?

1 Answers   Cognizant,


How many versions came upto now in SAS?

3 Answers   TCS, CTS,


how we can create optional or required parameters in SAS macro...

5 Answers   TCS,






Categories