The researchers put participants in four groups- consistently low and consistently high job satisfaction, those whose satisfaction started high but was trending down and those who started low but were trending higher.
Alongside taking measurements of their mental and physical health, the survey also asked participants to rate how satisfied they were with their jobs on a scale of one to five.
The worse you feel about your job early on in your career, the poorer your mental and physical health may be decades down the road, suggests new research.
The direction of the trend in job satisfaction - better or worse - has an influence on health later in life.
Having an unrewarding job as you start out on the career ladder makes you more depressed, anxious and had more trouble sleeping.
The group that started with low job satisfaction early on, but trended upward, did not see any extra health problems compared with the control group.
Job dissatisfaction among people in their late 20s and 30s can have poor overall health and emotional problems by the time they reach early 40s, warn researchers.
Lead author and doctoral student Jonathan Dirlam said: "We found that there is a cumulative effect of job satisfaction on health that appears as early as your 40s".
Researchers examined job satisfaction trajectories for people from age 25 to 39 and their health on turning 40.
In total, 45 percent of people felt consistently low job satisfaction compared to 23 percent of those whose initially high job satisfaction declined over time. These participants then reported a variety of health measures after they turned 40.
Around 15 per cent of people were consistently happy at their jobs while 17 per cent were trending upwards.
The average score of those classified as the low group was almost three (indicating they liked their job "fairly well"), Dirlam noted.
They reported higher levels of depression, sleep problems and excessive worry. But they didn't see an impact on depression scores or their probability of being diagnosed with emotional problems.
Those whose scores went up through the early career years did not see any comparative health problems.
While it impacts on physical health, its effect was particularly strong for mental health.
Those in the group who started with high job satisfaction, but had a downward trend, were more likely than the consistently satisfied group to report trouble sleeping and excessive worry and had lower mental health scores. But they weren't different in physical functioning and in doctor-diagnosed health problems such as diabetes and cancer. "You do not have to be near the end of your career to see the health impact of job satisfaction, particularly on your mental health", said Hui Zheng from Ohio State.
"Increased anxiety and depression could lead to heart diseases or other health problems that won't show up until they are older", Zheng said. Given the United States is still recovering from the economic fallout of the Great Recession, and with many younger people finding it harder to get their careers started off on the right foot than the generation before them, the researchers believe their findings are especially relevant right now. "The recession nearly certainly increased job insecurity and dissatisfaction, and that could have resulted in more negative health effects", Dirlam concludes.
The study was presented in 2016 American Sociological Association Annual Meeting.