Using below data:
data have;
infile datalines truncover;
input full_string $80.;
datalines;
Factory House and Office > Lighting > Floor Lamps
House Building and Office follows by Lighting then Table Lamps
Factory and Office next Lighting last Wall Lamps & Sconces
Home and Office then Lighting > Hanging & Pendant Lights
Home and Work then Lighting > Hanging & Pendant Lights
;
Using the query builder you then can define a computed column want_string using the following formula:
substrn(t1.full_string, 1, ifn(findw(t1.full_string,'Office',' ','ip')>0, findw(t1.full_string,'Office',' ','ip')+5, 0) )
Which then returns the following result:

The IFN() function gets used to return a value of Zero for strings with no word Office in it.