170 pts.
 Update without prior read or chain error
I am getting RNX1221:Update or delete in file without prior input operation on the update of file SRCDTAL in the following code. I don't see what the issue is. Any help would be appreciated. FSRCDTAL UF A E K DISK RENAME(QWHFDML:SRCDTAR) F Prefix('S') D HistData ds qualified D In likerec(SRCDTAR:*input) D Out likerec(SRCDTAR:*output) D overlay(In) Chain (ds2.MLLIB:ds2.MLFILE:ds2.MLNAME) SRCDTAL HistData.In; . . . If %Found(SRCDTAL); HistData.Out = ds2; update SRCDTAR HistData.Out; Else; HistData.Out = ds2; Write SRCDTAR HistData.Out; ENDIF;

Software/Hardware used:
ASKED: November 28, 2007  3:39 PM
UPDATED: December 4, 2007  11:51 AM

Answer Wiki:
Do you have any other file operations on SRCDTAL between the Chain and the If %Found statements because the code you have supplied looks OK. Another idea : Have you check that you do not modify the key fields between the chain and the update ?
Last Wiki Answer Submitted:  December 4, 2007  11:51 am  by  Roblumley   120 pts.
All Answer Wiki Contributors:  Roblumley   120 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _