If Chicago has a gang problem — and it does — it only makes sense that the cops keep tabs on who’s in a gang. That’s good police work.

If the Chicago Police Department’s database of gang members, however, includes the name of dozens of people who shouldn’t be on such a list — and it does — it is not fully fair and must be overhauled.

EDITORIAL

CPD’s gang database, which includes the names of some 128,000 adults and an unknown number of minors, is riddled with errors, and pretty obviously so. It includes the names of people who are, supposedly, 118 and 132 years old.

Being on the list can lead to arrest and disqualification from jobs or housing. In the case of immigrants, it can lead to deportation. It is only fair that the list be made more accurate.

In a proposed ordinance, which we support, Ald. Rick Munoz of the Little Village neighborhood suggests several ways to fix the problem.

For starters, Munoz says, the city’s inspector general should conduct a study to assure that the gang database has “a legitimate law enforcement-related purpose that outweighs the harm caused to individuals” who are labeled by the list.

Second, the designation of “gang member” should be “verified in accordance with professionally accepted standards and regularly audited” and be “free from racial discrimination.”

Third, anybody whose name is on the list should be informed of that and given an “opportunity to challenge their designation.”

And fourth, CPD should be prohibited from sharing names and other database information with any third party.

As it happens now, people sometimes don’t even know their name is in the database until it causes them big problems.

Consider, for example, the case of Wilmer Catalan-Ramirez, 31, who recently settled a suit with the city in which he claimed his name was wrongly included in the database, which made him a target for deportation. Catalan-Ramirez was detained by immigration authorities for 10 months.

To settle the suit, CPD took Catalan-Ramirez’s name off its list of gang members and agreed to write a letter to immigration officials to support his visa application.

Others whose names are in the database got there legitimately — they at some point belonged to a gang — but left the gang life years or decades ago. They are law-abiding citizens now, asking only that their past not be allowed to haunt them forever.

Consider what Munoz, told Sun-Times reporter Fran Spielman on Wednesday:

“Thirty-five years ago, when I was hanging out, I would have been on that list.”

Munoz’s rap sheet included guilty pleas to charges of cocaine possession and unlawful use of a weapon. As a teen, he was “affiliated” with a neighborhood gang.

But Munoz got a second chance, which he says would have been much more difficult had his name been in a gang database. Munoz has been an alderman for 25 years.

CPD’s gang database should have been revamped decades ago. As it stands, “there’s no transparency,” Joe Ferguson, the inspector general, told the Sun-Times’ Spielman on Wednesday. “There’s no accountability, which is a matter of great worry and concern from communities most impacted by it.”

Four men who have filed a federal lawsuit against the city say the database violates due process protections, is discriminatory and full of errors.

It’s hard to argue with that. Published reports in the Sun-Times, ProPublica Illinois and the Chicago Tribune in the last year have documented numerous problems with the list.

The racial makeup of the database, for one, is way too lopsided. According to the lawsuit and published reports, 70 percent of those named in the database are black, 25 percent are Latino and 5 percent are white. Predominantly white or exclusively white gangs, according to the suit, aren’t included at all.

It gives us pause that only 23 people named in the database are identified as members of white supremacist hate groups.

In Chicago? Really?

One man who filed suit, Donta Lucas, 34, claims he couldn’t get a job as a security guard because he was denied a concealed carry license for a gun as a result of his name being in the database. The gang label, he claims, is false.

Another man, Lester Cooper, 29, was put under house arrest and electronic monitoring for minor traffic violations because his name was wrongly included in the gang database, the suit alleges.

Let’s get the database right, as a matter of supporting good police work and basic fairness.

Send letters to: letters@suntimes.com