Solved

Change the format of a field

Posted on 2011-03-03
3
731 Views
Last Modified: 2013-11-16
Hi,

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

Tx
0
Comment
Question by:sonmic
3 Comments
 

Author Comment

by:sonmic
ID: 35025010
Forgotten
From text to numeric.
0
 
LVL 11

Accepted Solution

by:
theartfuldazzler earned 125 total points
ID: 35025067
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
 
LVL 1

Expert Comment

by:wolfen351
ID: 35025071
Hi there

Easy

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

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I guess that all of us know that caching the data usually increase the performance, but I worried if all of us are aware about the risk that caching the data provides and how to minimize this.  That’s the reason why I decided to write this short art…
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question