Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SAS assign ID numbers

Status
Not open for further replies.

newbeesas9

Programmer
Oct 12, 2007
1
US
Hi,
I want to assign unique ID's to a set of numbers. That should start as '00001' and keep on increasing like '00021' etc....

I have tried of assigning intial '000' but not able to make increment like 000010 etc.

How to do this in SAS. Please let me know.

thanks in advance,
newbee
 
newbeesas9, you want to use the 'z' format... here's an example:

Code:
data _null_;
file print;

do i=1 to 10;
strvar = put(i,z5.);
put strvar;
end;
run;

fyi... you can use z6. z7. etc...

Hope this helps!

Cheers

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top