updating relational file

GREG GREG cassinih at hotmail.com
Thu Aug 23 10:30:24 CDT 2012



Hi ken.langendock



Your  advice with the preupdate worked . I am officially recommending a pay raise for you.Thanks. 


From: ken.langendock at rogers.com
To: cassinih at hotmail.com; powerh-l at lists.sowder.com
Subject: RE: [Bulk] FW: updating relational file
Date: Wed, 22 Aug 2012 17:29:47 -0400

Make sure you remove the LET statements for the FILE3, they are redundant if you are using the NEED ALL. As long as the record status changes via a LET somewhere in the procedures you do not need the NEED ALL. If you want a record created for every FILE2 regardless of the record status, then you either have to do a FOR X LET something or the record status will not change and the records will not be written out (as was the case you were having). You can always do this in the preupdate procedure instead of the LETS and the NEED ALL. FOR MY_OR    BEGIN    IF NEWRECORD OF MY_OR AND &       NOT DELETEDRECORD OF MY_OR       THEN BEGIN            LET EMPLOYER OF MY_OR SECONDARY = EMPLOYER OF FILE2            LET DATE  OF MY_OR SECONDARY = DATE OF FILE2             END    END  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 5:17 PM
To: powerh-l at lists.sowder.com
Subject: [Bulk] FW: updating relational file 

Hi,
      The only problem now is that when trying to delete a record in the screen the error  "Record has been changed since you found it." appears,  which now means that 
       the record/s cannot be deleted.




Subject: RE: updating relational file
Date: Wed, 22 Aug 2012 16:56:57 -0400Hi ken.langendock

Your idea worked with the NEED ALL etc  however  the "Leave the preupdate and update procedures out." didn't. So by including the UPDATE procedure
every thing went through perfectly. All four cluster records updated simultaneously. Thanks a million.

  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 <password>' 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.
--
= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l at lists.sowder.com
Subscribe: 'subscribe' in message body to powerh-l-request at lists.sowder.com
Unsubscribe: 'unsubscribe <password>' 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. 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sowder.com/pipermail/powerh-l/attachments/20120823/98fc5cb7/attachment-0001.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ATT00001
URL: <http://lists.sowder.com/pipermail/powerh-l/attachments/20120823/98fc5cb7/attachment-0001.txt>


More information about the powerh-l mailing list