OVRDBF FILE(xxx) TOFILE(libl/filename) share(*yes)
In which scenario is share(*yes) used?
could any one explain with an example?
Answers were Sorted based on User's Feedback
Answer / shruti tayal
Suppose you define override on a physical file with
SHARE(*YES) in a CL program, and you call HLL programs from
CL program, by defining SHARE(*yes) all programs who use the
overridden file, will use the same data path, on the
contrary if we dont specify share(*yes), each program will
create its own data path. This is very useful when we use
OPNQRYF, if we dont specify SHARE(*YES) for the file, the
data path created by OPNQRYF will not be of any effect in a
HLL program, as HLL program will create its own data path in
absence of SHARE(*YES).
| Is This Answer Correct ? | 30 Yes | 0 No |
Answer / suju
when we use share(*yes) ODP(open data path) will be shared.
other wise each time system wl create new ODP.its an
overhead.
| Is This Answer Correct ? | 28 Yes | 1 No |
Answer / shobhit
Share(*yes) means Sharing the access path of a fileā¦.
For example
Suppose Physical file have 5 members and you want to access
the records of 3rd member in your program. So OVRDBF
command will be like this.
OVRDBF (File Name) TOFILENAME (File Name) MEMBER (3rd)
SHARE (*YES)
CALL RPG
The RPG program now point to 3rd member of the file and if
you dont use SHARE(*YES) the program will point to 1st
member of the file.
| Is This Answer Correct ? | 11 Yes | 31 No |
How to Define a Procedure in RPG?
i want to display the 10000 record in a subfile by using loadall , can we do it?
How can we create subsystem in as400?
In Which Specs Arrays, Tables & Constants Are Defined?
what is the disadvantage of using global variable?
What is the purpose of the following? I 'CLOSED' C STAT01 I 'OPEN' C STAT02
what keyword must be used with protect keyword ?
How to retrieve data from data area?
What is the Difference between command attention key and command function key ?
how many maximum spaces could be given in o specs?
what is RCLRSC?
What is SFLPAG