Problem while using two windows

Hi,

I am mainframe Natural developer. The problem I am facing is that I am using two windowed maps in my program(DDCMTMDA & DDCMTMDB). The first one takes input and based on the input the second window is displayed right after it for confirming the input. The problem I am facing is that when i run the program after the first window is displayed and appropirate input is given the second window does not get displayed. Instead the first window is displayed again. If I single step through the program then it works fine and the second window displays as expected.

Part of code attached.

Thanks in advance! Gb.
PROGRAM.TXT (1.36 KB)

Did you post the right sample? Your subprogram snippet has various suspect items:

  • subroutine references “WINDOW=‘CONFIRM’”, but CONFIRM is not in the list of DEFINE WINDOWs in the code snippet.
  • The code in the main REPEAT loop doesn’t respond to PF5, but does have a message “press PF5 to commit”.
  • The subroutine doesn’t affect #SSCDBDB-FINAL, but the mainline REPEAT looks like it expects the subroutine toggle its value

Since there are a lot of flags being thrown around, it makes it hard to tell if the logic is correct and if it affects the display of maps or not…

Just to add to Douglas’s list, there is a DECIDE clause without a VALUE NONE, so the code we are shown will not even compile.

That said, given your description of what you want to do, I would have expected code such as:

INPUT ‘first screen’ window1

if anything “bad” REINPUT

INPUT ‘confirming screen’ window2

if anything bad REINPUT

process

As Douglas noted , there are far too many flags for what seems to be a simple requirement.

steve

Hi,

I am attaching a corrected version of the code. This has the same problem as before.

This program provides users with option to delete records directly from a table by entering the key. This could lead to serious issues and so we are forcing the user to confirm multiple times before the actual deletion. This is one reason we have some extra flags.

Here is the flow. Here the key of table is ps-id.

  1. press pf4 on main screen (code not included). This will display the map PSCMTFI3.
  2. type any ps-id in the field provided and press PF5. On doing so the screen is redisplayed asking user to press ‘ENTER’ to continue with the deletion process.
  3. When the user presses ‘ENTER’ the 2nd screen PSCMTFI4 is displayed. This is the final confirmation screen where the user has to type in ‘YES’ in the field provided and press PF5. Only after this will be record actually get deleted (in DELETE-REC).

#CONFIRM-PSID is used so that the user does not change the ps-id entered between the PF5 & ENTER. If he does he will have to start from PF5.
input field on PSCMTFI3 is PSCMTFI3.#PISP-ID
input field on PSCMTFI4 is PSCMTFI4.#CONFIRM
PROGRAM.TXT (2.02 KB)

Looks like a logic problem to me. When I test a variation of the code you supplied, two windows work just fine. Stepping through with the debugger will affect the *PF-KEY value - you might try “MOVE *PF-KEY to #PF-KEY” and testing #PF-KEY while you debug your logic.

Hi,

Made some changes and its working now.
Issue: modified status of PSCMTFI3.#PISP-ID-CV gets reset only on REINPUT FULL and not on REINPUT.
So changed REINPUT ‘Press ENTER to commit’
to REINPUT FULL ‘Press ENTER to commit’.

Thanks everyone! gB