View previous topic :: View next topic
|
Author |
Message |
senthilmurugan
New User
Joined: 19 Feb 2008 Posts: 15 Location: chennai
|
|
|
|
Hi Friends,
Could you please help me to merge these records using SORT...or any of the IBM utilities.....
My input file is.....
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6
ABCD0205 5655G53 5655G53 34.01 2009/145
ABCD0205 PQRS000156
ABCD0210 5655G53 5655G53 34.01 2009/145
ABCD0210 PQRS000046
ABCD0260 5655G53 5655G53 34.01 2009/132
ABCD0260 PQRS000169
----+----1----+----2----+----3----+----4----+----5----+----6 |
and i need the output file like this....
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6
ABCD0205 5655G53 5655G53 34.01 2009/145 PQRS000156
ABCD0210 5655G53 5655G53 34.01 2009/145 PQRS000146
ABCD0260 5655G53 5655G53 34.01 2009/132 PQRS000169
----+----1----+----2----+----3----+----4----+----5----+----6 |
thanks in advance for all.....
:-) |
|
Back to top |
|
|
genesis786
Active User
Joined: 28 Sep 2005 Posts: 210 Location: St Katherine's Dock London
|
|
|
|
one way of doing can be..
Code: |
//S1 EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
ABCD0205 5655G53 5655G53 34.01 2009/145
ABCD0205 PQRS000156
ABCD0210 5655G53 5655G53 34.01 2009/145
ABCD0210 PQRS000046
ABCD0260 5655G53 5655G53 34.01 2009/132
ABCD0260 PQRS000169
//OUT DD SYSOUT=*
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(1,8,CH) WITH(46,60)
/*
|
|
|
Back to top |
|
|
senthilmurugan
New User
Joined: 19 Feb 2008 Posts: 15 Location: chennai
|
|
|
|
Thanx genesis786....
It really works fine for me....
:-) |
|
Back to top |
|
|
senthilmurugan
New User
Joined: 19 Feb 2008 Posts: 15 Location: chennai
|
|
|
|
hi...genesis786....Could you help me...?
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6
ABCD0201 5655G53 5655G53 34.01 2009/140
ABCD0205 5655G53 5655G53 34.01 2009/141
ABCD0205 PQRS000156
ABCD0210 5655G53 5655G53 34.01 2009/149
ABCD0210 PQRS000046
ABCD0220 5655G53 5655G53 34.01 2009/145
ABCD0260 PQRS000169
ABCD0260 5655G53 5655G53 34.01 2009/132
ABCD0290 5655G53 5655G53 34.01 2009/195
ABCD0360 5655G53 5655G53 34.01 2009/175
----+----1----+----2----+----3----+----4----+----5----+----6 |
output i am receiving o/p with ur job is...
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6
ABCD0201
ABCD0205 5655G53 5655G53 34.01 2009/141 PQRS000156
ABCD0210 5655G53 5655G53 34.01 2009/149 PQRS000046
ABCD0220
ABCD0260 5655G53 5655G53 34.01 2009/132 PQRS000169
ABCD0290
ABCD0360
----+----1----+----2----+----3----+----4----+----5----+----6 |
but i need out put like this.....
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6
ABCD0201 5655G53 5655G53 34.01 2009/140
ABCD0205 5655G53 5655G53 34.01 2009/141 PQRS000156
ABCD0210 5655G53 5655G53 34.01 2009/149 PQRS000046
ABCD0220 5655G53 5655G53 34.01 2009/145
ABCD0260 5655G53 5655G53 34.01 2009/132 PQRS000169
ABCD0290 5655G53 5655G53 34.01 2009/195
ABCD0360 5655G53 5655G53 34.01 2009/175
----+----1----+----2----+----3----+----4----+----5----+----6 |
I am receiving exact output only if my records have its pair record...
otherwise i am receiving only the key....
pls help me to find the soln...
thanks in advance for all...
:-) |
|
Back to top |
|
|
genesis786
Active User
Joined: 28 Sep 2005 Posts: 210 Location: St Katherine's Dock London
|
|
|
|
i am sure this is not a very elegant way of doing it, but it's one way if you are just interested in getting right output.
Code: |
//S1 EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
ABCD0201 5655G53 5655G53 34.01 2009/140
ABCD0205 5655G53 5655G53 34.01 2009/141
ABCD0205 PQRS000156
ABCD0210 5655G53 5655G53 34.01 2009/149
ABCD0210 PQRS000046
ABCD0220 5655G53 5655G53 34.01 2009/145
ABCD0260 PQRS000169
ABCD0260 5655G53 5655G53 34.01 2009/132
ABCD0290 5655G53 5655G53 34.01 2009/195
ABCD0360 5655G53 5655G53 34.01 2009/175
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(1,1)),DISP=(MOD,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
SORT FROM(IN) TO(T1) USING(CTL1)
SPLICE FROM(T1) TO(OUT) ON(1,8,CH) KEEPNODUPS WITH(46,20)
/*
//CTL1CNTL DD *
SORT FIELDS=(1,8,CH,A,11,1,CH,D)
/*
|
|
|
Back to top |
|
|
|