Hi, I have one dataset, could you please ans for this.
id amount paid_amount
1 700 400
2 900 250
3 300 300
a 400 250
b 500 320
c 800 650
x 200 190
y 900 250
z 300 180

i want create new dataset having id and paid_amount who are
paid high amount comparing amount.
ex: 1d paid_amount
3 300
c 650
x 190

Answer Posted / pavan

data inter7;
input id $1-2 sal1 6-9 sal2 13-16;
cards;
1 700 400
2 900 250
3 300 300
a 400 250
b 500 320
c 800 650
x 200 190
y 900 250
z 300 180
;
run;

data inter8 ;
set inter7;
if sal1>=sal2 then sal=sal1;
if sal2>=sal1 then sal=sal2;
run;

Is This Answer Correct ?    1 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How substr function works in sas?

699


What would you change about your job?

1920


how many types of prompts are there? : Sas-bi

547


How do dates work in SAS data?

680


If you have a dataset that contains 100 variables, but you need only five of those, what is the code to force SAS to use only those variables?

699






what is the difference between nodup and nodupkey options? : Sas programming

614


for report generation which one you used proc report or data_null_?

6570


how does sas handle missing values in a merge? : Sas programming

549


Describe crosslist option in tables statement?

707


What is the use of function Proc summary?

648


how we can create a FLAG datasets? Ex:-ID age_group no_persons 1 to 10 10 to 20 3 11 to 20 21 to 30 7 21 to 3o 31 to 40 5

1650


What is the role of unrestrictive users? : sas-grid-administration

569


What can be the size of largest dataset in SAS?

706


What are the ways in which macro variables can be created in sas programming?

563


what is enterprise guide? What is the use of it? : Sas programming

533