# Natural/DB2

**URL:** <https://techcommunity.softwareag.com/t/natural-db2/91474>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes, Natural-Database-and-TP-Monitor-Interfaces-on-Mainframes\
**Created:** [October 5, 2009, 3:11pm UTC](https://techcommunity.softwareag.com/t/natural-db2/91474 "2009-10-05T15:11:59Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ven](https://avatars.discourse-cdn.com/v4/letter/v/f9ae1b/32.png) [@Ven](https://techcommunity.softwareag.com/u/Ven)\
**Post date:** [October 5, 2009, 3:11pm UTC](https://techcommunity.softwareag.com/t/natural-db2/91474/1 "2009-10-05T15:11:59Z")

</div>

Hi,  
I worked on Natural/Adabas and then cobol/DB2 but now I am with Natural/DB2 which is new to me, Can anyone tell me  
1 - Do we write Find/Read statements in natural or should we write Select SQL…for accessing the database  
2 - What are the steps to compile and execute natural/DB2 program?

Please can some tell me these basics

Thanks  
Ben

---

<div class="post-metadata">

**Author:** ![Douglas\_Kelly](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/douglas_kelly/32/102_2.png) [@Douglas\_Kelly](https://techcommunity.softwareag.com/u/Douglas_Kelly)\
**Post date:** [October 5, 2009, 8:00pm UTC](https://techcommunity.softwareag.com/t/natural-db2/91474/2 "2009-10-05T20:00:10Z")

</div>

[http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat425mf/dbms/db2-over.htm#db2-over](http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat425mf/dbms/db2-over.htm#db2-over)

You can use both Find/Read statements or SQL.

---

<div class="post-metadata">

**Author:** ![Ven](https://avatars.discourse-cdn.com/v4/letter/v/f9ae1b/32.png) [@Ven](https://techcommunity.softwareag.com/u/Ven)\
**Post date:** [October 5, 2009, 8:31pm UTC](https://techcommunity.softwareag.com/t/natural-db2/91474/3 "2009-10-05T20:31:48Z")

</div>

Thank you Doug for your quick answer and the link for the documentation, I quickly view the document but still I have a question for 1- A cobol/db2 program we pre-compile, compile,link, bind before we get load module so is it the same process for natural/db2?  
2 - Does Run and Stow command work from command line?

I would appreciate if you can share this knowledge.

Thanks  
Ven

---

<div class="post-metadata">

**Author:** ![Daniel\_Wilson](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@Daniel\_Wilson](https://techcommunity.softwareag.com/u/Daniel_Wilson)\
**Post date:** [October 5, 2009, 9:30pm UTC](https://techcommunity.softwareag.com/t/natural-db2/91474/4 "2009-10-05T21:30:06Z")

</div>

Hi Ven,

When you just stow a Natural/DB2 program it will run dynamically against DB2. If you need the program to run statically against DB2, you will need to run a job that executes a CREATE DBRM command in Natural which will strip out the SQL from the Natural program and wrap them into an assembler program that can then go through the precompile process. The executable module from the assembler program is then placed back inside the Natural program using the MODIFY command in Natural. The DBRM is then bound into DB2.

Just be aware that Natural does not support all DB2 statements, most notably anything added in DB2 v9. (Don’t get me started!)

Of course all of this is included in the documentation that Douglas pointed you to.

---

<div class="post-metadata">

**Author:** ![Ven](https://avatars.discourse-cdn.com/v4/letter/v/f9ae1b/32.png) [@Ven](https://techcommunity.softwareag.com/u/Ven)\
**Post date:** [October 6, 2009, 1:34am UTC](https://techcommunity.softwareag.com/t/natural-db2/91474/5 "2009-10-06T01:34:42Z")

</div>

Thank you Daniel, that’s exactly what I was looking for. And sorry I didn’t get chance to go through the documentation but I will sure find time to go through it so I can make myself more comfortable.

Thanks  
Ven

---

<div class="post-metadata">

**Author:** ![Ramya](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@Ramya](https://techcommunity.softwareag.com/u/Ramya)\
**Post date:** [April 18, 2010, 12:41am UTC](https://techcommunity.softwareag.com/t/natural-db2/91474/6 "2010-04-18T00:41:37Z")

</div>

Hi  
I am not able to open the link mentioned below.I am getting error : The requested page could not be found.

Can you please help me out

[http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat425mf/dbms/db2-over.htm#db2-over](http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat425mf/dbms/db2-over.htm#db2-over)

---

<div class="post-metadata">

**Author:** ![Douglas\_Kelly](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/douglas_kelly/32/102_2.png) [@Douglas\_Kelly](https://techcommunity.softwareag.com/u/Douglas_Kelly)\
**Post date:** [April 21, 2010, 5:21am UTC](https://techcommunity.softwareag.com/t/natural-db2/91474/7 "2010-04-21T05:21:53Z")

</div>

as the documents in this site reflect only current documentation, you have to go to [http://techcommunity.softwareag.com/ecosystem/documentation](http://techcommunity.softwareag.com/ecosystem/documentation), click on Natural, then on the link for the current version (4.2.6 today). Once in the Natural documentation, look for “Database Management Systems Interfaces”, then “Natural for DB2”.

Eventually you end up at a similar place to the original link. [http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat426mf2/dbms/db2-over.htm#db2-over](http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat426mf2/dbms/db2-over.htm#db2-over)

---

<div class="post-metadata">

**Author:** ![Ramya](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@Ramya](https://techcommunity.softwareag.com/u/Ramya)\
**Post date:** [April 21, 2010, 12:23pm UTC](https://techcommunity.softwareag.com/t/natural-db2/91474/8 "2010-04-21T12:23:04Z")

</div>

Thanks alot Kelly

---

<div class="post-metadata">

**Author:** ![Ramya](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@Ramya](https://techcommunity.softwareag.com/u/Ramya)\
**Post date:** [April 21, 2010, 12:25pm UTC](https://techcommunity.softwareag.com/t/natural-db2/91474/9 "2010-04-21T12:25:32Z")

</div>

Thanks alot Kelly

---

<div class="post-metadata">

**Author:** ![Ramasamy\_K1](https://avatars.discourse-cdn.com/v4/letter/r/df788c/32.png) [@Ramasamy\_K1](https://techcommunity.softwareag.com/u/Ramasamy_K1)\
**Post date:** [May 15, 2018, 8:17am UTC](https://techcommunity.softwareag.com/t/natural-db2/91474/10 "2018-05-15T08:17:41Z")

</div>

Natural/Db2

My natural program is trying to update a db2 file and failing with SQL error code = -803 program tries to insert duplicate record/key inside database. I want to do error handling in my program to avoid this failure and write the error record into another dataset. Please suggest me an idea if there is any way.

---

<div class="post-metadata">

**Author:** ![Daniel\_Wilson](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@Daniel\_Wilson](https://techcommunity.softwareag.com/u/Daniel_Wilson)\
**Post date:** [May 15, 2018, 7:24pm UTC](https://techcommunity.softwareag.com/t/natural-db2/91474/11 "2018-05-15T19:24:10Z")

</div>

Use the NDBNOERR subprogram to suppress the normal error handling.

---

<div class="post-metadata">

**Author:** ![Ramasamy\_K1](https://avatars.discourse-cdn.com/v4/letter/r/df788c/32.png) [@Ramasamy\_K1](https://techcommunity.softwareag.com/u/Ramasamy_K1)\
**Post date:** [May 16, 2018, 5:53am UTC](https://techcommunity.softwareag.com/t/natural-db2/91474/12 "2018-05-16T05:53:03Z")

</div>

Thank you Daniel - Could you please provide me one sample ?

---

<div class="post-metadata">

**Author:** ![Daniel\_Wilson](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@Daniel\_Wilson](https://techcommunity.softwareag.com/u/Daniel_Wilson)\
**Post date:** [May 16, 2018, 8:32pm UTC](https://techcommunity.softwareag.com/t/natural-db2/91474/13 "2018-05-16T20:32:44Z")

</div>

There is an example program CALLNOER in the SYSDB2 library.

---

<div class="post-metadata">

**Author:** ![Jean-Christophe\_Brotel](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/jean-christophe_brotel/32/743_2.png) [@Jean-Christophe\_Brotel](https://techcommunity.softwareag.com/u/Jean-Christophe_Brotel)\
**Post date:** [June 2, 2020, 2:10pm UTC](https://techcommunity.softwareag.com/t/natural-db2/91474/14 "2020-06-02T14:10:37Z")

</div>

Hello folks,

Since the latest upgrades - we’re currently running Natural Version … 9.1.1.9 on z/OS - we’ve been faced with several occurrences of DB2 warning SQL code +354 when running static versions of old programmes that had been taken through the static process since the upgrade.

Most of the time, the warning message issued by DB2 was due to the fact some of our host variables bore a shorter length than that of actual columns targeted.

There were also some instances on “select sum” instances with null defined columns.

I would be most grateful if anyone could point me out to a comprehensive document that lists all the cases that have been identified.

Many thanks in anticipation.

Cheers

JCB

---

<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:57pm UTC](https://techcommunity.softwareag.com/t/natural-db2/91474/15 "2021-04-02T14:57:36Z")

</div>


