> now i want the format like this in to new vaiable as
> i am having 30000 observations as no increase it
> should give format like this
> if no is 24566 new_format=za
> if no is 24567 new_format=zb
> if no is 24568 new_format=zc
Hmmmmm...I think format dataset would be a better choice for this kind question.
And as your said, there should be 702 obs(i.e. 26*26+26=702).Counld not be 'no is 24568 ';
And also your 'no' is numeric variable.
[pre]
data format;
length label $2.;
retain fmtname 'fmt' type 'N' ;
do label='a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' ;
start+1;
output;
end;
do x='a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' ;
do y='a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' ;
start+1;
label=cats(x,y);
output;
end;
end;
drop x y;
run;
data n; *To build up your original dataset;
do no=1 to 702 ;
output;
end;
run;
proc format cntlin=format;
run;
data temp;
set n;
new_format=put(no,fmt.);
run;
proc print data=temp(obs=40) noobs;run;
[/pre]
Ksharp