From: Bill McKirgan on
On Dec 23, 11:50 am, shakespeare_1...(a)HOTMAIL.COM (William
Shakespeare) wrote:
> Say I have a data set with 3 variables, all numeric.  I need to convert
> the second to character and maintain the original order of the variables.
> I can do this, but with two data steps, on to convert the variable in
> question and drop the old variable, and another to reorder the variables.
> Is there a way to do this in one step?

William,

As far as I know this takes two datasteps.

--Bill
From: Arthur Tabachneck on
Couldn't you use something like:?

data want (drop=two_num);
retain one two three;
set have (rename=(two=two_num));
two=put(two_num,3.);
run;

HTH,
Art
-------
On Wed, 23 Dec 2009 12:50:13 -0500, William Shakespeare
<shakespeare_1040(a)HOTMAIL.COM> wrote:

>Say I have a data set with 3 variables, all numeric. I need to convert
>the second to character and maintain the original order of the variables.
>I can do this, but with two data steps, on to convert the variable in
>question and drop the old variable, and another to reorder the variables.
>Is there a way to do this in one step?
From: "Keintz, H. Mark" on
On Dec 23, 11:50 am, shakespeare_1...(a)HOTMAIL.COM (William
Shakespeare) wrote:
> Say I have a data set with 3 variables, all numeric. I need to convert
> the second to character and maintain the original order of the variables.
> I can do this, but with two data steps, on to convert the variable in
> question and drop the old variable, and another to reorder the variables.
> Is there a way to do this in one step?

> William,

William:

The discussion earlier about placing new variables into
location interior to the list of old variables led to this
one-step solution:

data have;
input x y z;
datalines;
11 12 13
21 22 23
run;

data need;
if 0 then set have (keep=x);
length new_y $2;
set have ;
new_y=put(y,2.);
drop y;
run;

Regards,
Mark