From: rangoon rangoon on

hi all,

i want to create three different variable from one variable.

data have;
xx = "DI, OT, TH";
run;

data want;
xx1 = "DI";
XX2 = "OT";
XX3 = "TH";
RUN;

Thanks,
Rang
From: billyk43 on

Use the SCAN function:

data want;
xx = "DI, OT, TH";
xx1 = scan(xx,1);
XX2 = scan(xx,2);
XX3 = scan(xx,3);
drop xx;
run;

HTH, Keith

On Jun 16, 1:37 pm, rangoon rangoon <rangoonraja...(a)gmail.com> wrote:
> hi all,
>
> i want to create three different variable from one variable.
>
> data have;
>   xx = "DI, OT, TH";
> run;
>
> data want;
>   xx1 = "DI";
> XX2 = "OT";
> XX3 = "TH";
> RUN;
>
> Thanks,
> Rang