I get the same thing when I test this -- my 'program B' subfile does not appear, but the window in my 'program C' does. This is because the display file for ProgB is created with the option DFRWRT(*YES). Changing the display file to DFRWRT(*NO) makes the programs behave exactly the way you want them to.
DFRWRT(*YES) tells the workstation controller to 'Defer writing the display formats until you receive a READ'. So, your program sends display formats using WRITE, and the workstation controller just stores them all -- it does not send the display formats to the screen device until your program sends either a READ operation or an EXFMT.
When your ProgB calls ProgC, ProgC uses EXFMT to write-then-read its own format. The workstation controller sends this format to the screen, leapfrogging the stored formats from ProgB. When ProgC ends, and control returns to ProgB, ProgB does a READ and the workstation controller then sends the formats and waits for user input to return to ProgB.
So, change the display file for ProgB to DFRWRT(*NO). You should ONLY do this in situations like this - usually, DFRWRT(*NO) is a bad option to use, since it can cause screen flashing and other strange effects.
This was first published in April 2008