We discuss the period analysis of two variable mid-B stars that have been observed in the Geneva photometric system between 1981 and 1990. Both HD 34798 and HD 45284 are multiperiodic g-mode pulsators that belong to the group of slowly pulsating B stars. The power spectrum of HD 34798 is characterized by several modes which have about equal power. This star belongs to a visual binary, the other component of which is a singly periodical CP star. Quasi-simultaneous observations of both stars are discussed and turn out to be helpful to illustrate the multiperiodic behavior of HD 34798. Three oscillation modes with a nearly stable amplitude are found; the remaining variability may be due to two very close oscillation modes, or, alternatively, to one mode with an intrinsically variable amplitude. Three oscillation frequencies can be distinguished clearly in the power spectrum of HD 45284. The beat periods for this star are the shortest for any SPB detected so far, and therefore make HD 45284 an excellent candidate for verification of our results and for asteroseimological follow-up.