Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Syncsort: help with whatIthinkare REALLY COMPLICATED Totals

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort: help with whatIthinkare REALLY COMPLICATED Totals
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Getting sum on Totals and Adjusted to... balaji81_k DB2 5 Fri Mar 24, 2017 7:51 pm
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us