5 pts.
 RPG iv with no file definitions…
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
ASKED: December 26, 2009  10:30 PM
UPDATED: May 19, 2010  11:34 AM

Answer Wiki:
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
Last Wiki Answer Submitted:  December 28, 2009  2:31 am  by  TomLiotta   108,300 pts.
All Answer Wiki Contributors:  TomLiotta   108,300 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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.

 32,915 pts.

 

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 pts.

 

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.

 5,525 pts.

 

I m not sure but you can try /COPY in your program and can do what you are trying to do.

 70 pts.