@Reeza and @novinosrin both have provided you with answers. Welcome to SAS forum as it seems you are new.
First off, it seems you are unable to apply the mod function with a condition. This is where quantitative skills are imperative to be successful in any programming. Try to think through why Reeza suggested mod, if mod results in zero for every fifth obs and not in zero for others. What do you have to do next?
With some effort, you will get the hang of it, but you will have to do that thinking by yourself since the directions have been provided
... View more