RPG iv with no file definitions…

5 pts.
Tags:
RPG ILE
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:
iseries

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.

Tom

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.

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
  • 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.
    41,430 pointsBadges:
    report
  • 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:
    report
  • 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.
    6,875 pointsBadges:
    report
  • Kathan
    I m not sure but you can try /COPY in your program and can do what you are trying to do.
    70 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