× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



From: MKirkpatrick@xxxxxxxxxxxxxxxxx

My apologies, perhaps I should have been more specific. I want to PRINT a
report just listing data in a file. Thanks.

To create a report in RPG, you have to be able to WRITE to the printer file.
While this can be automated to some degree with the cycle, you still have to
be able to process the records in a result set one row at a time. The only
way to do this in SQL is to use a cursor.

The closest I can think of would be to perform a SELECT into an array of
data structures. I'm pretty sure that's supported, and it doesn't use a
cursor. Then you would loop through the data structures using an index.

If you're selecting records from a single file, though, it might be easier
to use OPNQRYF and OVRDBF SHARE(*YES). OPNQRYF supports most SQL type
syntax, and then you can read the input file just like you would any normal
database file.

Why exactly are you trying to get rid of the cursor? Primarily curiosity,
or is there a programming issue you're having with cursors?

Joe


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.