[Bulk] Re updating relational file

Bob Deskin Bob.Deskin at ca.ibm.com
Wed Aug 22 14:09:17 CDT 2012


Another thing to look at is the relationship between the PRIMARY and the 
SECONDARY. Is it truly one to one? And is it via a unique key? If you find 
that the SECONDARY table is not retrieving the correct row, then try 
adding UNIQUE to the SECONDARY ACCESS statement..

Bob



From:   "Ken Langendock" <ken.langendock at rogers.com>
To:     "'GREG GREG'" <cassinih at hotmail.com>, <powerh-l at lists.sowder.com>, 

Date:   2012-08-22 03:03 PM
Subject:        RE: [Bulk] Re updating relational file
Sent by:        powerh-l-bounces+bob.deskin=ca.ibm.com at lists.sowder.com



Do you always want to write out the oracle record?
If you do, put a NEED ALL on the file statement.
 
Your preupdate is initializing the fields but not on a FOR loop, so only 
the first record is being altered and written.
 
Try this instead
 
SCREEN MYSCREEN RECEIVING FILE1 ON LINE 10 FOR 14 LINES

FILE FILE1 MASTER                                                  ; 
INDEXED
FILE FILE2 OCCURS 8  ;INDEXED
FILE FILE3 IN MY_ORACLE &
     ALIAS MY_OR SECONDARY &
     NOITEMS &
     OCCURS WITH FILE2 &
     NEED ALL
  ACCESS VIA EMPLOYER,DATE &
       USING EMPLOYER OF FILE2,DATE OF FILE2 

  ITEM EMPLOYER OF MY_OR SECONDARY INITIAL EMPLOYER OF FILE2 FIXED
  ITEM DATE  OF MY_OR SECONDARY INITIAL DATE OF FILE2 

 
Leave the preupdate and update procedures out.

From: powerh-l-bounces+ken.langendock=rogers.com at lists.sowder.com [
mailto:powerh-l-bounces+ken.langendock=rogers.com at lists.sowder.com] On 
Behalf Of GREG GREG
Sent: Wednesday, August 22, 2012 2:29 PM
To: powerh-l at lists.sowder.com
Subject: [Bulk] Re updating relational file
 
Hi,

    I am trying to update a relational file via an Indexed file , but only 
the first record is being updated in the relational file if two or more 
records are updated at once.
    I have to updare the screen twice for the second record to be updated. 
Probably because the PUT verb updates one record at a time The Indexed 
file 
    contains an OCCURS 10 . Can anyone assists me. Thanks in advance.

eg: 

SCREEN MYSCREEN RECEIVING FILE1 ON LINE 10 FOR 14 LINES

FILE FILE1 MASTER                                                  ; 
INDEXED
FILE FILE2 OCCURS 8  ;INDEXED
FILE FILE3 IN MY_ORACLE ALIAS MY_OR SECONDARY NOITEMS OCCURS WITH FILE2    
  ;MY_OR is the relational file
     ACCESS VIA EMPLOYER,DATE &
                USING EMPLOYER OF FILE2,DATE OF FILE2 



PROCEDURE PREUPDATE
   BEGIN
     LET EMPLOYER OF MY_OR = EMPLOYER OF FILE2
     LET DATE        OF MY_OR = DATE OF FILE2

END


PROCEDURE UPDATE
   BEGIN
    Put FILE1
    For FILE2
      Begin
        Put FILE2
        Put FILE1
        PUT MY_OR 
      End
  End
--
= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l at lists.sowder.com
Subscribe: 'subscribe' in message body to 
powerh-l-request at lists.sowder.com
Unsubscribe: 'unsubscribe &lt;password&gt;' in message body to 
powerh-l-request at lists.sowder.com
http://lists.sowder.com/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.
Add 'site:lists.sowder.com powerh-l' to your search terms to search the 
list archive at Google.



More information about the powerh-l mailing list