# FIND viewname WITH descriptor SORTED BY field2

**URL:** <https://techcommunity.softwareag.com/t/find-viewname-with-descriptor-sorted-by-field2/95504>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux, Natural-on-Windows-Unix\
**Created:** [November 30, 2010, 1:59pm UTC](https://techcommunity.softwareag.com/t/find-viewname-with-descriptor-sorted-by-field2/95504 "2010-11-30T13:59:01Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [November 30, 2010, 1:59pm UTC](https://techcommunity.softwareag.com/t/find-viewname-with-descriptor-sorted-by-field2/95504/1 "2010-11-30T13:59:01Z")

</div>

Hello all!

Last weekend we did an upgrade from NAT611@Solaris to NAT639@Solaris.

Some programs are not stowable any more. It’s seems like NAT639 changed in interpretation of SORTED-BY-fields.

For example take the following code:

```auto
define data local
01 sample1 view of sag-tours-e-cruise
02 cruise-id
02 charter-yacht-type
end-define
find sample1 with cruise-id > 0 sorted by charter-yacht-type
display *ISN sample1
end-find
end
```

charter-yacht-type is not a descriptor. You can stow this program under NAT611, but you can’t under NAT639. Why? Is there any Parameter to change this behaviour?

Yesterday I opened up an empower incident. I thought I’ll get a quick answer - because I don’t think this is a rare problem… any ideas?

Regards

Matthias

---

<div class="post-metadata">

**Author:** ![Finn\_the\_Dane1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/finn_the_dane1/32/132_2.png) [@Finn\_the\_Dane1](https://techcommunity.softwareag.com/u/Finn_the_Dane1)\
**Post date:** [November 30, 2010, 2:53pm UTC](https://techcommunity.softwareag.com/t/find-viewname-with-descriptor-sorted-by-field2/95504/2 "2010-11-30T14:53:22Z")

</div>

Hi Mathias,  
I have no idea when this changed - it’s pretty hard to get hold of the documentation - releasenotes for 6.2 nowadays 😉

But the easy workaround is to mark these fields as “Non-descriptor” in the DDM.

Actually I think this compiler-change makes pretty good sense since a unintended use of the sorted by might REALLY put adabas to work !

Finn

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [November 30, 2010, 3:25pm UTC](https://techcommunity.softwareag.com/t/find-viewname-with-descriptor-sorted-by-field2/95504/3 "2010-11-30T15:25:25Z")

</div>

Hi Finn!

You’re right of course. This would be a possible workaround. But before we change dozens of codelines, I want to know if there is a compiler option or something like that.

If not, we have to search for all SORTED-Statements and check, whether they are using descriptor fields or not. That’s a bit time-consuming. Maybe a catall would help for searching… OK, let’s see…

BTW: A natural-611-stowed program runs under NAT639 without any problems. It really seems to be a compiler-change.

Matthias

---

<div class="post-metadata">

**Author:** ![Finn\_the\_Dane1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/finn_the_dane1/32/132_2.png) [@Finn\_the\_Dane1](https://techcommunity.softwareag.com/u/Finn_the_Dane1)\
**Post date:** [November 30, 2010, 3:46pm UTC](https://techcommunity.softwareag.com/t/find-viewname-with-descriptor-sorted-by-field2/95504/4 "2010-11-30T15:46:15Z")

</div>

Hi Matthias  
I would definitely let the compiler do the checking.  
Perhaps make a copy of the relevant libs into a local SPOD and do a CATALL if you don’t want to change the timestamps?!  
Then do a multi-column sort on the compiler-errors+sourceline in the result-window(CTRL+CLICK on the relevant columns - if you didn’t know that trick already;-).  
This should give you a much quicker look at the “sorted by” statements with problems.  
Finn

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [November 30, 2010, 8:43pm UTC](https://techcommunity.softwareag.com/t/find-viewname-with-descriptor-sorted-by-field2/95504/5 "2010-11-30T20:43:28Z")

</div>

Hi Finn!

Finally I got an answer from SAG.

> [@](#):
>
> the reason why this was working in NAT611 is due to a bug that has been corrected in the following versions NAT62x and NAT63x.

So I have to say: You are completely right!

Thanks for your hint, but I’m on Solaris using a simple terminal session.

Matthias

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [November 30, 2010, 8:58pm UTC](https://techcommunity.softwareag.com/t/find-viewname-with-descriptor-sorted-by-field2/95504/6 "2010-11-30T20:58:08Z")

</div>

Meanwhile we did a catall.

Here the next change from NAT6.1.1 → NAT6.3.9.  
It’s just one byte. Guess what byte? 😉

```auto
define data local
1 #a20 (A20)
1 #a10 (A10)
end-define
input #a20 #a10
if #a10 = " "
  reinput "enter value" mark * #a10
end-if
end
```

---

<div class="post-metadata">

**Author:** ![Finn\_the\_Dane1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/finn_the_dane1/32/132_2.png) [@Finn\_the\_Dane1](https://techcommunity.softwareag.com/u/Finn_the_Dane1)\
**Post date:** [November 30, 2010, 9:03pm UTC](https://techcommunity.softwareag.com/t/find-viewname-with-descriptor-sorted-by-field2/95504/7 "2010-11-30T21:03:26Z")

</div>

Did that really compile under 6.1.1 ?!  
I mean a space between \* and variable in a reinput makes no sense in any version - or have you really discovered a new (old) bug in 6.1.1 😉  
Finn

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [November 30, 2010, 9:44pm UTC](https://techcommunity.softwareag.com/t/find-viewname-with-descriptor-sorted-by-field2/95504/8 "2010-11-30T21:44:30Z")

</div>

> [@Finn the Dane](#):
>
> Did that really compile under 6.1.1 ?!

Yes, it does.  
It’s compilable on NAT 6.1.1 for Windows and for Solaris. But the catall-Error-List shows more than this error. Let’s see…

---

<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:** [November 30, 2010, 10:32pm UTC](https://techcommunity.softwareag.com/t/find-viewname-with-descriptor-sorted-by-field2/95504/9 "2010-11-30T22:32:22Z")

</div>

Finn,

That space in the REINPUT is acceptable on the mainframe, too, under 4.2.3 and 4.2.5.

---

<div class="post-metadata">

**Author:** ![Finn\_the\_Dane1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/finn_the_dane1/32/132_2.png) [@Finn\_the\_Dane1](https://techcommunity.softwareag.com/u/Finn_the_Dane1)\
**Post date:** [December 1, 2010, 1:23pm UTC](https://techcommunity.softwareag.com/t/find-viewname-with-descriptor-sorted-by-field2/95504/10 "2010-12-01T13:23:07Z")

</div>

he-he - interesting undocumented features 😉

- just found that even the MF Natural 4.2.7 compiler supports the blank after “\*” !

On the other hand I looked up in the oldest doc. I could find (Nat2.1.2 from the days I started with Natural) where there is no documentation of this feature.

Finn

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [December 1, 2010, 7:49pm UTC](https://techcommunity.softwareag.com/t/find-viewname-with-descriptor-sorted-by-field2/95504/11 "2010-12-01T19:49:02Z")

</div>

BTW:

```auto
reinput "enter value" mark* #a10
```

→ works only on NAT 6.1.1

```auto
reinput "enter value" mark*#a10
```

→ works on NAT 6.1.1 and 6.3.9

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [December 3, 2010, 7:12pm UTC](https://techcommunity.softwareag.com/t/find-viewname-with-descriptor-sorted-by-field2/95504/12 "2010-12-03T19:12:33Z")

</div>

> [@Finn the Dane](#):
>
> I would definitely let the compiler do the checking.  
> Perhaps make a copy of the relevant libs into a local SPOD and do a CATALL if you don’t want to change the timestamps?!

Today I realized: There’s a new catall option to do a check only. Very good.

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [December 6, 2010, 2:36pm UTC](https://techcommunity.softwareag.com/t/find-viewname-with-descriptor-sorted-by-field2/95504/13 "2010-12-06T14:36:14Z")

</div>

Next differece between Nat 6.1.1 and Nat 6.3.9: The internal date/time-checks are more restrictive now.

```auto
define data local
01 #a20 (A20) /* e.g. for superdescriptor
01 redefine #a20
02 #a16 (A16)
02 #d (D)
end-define
if #d < *DATX /* NAT1305 here
  ignore
end-if
end
```

This code runs on Nat 6.1.1 without error but throws a runtime error on Nat 6.3.9.  
I think that’s OK.

---

<div class="post-metadata">

**Author:** ![Finn\_the\_Dane1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/finn_the_dane1/32/132_2.png) [@Finn\_the\_Dane1](https://techcommunity.softwareag.com/u/Finn_the_Dane1)\
**Post date:** [December 6, 2010, 2:58pm UTC](https://techcommunity.softwareag.com/t/find-viewname-with-descriptor-sorted-by-field2/95504/14 "2010-12-06T14:58:47Z")

</div>

I guess this is one of the reason for the often used standard of defining superdescriptor keys as B20 instead of A20 !?  
Finn

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [December 6, 2010, 4:16pm UTC](https://techcommunity.softwareag.com/t/find-viewname-with-descriptor-sorted-by-field2/95504/15 "2010-12-06T16:16:38Z")

</div>

> [@Finn the Dane](#):
>
> I guess this is one of the reason for the often used standard of defining superdescriptor keys as B20 instead of A20 !?

Yes, it is. But predict builds a DDM with A20. That’s odd.

OK, the programmer can use a B20 anyway…

---

<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:** [April 2, 2021, 2:59pm UTC](https://techcommunity.softwareag.com/t/find-viewname-with-descriptor-sorted-by-field2/95504/16 "2021-04-02T14:59:27Z")

</div>


