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



No need for printer files - use QM queries and forms - a QM query is simply an encapsulated SQL statement - in this case, a SELECT statement.

Now an INSERT should never be expected to go to a report - only a SELECT statement will do that.

If Chandana can execute STRQM, there's an easy interface. If not, just CRTSRCPF YOURLIB/QQMQRYSRC RCDLEN(91) and add a member in PDM - put the SELECT statement into the source - not the INSERT part - then save it and execute CRTQMQRY from that source member. To make a report, just execute STRQMQRY with OUTPUT(*PRINT).

To get a nice look to the report, it's easiest by far to have STRQM available - hand-coding forms is for the masochists among us.

The execution of STRQMQRY can easily be done with QCMDEXC, or in a CL module attached to the RPG as needed.

HTH
Vern

At 09:42 PM 11/27/2007, you wrote:

Chandana,

For a one-off, I would do this in iSeries Navigator and then cut & paste
the results into Excel.

If a production report, you need to do the usual printer file, read first
record, loop until eof, print (check for overflow + print), etc.

Hope this helps.

Glenn Gundermann
ggundermann@xxxxxx
(647) 272-3295

> I have the following SQL statement built in free code.
>
> Please advise, how to send this query results to a spoolfile, to print
> the report.
>
>
> EXEC SQL
> INSERT INTO TADYERRPF
> SELECT RPASTR, RPASTR*1 AS STORE, RPEMPL, RPLNM, RPFNM, RPMSG,
> (RPRMO*1000000)+( RPRDA*10000)+RPRYR AS DATE, RPRYR, RPRMO, RPRDA,
> RPFISY, RPFISW, (RPFISY*100)+RPFISW AS FISCAL
> FROM DBREPRINT WHERE RPERR1 <> 11
> ORDER BY RPASTR, RPEMPL, RPMSG, RPRYR, RPRMO, RPRDA
> With NC;
>
> Appreciate your kind assistance.


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.