Q

iSeries application display subfiles with other program windows

In iSeries, the display file for programs may need to be set to DFRWRT(*NO) to display other program windows when using multiple programs jointly. DFRWRT(*YES) tells the workstation controller to 'Defer writing the display formats until you receive a READ'. The program sends display formats using WRITE, and the workstation controller stores them, and does not send the display formats to the screen device until your program sends a READ operation or an EXFMT.

I have 3 programs, ProgA, ProgB and ProgC. ProgB is a subfile and ProgC is a window with a single record. From ProgA, I want to call ProgB to display the subfile but then also call ProgC so the window displays. I don't want the user to be stopped in ProgB and have to press a key to call ProgC. When I changed the Exfmt in ProgB to a "write", the subfile does not display. Though I do get the window record.

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

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchEnterpriseLinux

SearchDataCenter

Close