IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

BMS map length field greater than zero


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ziko13

New User


Joined: 19 Jul 2018
Posts: 26
Location: Greece

PostPosted: Fri Oct 09, 2020 5:40 pm
Reply with quote

Hi all,

I have a program in which the users are seeing data from a database (in a map) and are able to change or add records.
At first the program is filling the map with data that are already in the database and then , after the enter key has been pressed, it is getting all the data from the map and inserts into the database.
My problem is that I cannot specify when the data is coming from the database , therefore should not be inserted again , and when they are coming from a user action , therefore are new records to be inserted.
I tried checking the length field of a map field greater than zero but still data are inserted twice because when it receives data from the database it is getting set to greater than zero.
I do not have a duplicate error because i have a field in my primary key defined as identity generated always by default.
My next idea for this is to delete all the relevant records from the db and insert from the map but I dont like it.
Any ideas please?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8574
Location: Dubuque, Iowa, USA

PostPosted: Fri Oct 09, 2020 6:41 pm
Reply with quote

Put something in DFHCOMMAREA to let you know which fields were populated from the database before sending the map. If the database record(s) are short enough, you could copy the actual data into DFHCOMMAREA; otherwise, use an indicator byte for each field on the map to denote that it is coming from the database. Check that byte before updating the database with that field.
Back to top
View user's profile Send private message
Ziko13

New User


Joined: 19 Jul 2018
Posts: 26
Location: Greece

PostPosted: Fri Oct 09, 2020 6:47 pm
Reply with quote

yes...I will try the commarea solution
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2672
Location: NYC,USA

PostPosted: Fri Oct 09, 2020 9:40 pm
Reply with quote

Don't FSET help to make that decision? If changed to 1 then insert else no.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts COBOL Table data to a flat file with ... COBOL Programming 5
No new posts Getting OUTREC - SHORT REC error for ... DFSORT/ICETOOL 12
No new posts How to read unpacked field created in... DFSORT/ICETOOL 12
No new posts Negative value - packed field - Natur... Java & MQSeries 0
This topic is locked: you cannot edit posts or make replies. Passing a field name to COBOL program COBOL Programming 10
Search our Forums:

Back to Top