Solved

Change the format of a field

Posted on 2011-03-03
3
732 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
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…

821 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