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



Charles,

Your right, as can be seen from the joblog.

The below RUNSQL

RUNSQL REQUEST(' select ''UPPENFILES'' as MyLib, ''STMTM3P'' as MyFile, GQBGUN, count(*) as MyCount FROM UPpenfiles/STMTM3P GROUP BY GQBGUN ORDER by GQBGUN') OUTPUT(*PRINT)

Results with this STRQMQRY

OVRPRTF FILE(QPQXPRTF) TOFILE(*LIBL/QPQXPRTF)

STRQMQRY QMQRY(RUNSQL) OUTPUT('*PRINT')
ALWQRYDFN(*YES) SETVAR((LINE01 '
select ''UPP') (LINE02 'ENFILES'' as MyLib, ''STMTM3P'' as MyFile,')
(LINE03 ' GQBGUN, count(*) as MyCount') (LINE04 '
FROM UPpenfiles/') (LINE05 'STMTM3P GROUP BY GQBGUN
ORDER by GQBGUN') (LINE06 ' ') (LINE07 ' ') (LINE08 ' ') (LINE09 ' ')
(LINE10 ' '))

Paul

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Charles Wilt
Sent: Tuesday, September 27, 2016 3:20 PM
To: Midrange Systems Technical Discussion
Subject: Re: SQL output to Printer - anyway of marking/tagging the spoolfile with the PF name

Most custom RUNSQL commands I've seen use QMQRY in the background.

I don't see any reason why QMQRY couldn't have given you the same output.
Or even nicer if you'd created a QMFORM to go with the query.

Charles

On Tue, Sep 27, 2016 at 3:09 PM, Steinmetz, Paul <PSteinmetz@xxxxxxxxxx>
wrote:

If which date field can be determined from a list of all the date
fields in the [record format of the] file, or if there is only ever
one date field for the [record format of the] file, then there are
numerous ways to obtain the column name(s) to enable making that substitution.
Although just as Manuel suggested for an approach, I would probably
defer to the Query Management Query (QMQRY) variable substitution
feature [Set Variables (SETVAR) of the Start QM Query (STRQMQRY)]
instead of whatever that custom RUNSQL uses\does.

I don't think QMQRY would have an output as nice as the SQL.

09/27/16 15:02:54 PAGE 1
LIB FILE Statement MYCOUNT
Date
UPPENFILES CBCBILP 101/03/07 38,800
UPPENFILES CBCBILP 101/03/16 53,399
UPPENFILES CBCBILP 101/03/25 50,599

Paul

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of
CRPence
Sent: Tuesday, September 27, 2016 3:02 PM
To: midrange-l@xxxxxxxxxxxx
Subject: Re: SQL output to Printer - anyway of marking/tagging the
spoolfile with the PF name

On 27-Sep-2016 13:48 -0500, Rob Berendt wrote:
Now, if I knew the name of the date field for all the files, I could
submit this to batch, substituting the 3 variables:

Library
File
Date

RUNSQL REQUEST(' select ''UPPENFILES'' as MyLib, ''STMTM3P'' as
MyFile, GQBGUN, count(*) as MyCount FROM UPpenfiles/STMTM3P GROUP
BY GQBGUN ORDER by GQBGUN') OUTPUT(*PRINT)

Run it across an entire library.

If which date field can be determined from a list of all the date
fields in the [record format of the] file, or if there is only ever
one date field for the [record format of the] file, then there are
numerous ways to obtain the column name(s) to enable making that substitution.
Although just as Manuel suggested for an approach, I would probably
defer to the Query Management Query (QMQRY) variable substitution
feature [Set Variables (SETVAR) of the Start QM Query (STRQMQRY)]
instead of whatever that custom RUNSQL uses\does.

--
Regards, Chuck

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.