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

Required help on SORT


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

New User


Joined: 04 Dec 2006
Posts: 63
Location: Hyderabad

PostPosted: Fri Mar 07, 2014 6:53 pm
Reply with quote

Hi All,

Would you please help me out .

Input-1
Code:
TYPE-1    100
TYPE-2    200
TYPE-1    300
TYPE-2    200
TYPE-2    100
TYPE-1    300
TYPE-1    100


Required Output
Code:
TYPE-1    100
TYPE-1    300
TYPE-1    300
TYPE-1    100
TYPE-2    200
TYPE-2    200
TYPE-2    100
888800040000800
999900030000500


in the above
888800040000800
8888-- indicates TYPE-1 related row(1 to 4 Digits)
0004-- indicates number of TYPE-1 records(5 to 8 Digits)
0000800-- indicates sum of TYPE-1 records(9 to 15 Digits)

in the above
999900030000500
9999-- indicates TYPE-2 related row (1 to 4 Digits)
0003-- indicates number of TYPE-2 records (5 to 8 Digits)
0000500--indicates sum of TYPE-2 records (9 to 15 Digits)

Many thanks for your anticipated help.


Regards,
Srini
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Mar 07, 2014 7:59 pm
Reply with quote

Can you post the sysout from any SORT step, so we can see your sofware level for SORT? This will tell us what functions are available on your site.
Back to top
View user's profile Send private message
vicharapusrinu
Warnings : 1

New User


Joined: 04 Dec 2006
Posts: 63
Location: Hyderabad

PostPosted: Sat Mar 08, 2014 10:42 am
Reply with quote

Hi

Thanks for your post,

below are the details.

Code:
SYNCSORT FOR Z/OS    1.4.0.1R   XXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXX         z/OS 1.13.0


Regards,
Venu.
Back to top
View user's profile Send private message
Ronin.

New User


Joined: 28 Feb 2014
Posts: 4
Location: down in the sea

PostPosted: Mon Mar 10, 2014 4:46 am
Reply with quote

Brother,

Adding trailer on the "key field" and using COUNT and SUM option will solve the problem. But that will insert the trailer record once the key changes. So this solution may still need two steps. But I am sure wizards of mainframes present in the forum will have the solution in a step.

Ronin.
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top