[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 739
  • Last Modified:

Change the format of a field

Hi,

How can i change the format of a field in sas. I want to keep the same name.

Tx
0
sonmic
Asked:
sonmic
1 Solution
 
sonmicAuthor Commented:
Forgotten
From text to numeric.
0
 
theartfuldazzlerCommented:
DATA Char;  /* Data set with character variable */
  x = "123";
RUN;

DATA Num;  /* new dataset with numeric variable */
  SET Char;
    y = INPUT(x,best32.);
DROP x;
RENAME y = x;
RUN;
0
 
wolfen351Commented:
Hi there

Easy

data newfile;
  length newvar 8;
  format newvar 8.2;
  set oldfile(ren=newvar=oldvar);
  newvar=oldvar;
run;
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now