doubts programming with maps - information from two files

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

Did you take a look at the Natural map editor documentation about inserting fields ?

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

Not really sure what your problem is

  1. Reading Seller via Customers.Seller_Code
  2. Displaying Customer + Seller information

'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

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.

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

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?

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.

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)?

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)

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.

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

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

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.

Take a look at REINPUT FULL.

and SET KEY for the keys…

as I block the ESC in map?

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.

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

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?