[Bulk] Re updating relational file
Ken Langendock
ken.langendock at rogers.com
Wed Aug 22 14:02:41 CDT 2012
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sowder.com/pipermail/powerh-l/attachments/20120822/1c833754/attachment.htm>
More information about the powerh-l
mailing list