This started with a generic program that we use to do batch updates to source files. Since you are changing it to look at a specific file, lets see if we can simplify it.
**Free
Dcl-F FL1 Extmbr(OvrMbr) Usage(*Update)
Rename(FL1:RFL1) usropn;
Dcl-S OvrMbr Char(10);
Ovrmbr = 'SQ9' ;
open FL1;
Read RFL1 ;
Dow Not %Eof(FL1) ;
If srcdat = 190109;
srcdat = 0;
Update RFL1 ;
EndIf;
Read RFL1 ;
EndDo;
Close FL1 ;
*Inlr = *On;
Return;
Or - you could even get rid of the overrides and do that outside of the program.
OVRDBF FILE(FL1) TOFILE(LIB1/FL1) MBR(SQ9) OVRSCOPE(*JOB)
CALL YOURPROGRAMNAME
With YOURPROGRAMNAME being this.
**Free
Dcl-F FL1 Usage(*Update)
Rename(FL1:RFL1);
Read RFL1 ;
Dow Not %Eof(FL1) ;
If srcdat = 190109;
srcdat = 0;
Update RFL1 ;
EndIf;
Read RFL1 ;
EndDo;
*Inlr = *On;
Return;
On Tue, 2020-01-14 at 15:27 +0100, techie21 IT wrote:
Hi,
even after using uppercase below errors appear now:-
got below errors now whereas lib1 is on top of lib. list currently:-
5770WDS V7R3M0 160422 RN IBM ILE RPG LIB1/DA2
M e s s a g e S u m m a r y
Msg id Sv Number Message text
RNF7030 30 3 The name or indicator is not defined.
RNF7451 30 1 A built-in function is not defined; built-in function is
ignored.
RNF7503 30 5 Expression contains an operand that is not defined.
RNF2120 40 1 External description not found for file specified as
externally described; file ignored.
* * * * * E N D O F M E S S A G E S U M M A R Y * * * * *
**Free
Dcl-F FL1 Usage(*Update)
Rename(FL1:RFL1) usropn;
Dcl-S OvrFile Char(21);
Dcl-S OvrMbr Char(10);
OvrFile = 'LIB1/FL1' ;
Ovrmbr = 'SQ9' ;
open overfile.ovrmbr ;
Read RFL1 ;
Dow Not %Eof(FL1) ;
If srcdat = 190109;
srcdat = 0;
Update RFL1 ;
EndIf;
Read RFL1 ;
EndDo;
Close FL1 ;
*Inlr = *On;
Return;
Msg id Sv Number Message text
*RNF0622 20 1 A qualified name is not allowed in this context.
*RNF7030 30 3 The name or indicator is not defined.
*RNF7062 30 1 There is no OPEN for a file that specifies
user-controlled
Thanks
On Tue, Jan 14, 2020 at 2:36 PM Brian Parkins <
<mailto:goodprophet.bp@xxxxxxxxx>
goodprophet.bp@xxxxxxxxx
wrote:
At a very casual glance,
- RPG IV 101 - the literals need to be uppercase:
OvrFile = 'lib1/fl1' ;
Ovrmbr = 'sq9' ;
- and coding typo:
Dow Not %Eof(QRPGSRC) ;
- and shouldn't you be closing the file you opened?
Close QRPGSRC ;
[
https://www.medtronsoftware.com/img/MedtronMinilogo.bmp] Kevin Bucknum
Senior Programmer Analyst
MEDDATA / MEDTRON
120 Innwood Drive
Covington LA 70433
Local: 985-893-2550
Toll Free: 877-893-2550
https://www.medtronsoftware.com
CONFIDENTIALITY NOTICE
This document and any accompanying this email transmission contain confidential information, belonging to the sender that is legally privileged. This information is intended only for the use of the individual or entity named above. The authorized recipient of this information is prohibited from disclosing this information to any other party and is required to destroy the information after its stated need has been fulfilled. If you are not the intended recipient, or the employee of agent responsible to deliver it to the intended recipient, you are hereby notified that any disclosure, copying, distribution or action taken in reliance on the contents of these documents is STRICTLY PROHIBITED. If you have received this email in error, please notify the sender immediately to arrange for return or destruction of these documents.
As an Amazon Associate we earn from qualifying purchases.