Hi All,
I have a file like
name postcode branch
simon me1 4en ctm
john me1 3ed rnt
tst3 me1 7fg str
hfjk me2 4kw ctm
jdk me2 6df str
jde me2 8dj rnt
.
.
.
.
;
i would like to find the no. of records for
pcode branch norecs
me1 ctm 25
me1 str 15
me2 rnt 46
....
i have used the following code
data test2(rename=(pcode1=pcode));
set test1;
* pcode is postcode;
pcode1=substr(pcode,1,3);
den=length(pcode1);
if length(pcode1)<3 then delete;
drop pcode;
run;
proc sort data=test3 nodup out=test4;
by pcode lastname branch;
run;
data test6;
set test4;
by pcode;
retain npc;
if first.pcode then do;
npc=0;
** i think some code here;
end;
npc+1;
if last.pcode then output;
run;
Now i am getting the how many records me1,me2.... but i would like to get
me1 ctm ??
me1 str ??
me1 rnt ??
me2 ctm ?
.....
Thanks in advance
Sams