Displaying data on Map with PF8/PF7 key

Hi All,
My requirement is as below…

I have a MAP. The top area displays the policy holder details. And bottom area displays the number of premiums the policy holder has to pay. This is displayed in a tabular form. Presently the table is designed to displays 27 (9 lines * 3 columns) premiums. Now the enhancement has to be made to display maximum 40 premiums on the screen.

When ever the user gives more than 27 as policy tenure, the screen has to display 27 premiums on the screen. On pressing PF8 the remaining premiums should be displayed on the same screen(Map) with top area policy holder details. And on pressing PF7 the first 27 premiums should be displayed.
Let me draw the map here
===============================================Top area with policy holder details


Year | Field 1 | Filed 2 | Year | Field 1 |Field 2 | Year | Field 1 | Field 2|


2008 |xxxxx |yyyyyy |2017 |xxxxxx|yyyyyy|2026 |xxxxxx |yyyyyy|
2009 |xxxxx |yyyyyy |2018 |xxxxxx|yyyyyy|2027 |xxxxxx |yyyyyy|
2010 |xxxxx |yyyyyy |2019 |xxxxxx|yyyyyy|2028 |xxxxxx |yyyyyy|
1011 |xxxxx |yyyyyy |2020 |xxxxxx|yyyyyy|2029 |xxxxxx |yyyyyy|
1012 |xxxxx |yyyyyy |2021 |xxxxxx|yyyyyy|2030 |xxxxxx |yyyyyy|
1013 |xxxxx |yyyyyy |2022 |xxxxxx|yyyyyy|2031 |xxxxxx |yyyyyy|
1014 |xxxxx |yyyyyy |2023 |xxxxxx|yyyyyy|2032 |xxxxxx |yyyyyy|
2015 |xxxxx |yyyyyy |2024 |xxxxxx|yyyyyy|2033 |xxxxxx |yyyyyy|
2016 |xxxxx |yyyyyy |2025 |xxxxxx|yyyyyy|2034 |xxxxxx |yyyyyy|

other field
PF1…PF3…PF7…PF8…

The above Map only displays 27 premiums. Now on pressing PF8 I am reaching to the next screen. But before going to the next screen, I want to display the remaining premiums on the same screen.

I have changed the Top dim from 27 to 40. The modifications required at program/data area level are already done. The calculation part also completed. Only to display the data is required.

How can I do this?I hope my requirement is clear. If any more clarity is rewuired, than do let me know.

Thanks in Advance
Mishra

Education, Education, Education !!!

In this case, you need to learn all about Natural’s windowing family of commands, the %W commands.

As a first step, try the following

FORMAT LS=158 PS=46

  • this creates a “workspace” that is four screens in size
    WRITE 10/30 ‘this is quadrant 1’ 80x ‘this is quadrant 2’
    35/30 ‘this is quadrant 3’ 80x ‘this is quadrant 4’
    END

Run the program; you will see quadrant 1. At the command prompt, type %W>
You will see quadrant 2. Type %W+, you will be in quadrant 4. etc.

steve

Just to add to Steve’s window suggestion: you can set PF keys to do the %W commands:
SET KEY PF10=‘%W<’ PF11=‘%W>’
etc

The drawback to the window approach is that you have a 24x80 window on a 46x158 “screen” - you don’t see the bottom “other fields” until you window down.

An alternative is to modify the map to display array elements i thru i+26. When the user presses the “more” pf key, re-calculate “i” and re-execute the INPUT statement to show the remaining set (I’d probably split this into 20 + 20 rather than 27+13 to make life easier, but depends on your application…). See the map editor documentation for details on setting a dynamic range to be displayed.

This can be a bit tricky the first time through, so feel free to post more questions if you need to. See the documentation on the map editor array definitions:
http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat424mf/edis/map_mf_array_table.htm#map_mf_array_table_Array_Definition

Hi Kelly,

This is really nice to see. Even if I am yet to find the solution, I think the link you provided will guide me to some extent…

What I guess is, I have to set the parameters here in Top Dim, starting and see.
This should solve my problem probably.
I will contact you all may be after 4 hours. Also may be I will post my questions for more clarification.

Thank you a lot Kelly.

Regards,
Aswini

See the first posting for the Inside Natural thread within Natural General.

It contains an issue of Inside Natural that introduces windowing concepts.

steve

Hi Steve,

The windowing option is one that I can folow. But as I am providing sopution to the end-users, who are not technically literate, I have to make it simple. As always we do to see the next page with PF8 this is what my clinent proposed me.

Looking at another screen, I guess there is something that I can do by chenging the dimentions of the Map. Also I can change the starting position parameters. But I am not sure how to proceed. I have come across such instance for the first time.

Kelly’s link has suggested me something. But I have to be more clear before I do anything else…

In case I need any more help, definately I will turn up to the group.

:slight_smile:
Mishra

Hi,
I am little ok with the present progress in this task. I do not know how to insert the screen shots, so attaching the wod document with my problem and my progress so far.

Could anyone please see to this and help me sorting my problem?

Thanks,
Mishra

[/img]
MAP query.doc (43 KB)

In the attachment, Mishra wrote:

3 columns and 9 rows for each field. (do the download to see the screen snap)

The array definition for the first field. Same for the other 2 fileds. (do the download to see the screen snap)

I have 40 records stored in my GDA.
I have the following initialization
INT-ROW : = 1
MAX-ROW := 27

Logic for PF8
IF INT-ROW + MAX-ROW 1
INT-ROW : = INT-ROW - MAX-ROW
ELSE
Show next screen
END-IF

Now the problem I am facing is Index not with in Array structure (NAT1316). If I reduce the MAX-ROW to 13, this is working. First displaying 27 records, than on pressing it is showing from the 14th record. But I want to display from the 28 record. Not from 14th record. Just to omit the duplicate record in both screens(Same MAP, only using PF7/PF8).

Keeping MAX-ROW as 13 also when I press PF8 for the 2nd time I am getting the same Index error.

What should be my work around to address this problem?


Education, Education, Education.

There are several ways to approach this problem.

First, which has nothing to do with Natural, confirm that the user really doesn’t want to see (alternately) 1-27, then 14-40. As you have seen, that is a rather simple task to program, and you have already written the code.

Second, you could learn windowing, which would simplify the task considerably.

Third, recognize that if the user insists on 1-27 and 28-40, you basically have two Maps, not one. Treat the problem as such, and define two Maps and use them alternately.

Fourth, not pretty, but it might work depending on what the user wants to see. Use Control Variables for all 27 fields on the screen. If you are going to display what I would call an “incomplete” screen, set the screen to “show” 14-40 (as you have now), but use the control variables to make the variables 14-27 non displayable.

Fifth, also not pretty. Instead of dimensioning the arrays as 1:40, make them 1:54. null out 41:54 and keep them null. Now you will not get the index out of range error message. specify ZP=OFF so that you do not see the subscripts 41:54.

Solutions one and three are the simplest.

steve

Hi Steve,

Fantastic solutions
Solution 1 is good. Even I liked it and implemented here. if user is okey with the 14-27 records on the 2nd screen, I am done with the solution.

Solution 2 may not be good for the end-users.

Solution 3 may not be approved by my client. As they are handling data in the same Map.

Before looking at your message, I have done this. But this need to be handled carefully. Changing the Top Dim from 40 to 54 must not force me to change all the arrays to 54. As the max number of records can be only 40.

Its a great forum. I really get the toughest solutions here.

Thanks a lot Steve.

Mishra

One more option. Instead of using the array from your GDA on the map, define a local array with 27 occurrences and move the GDA into the array as appropriate.

1 #MAP-ARRAY (1:27)
  2 FIELD1       (A4)
  2 FIELD2       (N8)
  2 FIELD3       (N5)
...
MOVE BY NAME #GDA-ARRAY (1:27)  TO #MAP-ARRAY (1:27)
...

** pf8 logic:
RESET #MAP-ARRAY (*)
MOVE BY NAME #GDA-ARRAY (28:40) TO #MAP-ARRAY (1:13)

** pf7 logic:
MOVE BY NAME  #GDA-ARRAY (1:27) TO #MAP-ARRAY (1:27)

You could also define the local array as 1:54 and use it in Solution #5 above.

Solution 3 doesn’t need to involve the client: adding another map and toggling between map1 and map2 doesn’t need to change their view as map2 is simply a complete clone of map1 except that it shows (28:40) where map1 shows (1:27). Use the same program and now the PF key logic for “page down” (PF8) just switches to map2 instead of adjusting the index.