Solved

Change the format of a field

Posted on 2011-03-03
3
734 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
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…

623 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