We have a raw dataset:
Ball Price is : $700
Bat Price is: $800
Wicket Price is : $900
We have to make SAS data set as:
Product Cost
-------- --------
Bat 700
Ball 800
Wicket 900
Kindly write your answer in comment box:
Now prepare your Base SAS and
Advance SAS Certification Exams with Online Mock tests: http://exam.sankhyana.com
If you want to Learn Base SAS and Advance SAS please mail me at creativityofnature@gmail.com.
Ball Price is : $700
Bat Price is: $800
Wicket Price is : $900
We have to make SAS data set as:
Product Cost
-------- --------
Bat 700
Ball 800
Wicket 900
Kindly write your answer in comment box:
Hi
ReplyDeleteTo get the output as given, please try the below code.
data want;
input @;
product=scan(_infile_,1,' ');
cost=compress(scan(_infile_,-1,' '),'$');
cards;
Ball Price is : $700
Bat Price is: $800
Wicket Price is : $900
;
run;
Thanks,
Jagadish
data one;
ReplyDeleteinfile datalines;
input name $ @': ' price dollar4.;
datalines;
Ball Price is : $700
Bat Price is: $800
Wicket Price is : $900
run;
proc print;
run;
you can use this code...
data costdat;
ReplyDeleteinput product $ @'$' cost;
cards;
Ball Price is : $700
Bat Price is: $800
Wicket Price is : $900
;
run;
you can use this code,this was very simple and logic