AS/400: RPG IV

160 pts.
Tags:
RPG
RPG IV
Hi,

I stuck in following scenario.

I have 2 files FILEA in lib LIBA and FILEB in LIBB and have to use both the files in RPG program.

 

Please assist me on this.

 

 

Answer Wiki

Thanks. We'll let you know when a new response is added.

As long as you have both LIBA and LIBB in your library list, the compiler and execution of the program will process the files correctly for you.

_______________________________________________________________________
…unless you have FILEB in LIBA, or FILEA in LIBB. Then you need to define which library you want to use for each file. This can be done in a few different ways.

First, write a CL program that uses the OVRDBF command before calling your RPG program. The OVRDBF command allows you to specify the library where you want your RPG program to find its files.

Another way is to use the EXTFILE keyword on the file specifications in the RPG program. The EXTFILE keyword specifies which file, in which library, is opened. The value can be a literal or a variable. You can specify the value in any of the following forms:

filename
libname/filename
*LIBL/filename

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • philpl1jb
    And you would use a seperate F spec for each file and seperate access commands Phil
    50,465 pointsBadges:
    report
  • Systemiguy
    Getting the library list right is of course the prefered solution but if as mentioned you have multiple copies of the same file in different libraries or for some reason you can't set teh library list the F spec line in RPG would look like this: Ffilea if f 10 disk extfile(liba/filea)
    55 pointsBadges:
    report
  • Samule400
    thanks guys. Using EXTFILE would be easy to resolve this problem.
    160 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following