Access to DDMs without referencing a view

Hello all!

I got the following map:

* MAP2: PROTOTYPE             --- CREATED BY UNIX 6.1.1 ---            
* INPUT USING MAP 'XXXXXXXX'                                           
*     TESTDDM.TESTFIELD                                                
DEFINE DATA PARAMETER                                                  
1 TESTDDM.TESTFIELD (A015)                                             
END-DEFINE                                                             
FORMAT PS=001 LS=051 ZP=OFF SG=OFF KD=OFF IP=OFF                       
* MAP2: MAP PROFILES *****************************        200**********
* .TTAAAMMOO   D I D I N D I D I        ?_) &:+(                       
* 001050        N0NNUCN____         X        01 SYSDBA  NL           1 
***********************************************************************
INPUT          (     IP=OFF                                           /
                                                                       
 015T TESTDDM.TESTFIELD  (AD=OILFHW' ' ) /*.09U015 A015 .              
* MAP2: VALIDATION ****************************************************
* MAP2: END OF MAP ****************************************************
END

Plus the following program:

DEFINE DATA LOCAL                                   
1 VIEW01 VIEW TESTDDM
  2 TESTFIELD
1 VIEW02 VIEW TESTDDM
  2 TESTFIELD
*
END-DEFINE
*
GET VIEW01 10688
GET VIEW02 9312
INPUT USING MAP 'TESTMAP1' /* ISN 9312 is on the map
GET VIEW02 10688
GET VIEW01 9312
INPUT USING MAP 'TESTMAP1' /* ISN 9312 is on the map 
GET VIEW01 9312
GET VIEW02 10688
INPUT USING MAP 'TESTMAP1' /* ISN 10688 is on the map
END

Question: On the map, I’m referencing TESTDDM and not VIEW01 or VIEW02. How can this work? From my point of view, my program should not be stowable. But it is.

Without the GETs, I will get a NAT0247.

:?: :?: :?: :?:

This behavior seems reasonable to me.

If you paste fields from a program (or subprogram, etc) onto a map, then the map is available only to that program. If you paste fields from a view onto a map, as you have done, then the map is available to any program using those fields. (That’s a functional description, not an “interals” one.)

If there were only one view in your example, then we could consider VIEW01.TESTFIELD and TESTDDM.TESTFIELD to be synonyms. But your example has two views of the same DDM, so the Natural compiler uses the GET statements (which contain a view name) to qualify the field references.

Thanks for answering.
Your’re right. It is the compiler. But I think, this isn’t reasonable. That’s crazy.

Another example:

GET VIEW01 10688
perform get_view02_9312
INPUT USING MAP 'TESTMAP2' /* ISN 10688 is on the map
*
define subroutine get_view02_9312
  get view02 9312
end-subroutine
*
INPUT USING MAP 'TESTMAP2' /* ISN 9312 is on the map
if 1 = 0
  get view01 10688
end-if
INPUT USING MAP 'TESTMAP2' /* ISN 10688 is on the map
*
get view02 10688
READ (1) view01  by ISN starting from 9312
END-READ
INPUT USING MAP 'TESTMAP2' /* ISN 10688 is on the map

Now I’m wondering, where this “feature” is documented… :wink: