Natural/DB2

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

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

You can use both Find/Read statements or SQL.

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

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.

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

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

as the documents in this site reflect only current documentation, you have to go to 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

Thanks alot Kelly

Thanks alot Kelly

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.

Use the NDBNOERR subprogram to suppress the normal error handling.

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

There is an example program CALLNOER in the SYSDB2 library.

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