IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Syncsort: help with whatIthinkare REALLY COMPLICATED Totals


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
luis_pr

New User


Joined: 13 Oct 2007
Posts: 19
Location: Fort Worth, Tx USA

PostPosted: Tue Apr 26, 2011 9:50 am
Reply with quote

I am running SYNCSORT FOR Z/OS 1.3.2.1R trying to do what I thought was going to be a piece of cake. Turns out today IS MONDAY and this is going downhill.

I have been reading Syncsort for Z/OS 1.3 Programmer's Guide for help but I just do not see how to do this.

My input records have three key fields that I call Major Key Field, Middle Key Field and Lower Key Field. Associated with each key field is a quantity. I simplified things by making my input file have the same Major Key Field Value on ALL input records.

If asll the record have a key of 123 and a quantity of 7, I want to print that qty on the Totals Line. I tried using TRAILER1 as shown below but apparently I cannot use EDIT on TRAILER1:
063:068,6,PD,EDIT=(II,III,IIT.TTT-),
*

It is hard to tell above where the asterisk that denotes a syntax error goes. It is located below the comma prior to "PD".

Again, all records will have the same Major Key Value and the same associated major quantity on all the records. I want to print the quantity (not sum it and print it).

Next problem, the middle key field and the middle quantity. The input file can have one or more records with a given middle key value; every record with the same middle key will have the same value ion the middle quantity. I want to total the middle qty once per middle key value in the TOTALS Line. So, if the input file has 10 records with a middle key value of 123 and each one of those records has a quantity of 7, I only want the total to be 7 not 70. I tried several forms of TRAILER1 but got nowhere. How do I tell TRAILER1 to do this? Or do I do it some other way?

Summation of the third key & third quantity was normal summation and I had no problems with this. No question there. TRAILER1 worked fine and I am happy with the result.

If it helps, here is a sampling of records with keys/qtys as well as what I would want to see in the Totals Line:

MAIN KEY A, QTY=6, MIDDLE KEY = BB, QTY = 2, LOWER KEY=CCC, QTY = 1
MAIN KEY A, QTY=6, MIDDLE KEY = BB, QTY = 2, LOWER KEY=DDD, QTY = 1
MAIN KEY A, QTY=6, MIDDLE KEY = EE, QTY = 1, LOWER KEY=FFF, QTY = 1
MAIN KEY A, QTY=6, MIDDLE KEY = GG, QTY = 3, LOWER KEY=HHH, QTY = 1
MAIN KEY A, QTY=6, MIDDLE KEY = GG, QTY = 3, LOWER KEY=III, QTY = 1
MAIN KEY A, QTY=6, MIDDLE KEY = GG, QTY = 3, LOWER KEY=JJJ, QTY = 1
MAIN KEY A, QTY=6, MIDDLE KEY = KK, QTY = 0, LOWER KEY=LLL, QTY = 1
MAIN KEY A, QTY=6, MIDDLE KEY = KK, QTY = 0, LOWER KEY=MMM, QTY = 1
MAIN KEY A, QTY=6, MIDDLE KEY = KK, QTY = 0, LOWER KEY=NNN, QTY = 1
MAIN KEY A, QTY=6, MIDDLE KEY = PP, QTY = 0, LOWER KEY=NNN, QTY = 1

TOTALS: 6 6 10

Note: at this point, the Major Key Field Value for all the records is the same which is the reason that I am using TRAILER1 instead of something else. I do not need sub-totals for each different value of the Middle Key Fields.

TIA,
Luis
Back to top
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Tue Apr 26, 2011 11:48 am
Reply with quote

People can help better if you show your sort card along with sample input and output. Also possibly the error messages from the spool.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
No new posts Syncsort "Y2C" Function SYNCSORT 1
No new posts Arithmetic division using Syncsort SYNCSORT 6
Search our Forums:

Back to Top