file names in rpg/400

1150 pts.
Tags:
RPG/400
RPG/400 Filename Alias
How to alias a file name in rpg/400 program. the problem here is the file name 10 char length and RPG/400 allows a maximum of 8 chars. Please answer...thanks

Answer Wiki

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

Hi,

This is unfortunately one of the limitations of RPG/400. In ILE/RPG the limitation has been removed.

To get around this in RPG/400 you’ll need to use OVRDBF. For example, your file is called FILENAME10, then you could do the following :-

OVRDBF FILE(FILENM10) TOFILE(FILENAME10)

Then in your RPG you would use FILENM10 for your file name instead of FILENAME10 :-

FFILENM10 UF , etc….

You will need to have the OVRDBF in effect at compile time and run time. Normally this will mean running the OVRDBF interactively and compiling interactively to compile your program. Then you would use a small CL program to run the OVRDBF before calling your RPG program.

You can use DLTOVR to remove your OVRDBF.

So, just to summarize :-

<b>To compile</b>
OVRDBF
Compile RPG program.
DLTOVR

<b>To run</b>
OVRDBF
Call RPG program
DLTOVR

Another thing to bear in mind is the maximum of 8 characters for record format name, but then you can use RENAME in your RPG.

Hope this helps.

Regards,

Martin Gilbert.

Discuss This Question:  

 
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

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