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

What is Double Update in Natural?


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Gatbys

New User


Joined: 04 May 2008
Posts: 3
Location: Stockholm, Sweden

PostPosted: Mon Jun 01, 2009 2:58 pm
Reply with quote

Hi,

While doing READ BY ISN, I have encountered a term "Double Update".
Can anyone please explain what is "Double Update"?

Thanks for your time.

Cheers,
Gatbys.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Jun 02, 2009 12:32 am
Reply with quote

Working in Natural for 12 years, this is the first time I've heard of the term.

You said "I have encountered a term ...". Can you specify where? I couldn't find it in any of the formal manuals.

O.
Back to top
View user's profile Send private message
Ralph Zbrog

New User


Joined: 21 Nov 2009
Posts: 58
Location: California

PostPosted: Fri Dec 11, 2009 1:39 pm
Reply with quote

This problem is more often referred to as "record migration" or "block migration." Often DBAs will recommend READ BY ISN as a means to avoid double updates.

Let's say that your company has had a banner year, so all employees are getting a 10% raise. The most efficient way to process an entire file is with a READ PHYSICAL, so you write
Code:
DEFINE DATA LOCAL
1 EMP    VIEW EMPLOYEES
  2 PERSONNEL-ID
  2 SALARY (1)
END-DEFINE
*
R.
READ EMP PHYSICAL
  ASSIGN SALARY (1) = SALARY (1) * 1.10
  DISPLAY PERSONNEL-ID
          'New/Salary' SALARY (1)
  UPDATE (R.)
  ---  et logic  ---
END-READ
END

It so happens that the first record processed has a salary go from 99,900 to 109,890. The record length has increased by 1 byte, but the Adabas block was full prior to the increase and the updated record will no longer fit back in this block. The record automatically is migrated by Adabas to another block, say block 100. Since you are performing a physical read, that same record will be processed again when block 100 is reached, receiving another 10% increase.

READ BY ISN avoids the problem, because each record/ISN is processed only once, regardless of block migrations.
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 -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts Help in extracting data between doubl... DFSORT/ICETOOL 5
No new posts Read a flat file and update DB2 table JCL & VSAM 2
No new posts how to update an ISR appl var from an... TSO/ISPF 8
No new posts IMS DB using Natural Language IMS DB/DC 0
No new posts DB2 SQL query to read and update data... DB2 12
Search our Forums:

Back to Top