# ADASQL with CICS COBOL issue trying to INSERT

**URL:** <https://techcommunity.softwareag.com/t/adasql-with-cics-cobol-issue-trying-to-insert/97387>\
**Category:** Forum\
**Tags:** Adabas-Natural, Adabas, Adabas-on-Mainframes, Adabas-Basics-on-Mainframes\
**Created:** [June 9, 2011, 11:58pm UTC](https://techcommunity.softwareag.com/t/adasql-with-cics-cobol-issue-trying-to-insert/97387 "2011-06-09T23:58:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sue\_Sauve](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@Sue\_Sauve](https://techcommunity.softwareag.com/u/Sue_Sauve)\
**Post date:** [June 9, 2011, 11:58pm UTC](https://techcommunity.softwareag.com/t/adasql-with-cics-cobol-issue-trying-to-insert/97387/1 "2011-06-09T23:58:10Z")

</div>

Hi, I am new to CICS COBOL and ADASQL. I am working on a new backend program that is CICS COBOL using ADASQL. We are receiving data via the COMMAREA copyboook from a Webservice. The basic premise of the program is to just insert a new record into the database. I am able to compile the program with no errors. I can run the program with no errors however the data does NOT get written to the database. Anyone please help? This is critical project due next week and I’ve struggled with this for a few days now.

I’ve set up a simple program just to try to get this working.  
I have the BEGIN DECLARE statements in the data definition area. I have the INSERT statement in the code using SET and I follow with a COMMIT WORK after I check for response codes. I then RETURN (to CICS) and sent the response back to the webservice. I am getting zero for return code so I know the flow back and forth is correct. I just cannot figure out why the data isn’t being stored to the database. I have full access to read/update. I can add the record in NATURAL.

I also tried declaring a FIND with SELECT in the data definition and then doing an INSERT with the CURSOR…no luck.

Does anyone have any experience with this? Are there other permissions that need to be set? Is there a piece missing? I have attached my code for you to view.  
[PCPGEA.txt](https://techcommunity.softwareag.com/uploads/short-url/kbyRSk11PUXnnYtFCuKj4JxhKsP.txt) (26.8 KB)  
[PCPGEA\_Copybook.txt](https://techcommunity.softwareag.com/uploads/short-url/d0BvNYpjtJyrrpGDTl2df0UaNw4.txt) (2.02 KB)

---

<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:** [June 10, 2011, 4:44pm UTC](https://techcommunity.softwareag.com/t/adasql-with-cics-cobol-issue-trying-to-insert/97387/2 "2011-06-10T16:44:13Z")

</div>

Are you probably trying to find the newly added record with a descriptor not (correctly) set on the insert ?

I’d try to also display the ISN after the INSERT, then go back and try to GET the record from Natural with  
the displayed ISN.

Best regards,

Wolfgang

---

<div class="post-metadata">

**Author:** ![Sue\_Sauve](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@Sue\_Sauve](https://techcommunity.softwareag.com/u/Sue_Sauve)\
**Post date:** [June 10, 2011, 9:47pm UTC](https://techcommunity.softwareag.com/t/adasql-with-cics-cobol-issue-trying-to-insert/97387/3 "2011-06-10T21:47:35Z")

</div>

Thanks Wolfgang, good idea. The ISN comes back as zero.

---

<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:** [June 11, 2011, 2:15am UTC](https://techcommunity.softwareag.com/t/adasql-with-cics-cobol-issue-trying-to-insert/97387/4 "2011-06-11T02:15:18Z")

</div>

Now that’s weird, I can hardly believe you can get a zero response code AND a zero ISN …

Can you try to display additions 2 + command time as well ?

---

<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:** [June 11, 2011, 3:32am UTC](https://techcommunity.softwareag.com/t/adasql-with-cics-cobol-issue-trying-to-insert/97387/5 "2011-06-11T03:32:21Z")

</div>

Apparently the RCFIND and RCGET NatParms are set OFF to ignore the normal RC113.

I haven’t used ADASQL in years, so I don’t remember where it is specified, but what is the setting for DBID? Verify that the DBIDs specified for the COBOL and Natural programs are the same.

---

<div class="post-metadata">

**Author:** ![Yoram\_ben\_bassat1](https://avatars.discourse-cdn.com/v4/letter/y/839c29/32.png) [@Yoram\_ben\_bassat1](https://techcommunity.softwareag.com/u/Yoram_ben_bassat1)\
**Post date:** [June 12, 2011, 4:52pm UTC](https://techcommunity.softwareag.com/t/adasql-with-cics-cobol-issue-trying-to-insert/97387/6 "2011-06-12T16:52:31Z")

</div>

could you please send us the ADASQL parameters. I am afraid that you are not getting to Adabas. Are you using TWA to call Adabas or Commarea? If is it TWA than it should be defined as at least 28 bytes and if you use commarea there is a specific definition. please look at the ADASQL documentation for the definition.

---

<div class="post-metadata">

**Author:** ![Sue\_Sauve](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@Sue\_Sauve](https://techcommunity.softwareag.com/u/Sue_Sauve)\
**Post date:** [June 17, 2011, 11:13pm UTC](https://techcommunity.softwareag.com/t/adasql-with-cics-cobol-issue-trying-to-insert/97387/7 "2011-06-17T23:13:18Z")

</div>

after looking at the translated code, the call to ‘ADASTWA’ and the EXEC ADABAS statement were never being put in for an insert/update but were on a READ so the code was never even calling ADABAS Turns out the OPTIONS global parameter in the ADASQL proc had been set to NOUPDATE. Once we changed that to UPDATE it worked. Now having security issues but one step further!

Thanks all for your input…

---

<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, 3:00pm UTC](https://techcommunity.softwareag.com/t/adasql-with-cics-cobol-issue-trying-to-insert/97387/8 "2021-04-02T15:00:24Z")

</div>


