The data set I have has countless of records. The records are dated under variable FILMDATE. And FILMDATEs are categorized by cycles. I want to categorize the FILMDATEs. Here is my data below:
Cycle 1 if visited the clinic between 1969 and 1973
Cycle 2 if visited the clinic between 1971 and 1976
Cycle 3 if visited the clinic between 1975 and 1980
Cycle 4 if visited the clinic between 1978 and 1982
Cycle 5 if visited the clinic between 1981 and 1985
If the year in FILMDATE does not match the range defined for each cycle, then I want to keep the value of the cycle but create a new date variable where the incorrect value of FILMDATE is replaced by the year at midpoint of the range for each cycle (like 1971 for cycle 1).
How do I do this using PROC SQL?