h********o 发帖数: 103 | 1 Is this what you want?
=========================
DATA TEST;
INPUT X : $9.;
Y = INPUT(X,BEST.);
CARDS;
1
0000032
0000178
000000054
000003890
;
PROC PRINT DATA = TEST NOOBS;
RUN;
====
X Y
1 1
0000032 32
0000178 178
000000054 54
000003890 3890 |
|
h********o 发帖数: 103 | 2 Why?
=========
DATA TEST;
INPUT X : $9.;
Y = STRIP(PUT(INPUT(X,BEST.),BEST.)); * CHARACTER;
Z = INPUT(X,BEST.); * NUMERIC;
CARDS;
1
0000032
0000178
000000054
000003890
;
PROC PRINT DATA = TEST NOOBS;
RUN;
===========================================================
X Y Z
1 1 1
0000032 32 32
0000178 178 178
... 阅读全帖 |
|
c****y 发帖数: 584 | 3 Thanks very much!! It works!!
There is another SAS question, hope daxia can help as well.
In the original data set, it is like this
1
0000032
0000178
000000054
000003890
.
.
.
The form I want is to get rid of all 0 in the front, so it should like this
1
32
178
54
3890
.
.
.
Thanks very much!! I will send big baozi to you! |
|
h********o 发帖数: 103 | 4 DATA TEST;
INPUT X : $9.;
Y = STRIP(PUT(INPUT(X,BEST.),BEST.)); * CHARACTER;
Z = INPUT(X,BEST.); * NUMERIC;
CARDS;
1
0000032
0000178
000000054
000003890
; |
|