4/23/2012 8:53 AM PDT

EXCLUSIVE

Dick Clark underwent prostate surgery the day before he died from a heart attack ... this according to the death certificate obtained by TMZ.

According to the death certificate, doctors performed a transurethral resection of the prostate for benign prostatic hyperplasia on April 17. The procedure is usually performed when the prostate is so enlarged, it makes it extremely difficult to urinate.

The certificate shows ... Clark died from acute myocardial infarction -- the technical term for a heart attack. He also suffered from coronary artery disease.

The document also notes that Clark suffered from acute urinary retention -- a condition caused by a benign prostatic hyperplasia ... which is why he underwent surgery on the 17th.

TMZ broke the story ... Clark died from a massive heart attack at St. John's Hospital in Santa Monica on April 18. He was 82.

4/19/2012 5:30 AM PDT

EXCLUSIVE

The staff at Dick Clark Productions learned about the death of their fearless leader directly from the honchos at the company ... during an "emotional" company meeting hours before the news got out to the public ... TMZ has learned.

Sources at DCP tell us ... the staff is a pretty tight knit group and the people who run the company wanted to make sure the employees were the first to know about Dick's passing.

One staffer tells us, "It was an emotional meeting."

We're told the staff has been discussing plans to honor their late boss with a permanent memorial in the office ... but so far, nothing is set in stone.

4/18/2012 3:25 PM PDT

Clark's rep tells TMZ, the TV icon had been in St. John's hospital in L.A. after undergoing an outpatient procedure last night. Clark suffered the "massive" heart attack following the procedure. Attempts to resuscitate him were unsuccessful.

Clark was 82.

Clark's health had been on the decline since he suffered a significant stroke in 2004 -- forcing him to retire from his hosting gig at "New Year's Rockin' Eve," which he created in 1972. Ryan Seacrest took over in 2006. Dick has appeared on the show sporadically ever since. His final appearance was in 2011.

Months before suffering a stroke, Clark told Larry King he also suffered from Type 2 diabetes.

Clark got his first big break in 1956, hosting what was called "Bob Horn's Bandstand" ... what would later be renamed "American Bandstand." Clark continued to host and produce "American Bandstand" until 1989.

Dick hosted Miss USA from 1989-1993 -- and Miss Universe 1990-1993.

In addition, Clark also hosted a bunch of game shows -- like "Pyramid," "Scattergories," "The Challengers," and many more.

Clark had been inducted into practically every hall of fame on the planet -- including the Hollywood Walk of Fame, the Rock and Roll Hall of Fame, and the Academy of Television Arts and Sciences Hall of Fame.

Clark had also received a total of 5 Emmy Awards for his work, as well as a Peabody Award. One Emmy was a lifetime achievement award.

Clark was married 3 times -- and has 3 children from his first two marriages. He is survived by his current wife Kari Wigton.

"For now, Dick Clark ... so long."

5:20 PM PT: Dick Clark's rep tells TMZ, there will be NO public funeral. In lieu of flowers, Dick's family asks that donations be made to the National Parkinson’s Foundation based in Miami.

Ryan Seacrest just tweeted, writing, "I am deeply saddened by the loss of my dear friend Dick Clark. He has truly been one of the greatest influences in my life."

Donny Osmond tells us, "The industry lost a legend today, but I feel like I've lost a very close friend. Dick was a mentor to me."

The President of Miss Universe Paula Shugart -- who started working for Dick Clark Productions in 1985 -- tells TMZ, Dick "gave me my first break in TV. His death is hitting all of us hard."