# doubts programming with maps - information from two files

**URL:** <https://techcommunity.softwareag.com/t/doubts-programming-with-maps-information-from-two-files/101629>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux\
**Created:** [October 21, 2012, 12:54am UTC](https://techcommunity.softwareag.com/t/doubts-programming-with-maps-information-from-two-files/101629 "2012-10-21T00:54:35Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Claudio\_Muller](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/claudio_muller/32/518_2.png) [@Claudio\_Muller](https://techcommunity.softwareag.com/u/Claudio_Muller)\
**Post date:** [October 21, 2012, 12:54am UTC](https://techcommunity.softwareag.com/t/doubts-programming-with-maps-information-from-two-files/101629/1 "2012-10-21T00:54:35Z")

</div>

Hi,  
need to create a maps to include records  
when I program with maps  
how do I get data from a file to the map?

eg  
include registration of carriers  
and registration required carriers to the region it serves

carriers is a file  
region is a file

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [October 21, 2012, 10:10am UTC](https://techcommunity.softwareag.com/t/doubts-programming-with-maps-information-from-two-files/101629/2 "2012-10-21T10:10:41Z")

</div>

Did you take a look at the Natural map editor documentation about [inserting fields](http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat6313win/edis/edis_win_map.htm#edis_win_map_Importing_Fields) ?

---

<div class="post-metadata">

**Author:** ![Claudio\_Muller](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/claudio_muller/32/518_2.png) [@Claudio\_Muller](https://techcommunity.softwareag.com/u/Claudio_Muller)\
**Post date:** [October 21, 2012, 10:50pm UTC](https://techcommunity.softwareag.com/t/doubts-programming-with-maps-information-from-two-files/101629/3 "2012-10-21T22:50:35Z")

</div>

I know this tutorial.  
I do not know is how to take the data from the natural to the map.

FILE 4: Customers  
code  
name  
address  
city  
seller code

FILE 5: Seller  
Seller code  
Seller name

I need to map customer  
select the seller

This would be the relationship:  
Customers.Seller\_Code → Seller.Seller\_code

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [October 22, 2012, 12:10am UTC](https://techcommunity.softwareag.com/t/doubts-programming-with-maps-information-from-two-files/101629/4 "2012-10-22T00:10:30Z")

</div>

Not really sure what your problem is

1. Reading Seller via Customers.Seller\_Code
2. Displaying Customer + Seller information

---

<div class="post-metadata">

**Author:** ![Claudio\_Muller](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/claudio_muller/32/518_2.png) [@Claudio\_Muller](https://techcommunity.softwareag.com/u/Claudio_Muller)\
**Post date:** [October 22, 2012, 12:56am UTC](https://techcommunity.softwareag.com/t/doubts-programming-with-maps-information-from-two-files/101629/5 "2012-10-22T00:56:16Z")

</div>

'll get there

I’m creating a map to include a new customer

when include a customer (in map)

must provide a list of seller (in map)  
for that 1 is selected

I think that should be the 1) Reading Seller via Customers.Seller\_Code

---

<div class="post-metadata">

**Author:** ![Claudio\_Muller](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/claudio_muller/32/518_2.png) [@Claudio\_Muller](https://techcommunity.softwareag.com/u/Claudio_Muller)\
**Post date:** [October 23, 2012, 4:19pm UTC](https://techcommunity.softwareag.com/t/doubts-programming-with-maps-information-from-two-files/101629/6 "2012-10-23T16:19:20Z")

</div>

Hello everybody.  
If anyone can help me I appreciate it.

I can not make the exchange of information between the program and the natural map (with Adabas).

I’ve read a tutorial in the documentation that makes a little integration between them,  
more in this tutorial there is no shipping  
program data for the map.

Is there any other tutorial on this subject?

A simple example of what I do.

Program → Map  
Map want a field to ask the customer code (Ok)  
Map → Program (with the Customer Code) OK  
Program → Read  
Read adabas / file and find data (Ok)  
Program → Map  
Sent data (the adabas / file / find) (?)  
Map → display data (received from the program) (?)

If anyone can help me I appreciate it.

I have to thank Wolfgang that has helped me.

---

<div class="post-metadata">

**Author:** ![Nikolay\_Kuhta](https://avatars.discourse-cdn.com/v4/letter/n/35a633/32.png) [@Nikolay\_Kuhta](https://techcommunity.softwareag.com/u/Nikolay_Kuhta)\
**Post date:** [October 23, 2012, 6:02pm UTC](https://techcommunity.softwareag.com/t/doubts-programming-with-maps-information-from-two-files/101629/7 "2012-10-23T18:02:08Z")

</div>

Well, Claudio, it is NOT that hard:

\*\* Example READ-MAP

* * *

DEFINE DATA LOCAL  
1 MYVIEW VIEW OF EMPLOYEES  
2 NAME  
END-DEFINE  
\*  
READ (1) MYVIEW BY NAME  
END-READ  
input using map ‘MYMAP’  
END  
\*\*  
Where MYMAP looks as follows:

- MAP2: PROTOTYPE VERSION 820 — CREATED BY NAT 0802020003 —
- INPUT USING MAP ‘XXXXXXXX’
- 

```
EMPLOYEES.NAME

```

DEFINE DATA PARAMETER  
1 EMPLOYEES.name (A030)  
END-DEFINE  
FORMAT PS=023 LS=080 ZP=OFF SG=OFF KD=OFF IP=OFF

- MAP2: MAP PROFILES \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 410\*\*\*\*\*\*\*\*
- .TTAAAMMOO D I D I N D I D I ?\_)¬&:+(
- 023079 N0NNUCN X 01 D22KUHM NL

* * *

INPUT ( IP=OFF

010T ‘This is a NAME field’  
033T EMPLOYEES.NAME (AD=MILT ) /\*.99V030 A030  
/\*\*A1000020000100001000010000100001100001001001000001000HV  
/  
/  
/  
END

Perhaps, it looks a bit confusing, but you just need to try all of this on your own since it is VERY EASY - just follow the NATURAL HELP exercises…  
Best of luck

---

<div class="post-metadata">

**Author:** ![Claudio\_Muller](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/claudio_muller/32/518_2.png) [@Claudio\_Muller](https://techcommunity.softwareag.com/u/Claudio_Muller)\
**Post date:** [October 23, 2012, 6:15pm UTC](https://techcommunity.softwareag.com/t/doubts-programming-with-maps-information-from-two-files/101629/8 "2012-10-23T18:15:31Z")

</div>

Hi Nikolay,  
thanks for help.

* * *

Where MYMAP looks as follows:

- MAP2: PROTOTYPE VERSION 820 — CREATED BY NAT 0802020003 —
- INPUT USING MAP ‘XXXXXXXX’
- EMPLOYEES.NAME  
DEFINE DATA PARAMETER  
1 EMPLOYEES.name (A030)  
END-DEFINE  
FORMAT PS=023 LS=080 ZP=OFF SG=OFF KD=OFF IP=OFF
- MAP2: MAP PROFILES \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 410\*\*\*\*\*\*\*\*
- .TTAAAMMOO D I D I N D I D I ?\_)¬&:+(
- 023079 N0NNUCN X 01 D22KUHM NL

* * *

## INPUT ( IP=OFF 010T ‘This is a NAME field’ 033T EMPLOYEES.NAME (AD=MILT ) /\*.99V030 A030 /\*\*A1000020000100001000010000100001100001001001000001000HV END

I create a map that will have the field name:  
A) I better create field by import a DDM or;  
B) I better create field by importing the program?

after create field in map: where do I put this source code?

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [October 23, 2012, 6:28pm UTC](https://techcommunity.softwareag.com/t/doubts-programming-with-maps-information-from-two-files/101629/9 "2012-10-23T18:28:43Z")

</div>

Modify the map and STOW it to generate an “executable” object. It’s a bit cleaner (less confusing) to paste fields from the calling routine, rather than from a DDM. Fileds are passed between your program and the map in a parameter list, just like in a subprogram call (CALLNAT), so all fields on the map should be available in the calling routine.

In the program, use an INPUT USING MAP ‘map-name’ statement to create the linkage to the external map.

---

<div class="post-metadata">

**Author:** ![Claudio\_Muller](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/claudio_muller/32/518_2.png) [@Claudio\_Muller](https://techcommunity.softwareag.com/u/Claudio_Muller)\
**Post date:** [October 23, 2012, 8:17pm UTC](https://techcommunity.softwareag.com/t/doubts-programming-with-maps-information-from-two-files/101629/10 "2012-10-23T20:17:50Z")

</div>

I’m almost there!

a question:

1. I want to first ask the customer code
2. then back to the program
3. I read the customer file
4. and then show on map customer data (name address)

Should I make two maps?

- One Map to request for the customer code (map with only code field)?

- Another Map to display the data (code, name, addres)?

---

<div class="post-metadata">

**Author:** ![Nikolay\_Kuhta](https://avatars.discourse-cdn.com/v4/letter/n/35a633/32.png) [@Nikolay\_Kuhta](https://techcommunity.softwareag.com/u/Nikolay_Kuhta)\
**Post date:** [October 23, 2012, 9:03pm UTC](https://techcommunity.softwareag.com/t/doubts-programming-with-maps-information-from-two-files/101629/11 "2012-10-23T21:03:41Z")

</div>

Well, Claudio, you may use only one map with all of those fields on it. When there`s still no CUST-CODE entered, the customer info is blank; as soon as you got any VALID data (cust-code), the map would show it (the customer info, I mean)

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [October 23, 2012, 9:45pm UTC](https://techcommunity.softwareag.com/t/doubts-programming-with-maps-information-from-two-files/101629/12 "2012-10-23T21:45:41Z")

</div>

Single-function programs and maps can seem simpler to code, but most production applications are built with multi-function models. (Natural Construct does this very well.) With program logic, you determine the user’s mode: retrieve, add, update, delete. Then, using Control Variables, you open or close the appropriate fields on the map. For example, in Retrieval mode, only the key fields are modifiable, the remaining fields are protected (display-only).

To create a multi-function program from scratch is very time-consuming, but once the kinks are ironed out, it’s fairly easy to create new on-line functions by cloning the master copy.

---

<div class="post-metadata">

**Author:** ![Claudio\_Muller](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/claudio_muller/32/518_2.png) [@Claudio\_Muller](https://techcommunity.softwareag.com/u/Claudio_Muller)\
**Post date:** [October 24, 2012, 12:05pm UTC](https://techcommunity.softwareag.com/t/doubts-programming-with-maps-information-from-two-files/101629/13 "2012-10-24T12:05:51Z")

</div>

I like blocking map  
for he only accept the PF10 for example?

Now if I press ESC, ENTER, PF7, etc.  
it closes the map

---

<div class="post-metadata">

**Author:** ![Claudio\_Muller](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/claudio_muller/32/518_2.png) [@Claudio\_Muller](https://techcommunity.softwareag.com/u/Claudio_Muller)\
**Post date:** [October 24, 2012, 12:09pm UTC](https://techcommunity.softwareag.com/t/doubts-programming-with-maps-information-from-two-files/101629/14 "2012-10-24T12:09:33Z")

</div>

I discovered my mistake.

I asked for the customer-code with the input map

I read a file / adabas

and used the reinput. but reinput does not update the data in map.

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [October 24, 2012, 3:49pm UTC](https://techcommunity.softwareag.com/t/doubts-programming-with-maps-information-from-two-files/101629/15 "2012-10-24T15:49:14Z")

</div>

Take a look at REINPUT FULL.

---

<div class="post-metadata">

**Author:** ![Ronald\_Wijchers](https://avatars.discourse-cdn.com/v4/letter/r/e5b9ba/32.png) [@Ronald\_Wijchers](https://techcommunity.softwareag.com/u/Ronald_Wijchers)\
**Post date:** [October 25, 2012, 1:04pm UTC](https://techcommunity.softwareag.com/t/doubts-programming-with-maps-information-from-two-files/101629/16 "2012-10-25T13:04:15Z")

</div>

and SET KEY for the keys…

---

<div class="post-metadata">

**Author:** ![Claudio\_Muller](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/claudio_muller/32/518_2.png) [@Claudio\_Muller](https://techcommunity.softwareag.com/u/Claudio_Muller)\
**Post date:** [October 25, 2012, 4:11pm UTC](https://techcommunity.softwareag.com/t/doubts-programming-with-maps-information-from-two-files/101629/17 "2012-10-25T16:11:07Z")

</div>

as I block the ESC in map?

---

<div class="post-metadata">

**Author:** ![Claudio\_Muller](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/claudio_muller/32/518_2.png) [@Claudio\_Muller](https://techcommunity.softwareag.com/u/Claudio_Muller)\
**Post date:** [October 26, 2012, 1:12pm UTC](https://techcommunity.softwareag.com/t/doubts-programming-with-maps-information-from-two-files/101629/18 "2012-10-26T13:12:54Z")

</div>

Hi.

In runtime,  
if user check “read”  
how to make a field read-only in map (without possibility of update) ?

The field is input not protect in map/editor.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [October 26, 2012, 1:56pm UTC](https://techcommunity.softwareag.com/t/doubts-programming-with-maps-information-from-two-files/101629/19 "2012-10-26T13:56:04Z")

</div>

What about “O” (Output field, protected) ?

---

<div class="post-metadata">

**Author:** ![Claudio\_Muller](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/claudio_muller/32/518_2.png) [@Claudio\_Muller](https://techcommunity.softwareag.com/u/Claudio_Muller)\
**Post date:** [October 26, 2012, 2:51pm UTC](https://techcommunity.softwareag.com/t/doubts-programming-with-maps-information-from-two-files/101629/20 "2012-10-26T14:51:59Z")

</div>

I found this information  
But I just do not know how to put it into practice

tried so most of the error  
input (ad=o) using map ‘map2’

How can I draw the map with some protected field  
or draw a map with all unprotected?

[Next page](https://techcommunity.softwareag.com/t/doubts-programming-with-maps-information-from-two-files/101629.md?page=2)
