In a particular program one file is used where override
command is applied to a file, now this program calls
another program where we want to use the same file but
without override.How it can be done?
Answers were Sorted based on User's Feedback
Answer / syam
Before calling another program use DLTOVR fileName LVL(*).
LVL(*) = Call Level (*CALLLVL)
If I am wrong pls correct
Is This Answer Correct ? | 15 Yes | 1 No |
Answer / syam
Sekhar214's answer is correct....Thanks
DLTOVR FILE(Filename) LVL(*JOB)
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / david lex
The question is somewhat ambiguous. The OVRDBF command
contains MANY parameters, all of which have a very
different impact on the file.
Very often the OVRDBF is used to access the same file in a
different library, but that is not always the case.
It is also of note that the TYPE of programs are not
mentioned - are they CL, CLLE, OPM RPG, ILE RPG, COBOL...
or a combination? It does make a difference, specifically
as to whether you even need to take this approach.
The most common scenario is a CL overriding a file/Lib1 to
file/Lib2 then calling an RPG/Cobol pgm. But in this
scenario the override is generally required in the
RPG/Cobol program.
Answer one does not address the override. Unless using
embedded SQL or some non standard technique, one must
include the file being used in the F-specs regardless of an
override scenario.
Answer two (with nuances) will have the desired effect, but
there are other things to consider before merely removing
the override.
Do you need the override in place upon return to the
calling program? If you do, you'll have to re-issue the
override.
Additionally, the call level on the DLTOVR command must be
the same that was on the original OVRDBF issued, otherwise
it will fail (albeit silently) with something
like 'Override not found at specified level'.
Defaults on the system in question also come into play.
What is your default activation group?
There are a variety of ways to handle this, each with
strengths & weaknesses.
Embedded SQL, new activation groups, using a QUALIFIED file
opening, call stored procedures, exported procedures in a
service program, etc.
It VERY much depends on the original intention of the file
override to begin with.
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / sekhar214
Depends on the coding. If that is an interactive JOB and OVERSCOPE os on *JOB level, you have delete the overrides.
DLTOVR *ALL LVL(*JOB)
If that is a batch job , no impact on other jobs.
Is This Answer Correct ? | 0 Yes | 1 No |
Suppose File Name(MyFile) is overriding to File(MyFile1) in
one Cl program (i.e ClPGM1) by
Ovrdbf File(MyFile) ToFile(MyLib/MyFile1)
Now You are calling the program(i.e RPG1)in Cl Pgm(CLPGM1)
and want to use same file(MyFile1)
So Just Declare the File in F- spec
F MyFile1 IE F Disk
.
.
.
In this way we can use the file
Hope you got your answer!
Thanks!!
Is This Answer Correct ? | 3 Yes | 13 No |
Suppose we add one field in physical file and this physical file is used by several programs.how do we know which program is using that file? What are the impact analysis.
Need a sql query: retrieve all duplicate records in table?
How do you find whether a job is a batch job or interactive?
Can we trigger an rpg program which has user interaction with display file when updating a file using the command ADDPFTRG?
In a particular program one file is used where override command is applied to a file, now this program calls another program where we want to use the same file but without override.How it can be done?
Suppose we have 10 records with same name and we are reading using READE,after 4 record i have to use CHAIN what is the output
How can we receive values from a called procedure in RPG?
check existence of one record without using chain or read?
How can you delete records form a file in rpg without using "Delete" OPCODE?
Difference between RESET and CLEAR
1.Load an runtime array of length 99 from the pf and you want to handle all the possible errors?
I need to generate outfile for object of all the user lib. in the sysmte using cmd DSPOBJD. But this cmd is correcpted in my server,Any body tell me is there any alternative...?