Hi all,

I have a numeric variable, range is about from 100-400,000. I would like to recode this variable to group it into ranges of 1,000.
For example:
gen newvar = .
replace newvar = 1 if var >=100 & <1000

However, this will take a lot of time. I understand that a macro might help but I have zero experience with macros. I would appreciate any help in this. Thank you.