I have to design a lintel 40 feet long. It will be supporting 12" solid cmu wall above so top flanges will be embed. Is it laterally supported or not. I think not.
I do not consider a steel lintel in a masonry wall braced. You could go about determining if the top flange is braced if it is embedded into a bond beam above and the bond course is attached to vertical reinforcing at the ends of the opening to transfer the load up and down to the floor/roof diaphragms. Being as this is 40' long I would not count on that, or be very careful about using that.
The bottom line is that it's assumed unbraced unless you can figure out a way to show that it's braced.
The 13th Ed. Spec. Appendix 6 provides ways to determine if a beam is braced against twist or compression flange lateral translation--prove one or the other or both.
Depending on the details of your situation, you might be able to show that it's braced. Of course it requires plenty of judgment.