Summing up of values using Syncsort

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
anu.slaksh
Member
Posts: 11
Joined: Tue Nov 13, 2007 1:57 pm

Summing up of values using Syncsort

Post by anu.slaksh » Thu Nov 15, 2007 10:12 am

I hav a doubt.
my input file is of length 850..

ACNO X(9) - POSITION 9
AMT S9(15)V9(3) - POSITION 347

for same accounts i need to sum the amount values and those with single accounts original amt value should be taken and written to the output file.

i used..

INREC FIELDS=(1,9,12:347,10)
SORT FIELDS=(9,9,CH,A)
SUM FIELDS=(10,10,PD)

but am gettin sum fields overlap..
can anyone help me out..
anu

anu.slaksh
Member
Posts: 11
Joined: Tue Nov 13, 2007 1:57 pm

Post by anu.slaksh » Thu Nov 15, 2007 2:02 pm

sorry above error is solved..
anu

anu.slaksh
Member
Posts: 11
Joined: Tue Nov 13, 2007 1:57 pm

Post by anu.slaksh » Thu Nov 15, 2007 4:32 pm

i have one more doubt..

i have 3 input files

input file 1: FB/850 (duplicates exists)
---------------------------------------------
acct x(9) - position 9
amt s9(15)v9(3) comp-3 - postion 347

input file 2: FB/200:(no duplicates)
-----------------------
acct x(9) - postion 9
add x(3) - positon 114

input file 3: FB/162:(no duplicates)
----------------------
acct x(9) - position 1
balance s9(15)v9(3) comp-3 - postion 33 (declared as array with occurs 10 times)

here i need to
1) add the amt values for same accts
2) add the 10 balance values for a single account
3) and need to fetch the add for tat account for the input file 1
4) write all the 4 datas to a single output file.

that is
output file
-----------
add x(3)
acct x(9)
amt s9(15)v9(3)
balance s9(15)v9(3)

for eg:
input file 1:
-----------
aaaaaaaaa 2345
aaaaaaaaa 1234
bbbbbbbbb 1111

input file 2:
-------------
aaaaaaaaa ABC
bbbbbbbbb BCA

input file 3:
-------------
aaaaaaaaa 1 1 0 1 0 1 1 0 1 0(10 values of balance)
bbbbbbbbb 1 1 0 1 0 1 1 0 1 0 (")

output file:
-------------
ABC aaaaaaaaa 3579 6
BCA bbbbbbbbb 1111 6

is tis possible in a single sort??
anu

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Thu Nov 15, 2007 9:08 pm

Since you stated in another post that you're using Syncsort, please post in the JCL Forum rather than in the DFSORT Forum. I'm moving this post to the JCL Forum.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others