hi guys ...i have one query...
data abc;
input s w k g o t a m;
cards;
1 2 3 4 5 6 7 8
2 3 4 5 6 7 8 9
;
run;

i want the output to be the sorted order(only
variables).observations should not be changed..

Answers were Sorted based on User's Feedback



hi guys ...i have one query... data abc; input s w k g o t a m; cards; 1 2 3 4 5 6 7 8 2 3 4 5..

Answer / vishnu

create data set as given above.Next follow the below step.

data abc;
format a $2.;
format g $2.;
format k $2.;
format m $2.;
format o $2.;
format s $2.;
format t $2.;
format w $2.;
set abc;
run;

Run the above program u will get variables in sorted order.

Note:-In the place of format statement u can use length
statement.

Is This Answer Correct ?    2 Yes 6 No

hi guys ...i have one query... data abc; input s w k g o t a m; cards; 1 2 3 4 5 6 7 8 2 3 4 5..

Answer / sravan

data xyz;
set abc;
retain a g k m o s t;
run;

Is This Answer Correct ?    3 Yes 9 No

hi guys ...i have one query... data abc; input s w k g o t a m; cards; 1 2 3 4 5 6 7 8 2 3 4 5..

Answer / guest

data abc;
input s w k g o t a m;
cards;
1 2 3 4 5 6 7 8
2 3 4 5 6 7 8 9
;
run;
proc sort data=abc;
run;

Is This Answer Correct ?    2 Yes 24 No

hi guys ...i have one query... data abc; input s w k g o t a m; cards; 1 2 3 4 5 6 7 8 2 3 4 5..

Answer / amar

Proc sort data=dataset;
by idnumber ;
run;

Is This Answer Correct ?    2 Yes 25 No

Post New Answer

More SAS Interview Questions

what do you mean by data staging area? : Sas-di

0 Answers  


Explain input and put function?

0 Answers  


What are some problems you might encounter in processing missing values? In Data steps? Arithmetic? Comparisons? Functions? Classifying data?

1 Answers   Quintiles,


how to assign a macro value to a variable?

8 Answers   CitiGroup,


Name few SAS functions?

0 Answers  






Explain the difference between using drop = data set option in set and data statement?

0 Answers  


What do you know about symput and symget?

0 Answers  


What does PROC print, and PROC contents do?

0 Answers  


what do the pad and dim functions do? : Sas programming

0 Answers  


How will you generate test data with no input data?

0 Answers  


What would be the value of month at the end of data step execution and how many observations would be there?

0 Answers  


what are the considerations when picking a SAS/STAT procedure?

0 Answers   Accenture, Quintiles,


Categories