View previous topic :: View next topic
|
Author |
Message |
socker_dad
Active User
Joined: 05 Dec 2006 Posts: 177 Location: Seattle, WA
|
|
|
|
New topic for SyncSort! (And not related to any of my previous posts).
I've been asked to generate a quick report from a rather large input file that sums on three fields, producing a header, five summary lines and a footer.
Getting the report formatted - and with correct totals - was a breeze. Now I need some help with a couple of "small" formatting issues:
1. The only lines to appear on the report are the ones show below - not the 367,000 file records that I cannot seem to suppress (is there some sort of a NODETL command?).
2. The lines should appear consecutively, with no gaps, i.e., the header on lines 1 & 2 and the trailer lines on 54+).
3. The total records processed should be formatted with commas to separate millions & thousands: 366,499 - not 366499. ANd it should be right-aligned with the other totals - I can force it with the starting position, if I know the total, but if it goes over or under the hundred thousand records, it is misaligned.
Here's where I'm at:
Code: |
082012- BEGIN CONTROL TOTALS FOR MACD9731 DATABASE EXTRACT
CORRECTION FILE
(...366,499 unwanted detail records....)
MACD9731-0001 RECORDS PROCESSED (CORRECTION FILE) ==> 366499
MACD9731-0002 EARNED AMOUNT (CORRECTION FILE) ==> 57,822,094.85
MACD9731-0003 LOSSES PAID AMOUNT (CORRECTION FILE) ==> 38,643,021.79
MACD9731-0004 RESERVES AMOUNT (CORRECTION FILE) ==> 258,339,278.11
--------------------------------------------------------------------------
082012- END CONTROL TOTALS FOR MACD9731 EXTRACT |
Here's excerpts of the pertinent code:
Code: |
SORT FIELDS=(01,02,CH,A)
OUTFIL HEADER1=(...),
TRAILER1=(002:'MACD9731-0001 RECORDS PROCESSED',
038:'(CORRECTION FILE) ==>',
063:COUNT15,/,
|
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
If you only want HEADERn and TRAILERn lines, use NODETAIL. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
If you look at the definition of COUNT15 you may see how to get your commas and how to get it to align due to being the same length as the other fields. |
|
Back to top |
|
|
socker_dad
Active User
Joined: 05 Dec 2006 Posts: 177 Location: Seattle, WA
|
|
|
|
Dang it - I need a syncsort spellchecker......
Still trying to squeeze it down to 9 sequential lines - I've tried the LINES command, but that doesn't seem to work. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
What you need is to indicate when you've edited your post :-) I kept looking, changing mine, then looking back and yours is different again...
Run with the NODETAIL. For the spacing after that, look at your documentation, use scissors and glue on the "interim" report.
Let us know. |
|
Back to top |
|
|
socker_dad
Active User
Joined: 05 Dec 2006 Posts: 177 Location: Seattle, WA
|
|
|
|
Sorry Bill, I hate mispelling words. And I forgot to include my code.
NODETAIL worked great!
And I discovered that what you see in SYSOUT is NOT always what you get in a dataset. It turns out that I was actually getting the line spacing exactly as I wanted, but the SYSOUT on the JESLOG was displaying a lot of extra blank lines.
The last detail (and I have RTFM several times for this!) is formatting the record count in an edited format, with commas. I have tried both COUNT and COUNT15 (couldn't tell any difference between the two), but it will not permit an edit parameter. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
For DFSORT COUNT= allows an EDIT to be applied. If there is nothing similar in your manual, then perhaps a "workaround". If you include a SEQNO on the end of each record, you should find that the value from the final detail record is available on the trailer. That you should be able to EDIT. I can't test this on SyncSort, and don't need to on DFSORT :-)
My spell-checker is inbillt in the browser, only failes me when I ignor it. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Syncsort allows an EDIT.
This is working for a non-zerosuppressed record count:
Code: |
OUTFIL REMOVECC,NODETAIL,
TRAILER1=('TOTAL NEGATIVE: ',COUNT=(M11,LENGTH=7)) |
giving:
Code: |
TOTAL NEGATIVE: 0017597 |
|
|
Back to top |
|
|
socker_dad
Active User
Joined: 05 Dec 2006 Posts: 177 Location: Seattle, WA
|
|
|
|
That did the trick, Mr. Scherrer.
Thanks for all the help folks! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Good to hear it worked for you - thanks for letting us know
d |
|
Back to top |
|
|
|