Hi,
I have a character variables and I want to make it to 5digits by filling with zero at the starting.
ID
11
21
31
451
5671
Want:
00011
00021
00031
00451
05671
thank you in advance
This should do it:
data want; set have; id = put(input(id, 5.), z5.); run;
What is the current defined Length of the variable? If it is not at least 5 then you will not have enough character spaces to place 5 characters in it.
Dive into keynotes, announcements and breakthroughs on demand.
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.