|
On 29-Mar-2017 15:21 -0500, Tyler, Matt wrote:
I just realized that with at least ACS 1.1.6.2, maybe less, thatThanks for the tip.
you can build your own examples to be inserted into your SQL code.
So if you have a certain set of parameters for function,
procedures, etc. you can think of these like the RDi templates or
snippets.
Find your ACS user folder where your 5250 configuration is located
and then go into the RunSQLScripts\Examples folder and there should
be a TEST.SQL. The name is not that great but the name is not
important. You can have as many examples you want. Now if we could
just get ACS to follow a link to another folder for a common set of
use examples plus the local user set we would have something.
I just created one using this
-- category: Custom
-- description: Subtotals - With Grouping sets
--
-- Sample with "Detail", subtotal, grand total
-- The trick is the detail is really a subtotal for each row
-- If you don't want detail, omit
-- Any columns selected which are not part of any grouping set, or
aggregate (like sum)
-- The grouping set below flagged as "Detail"
--
SELECT OUTPUT_QUEUE_LIBRARY_NAME,OUTPUT_QUEUE_NAME
, SPOOLED_FILE_NAME, sum(SIZE) as size, sum(TOTAL_PAGES) as pages
, JOB_NAME, CREATE_TIMESTAMP
FROM QSYS2.OUTPUT_QUEUE_ENTRIES
group by grouping sets (
(OUTPUT_QUEUE_LIBRARY_NAME,OUTPUT_QUEUE_NAME, SPOOLED_FILE_NAME,
JOB_NAME, CREATE_TIMESTAMP) -- "Detail"
,(OUTPUT_QUEUE_LIBRARY_NAME,OUTPUT_QUEUE_NAME) -- subtotal
,() -- Grand Total
)
order by OUTPUT_QUEUE_LIBRARY_NAME,OUTPUT_QUEUE_NAME
, SPOOLED_FILE_NAME, JOB_NAME, CREATE_TIMESTAMP;
I just discovered you 'CAN' have multiple files in that Examples folder!
I have two files: crude.sql, subtotal.sql
It will only refresh the "insert from examples - custom" at startup, so
restart run sql scripts or start a new session of it.
Start your comments with lines like the following three: category,
description, blank line. For example:
-- category: Custom
-- description: Subtotals - using Grouping sets
--
You lose all your formatting that you store in your example.
You also lose all your comments that you stored in your example.
Help me work through this.
As an Amazon Associate we earn from qualifying purchases.
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.