RPG iv with no file definitions…

5 pts.
hello, I wonder if it is possible to write an rpgile program without defining any of the files it is suposed to use. The idea is to obtain that sort of information by other means, say a servlet. Can anyone give me some pointers on were to get some info about this? thanks Raven

Software/Hardware used:

Answer Wiki

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

Well, you could review functions such as _Ropen() to open files, _Rreadn() to read next, and many related ones. These are documented in the C Runtime Library manual.

Or use SQL. That could be normal dynamic SQL or through SQL CLI. Coding to SQL CLI is essentially just like coding for ODBC.

Except maybe for some of the dynamic SQL, be prepared for a long and difficult project that will be error prone at best and potentially difficult to maintain as PTFs alter database features and upgrades change behaviors. It can certainly be done, but it’s likely to stay pretty limited in scope. Only basic functions — open, close, read and write — might be as good as it gets.

You probably need to work up a general statement of the business problem you’re needing to solve and ask for comments and suggestions on how to solve it.


Discuss This Question: 4  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.
  • CharlieBrowne
    I would agree with Tom that more information is needed in order to give you a good answer. If you do not define any files you have not defined any fields to use in the Calc specs. If you have prefined files, byt the name of the file is changing, you can use OVRDBF. If you are actually reading the file in anotehr program, you can pass the fields in as varaibles and return whatever informaiton you need.
    62,340 pointsBadges:
  • ErnieC
    Use straight forward embeded SQL to do any file handling needed.Check the following URL: here Ernst Editor's Note: Ernst, I've fixed your URL format. Thanks! -Jenny
    25 pointsBadges:
  • WoodEngineer
    You could create procedures that perform all the I/O, then call the procedure from your RPG program. Some developers feel it is better ot have a single routine perform all I/O for a given file. The theory is that this removes program-to-program inconsistancies. I think there was an article on this in System i News within the last couple of years.
    7,900 pointsBadges:
  • Kathan
    I m not sure but you can try /COPY in your program and can do what you are trying to do.
    70 pointsBadges:

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.

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


Share this item with your network: