If you are asking whether President Franklin D. Roosevelt knew that the Japanese were going to attack Pearl Harbor, the answer is no. If you are asking whether Roosevelt knew that the Japanese were likely to attack American territory or interests somewhere at some time, the answer is yes. However, there is a tremendous difference between these two levels of knowledge. Reputable historians do not believe that FDR knew that a Japanese attack on Pearl Harbor was going to happen.
The idea that FDR did know about the attack is usually put forward by conspiracy theorists. They correctly assert that FDR wanted to get into WWII. They also correctly assert that the US had intelligence that showed that Japan was planning to attack American territory or its allies. However, they take these facts to mean that FDR actually knew that there was going to be an attack on Pearl Harbor itself and that he allowed that attack to happen to give the US an excuse to go to war. Reputable historians reject this conclusion.
FDR had no way of knowing when or where the Japanese were going to attack. There were many possible places they could have attacked. Even though he knew that they wanted and intended to attack the US or its allies, he had no actual knowledge of which specific targets they might attack. To think of this in modern terms, we know perfectly well that ISIS wants to attack America and its allies. However, this does not mean that we have any idea where and when it will next try to attack.
Reputable historians do not believe that FDR had any real knowledge of where and when the Japanese would attack. Therefore, we have to say that he did not “know about Pearl Harbor before the attack.”