| Date: | Sat, 4 Dec 2010 19:03:02 +0530 |
| Reply-To: | vaibhav wadhera <vaibhavwadhera@GMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | vaibhav wadhera <vaibhavwadhera@GMAIL.COM> |
| Subject: | Re: can any one help |
|
| In-Reply-To: | <AANLkTi=aEmtkmcP2QHRDo-=SXAHkWnEYAS9rsGR+746y@mail.gmail.com> |
| Content-Type: | text/plain; charset=ISO-8859-1 |
|---|
Hi...
have a look on this code and let me know whether this serves your purpose
data temp;
input id $ accountid $ name $;
cards;
a 3-GN3KCAJ prasanth
a 3-GN7ZRI6 kumar
a 3-GNBWRUS rajesh
a 3-GNIZQ2M somesh
b 3-GNLOOKO rakesh
b 3-GNX2AU9 subash
b 3-GO4993N karthik
c 3-GO5JQ21 rupa
c 3-GO6JBFS kotla
;
run;
Proc print Data =temp;
run;
dATA TEMP;
SET TEMP;
ID1 = ID;
RUN;
proc report data = temp;
columns id id1 accountid name n id;
define id / GROUP NOPRINT;
DEFINE ID1 /id;
define accountid / display width=10 ;
define name / display;
break after ID / ol skip summarize suppress;
rbreak after / dol skip summarize;
run;
Thanks & Regards
Vaibhav Wadhera
On Sat, Dec 4, 2010 at 4:58 PM, prasanth kumar <prasanth.or@gmail.com>wrote:
> Hi All,
>
> i needed the counts of accountid by id wise.
> when i am trying to do in proc report, getting
> error that accountid should be in numeric.
> i am unable to convert the accountid to numeric.
> can any one help in getting the report in the
> below format.
>
>
>
> data temp;
> input id $ accountid $ name $;
> cards;
> a 3-GN3KCAJ prasanth
> a 3-GN7ZRI6 kumar
> a 3-GNBWRUS rajesh
> a 3-GNIZQ2M somesh
> b 3-GNLOOKO rakesh
> b 3-GNX2AU9 subash
> b 3-GO4993N karthik
> c 3-GO5JQ21 rupa
> c 3-GO6JBFS kotla
> ;
> run;
>
> output needed:
> id accountid name
> a 3-GN3KCAJ prasanth
> a 3-GN7ZRI6 kumar
> a 3-GNBWRUS rajesh
> a 3-GNIZQ2M somesh
> total 4
> b 3-GNLOOKO rakesh
> b 3-GNX2AU9 subash
> b 3-GO4993N karthik
> total 3
> c 3-GO5JQ21 rupa
> c 3-GO6JBFS kotla
> total 2
> overaltotal 9
>
--
Thanks & Regards
Vaibhav wadhera
|