View previous topic :: View next topic
Author
Message
raki_new New User Joined: 10 Feb 2009Posts: 26 Location: chennai
I want to Sort Six files based on a id present in all files
1,1001,file1,
2,1001,file2,
3,1001,file3,
4,1001,file4,
5,1001,file5,
6,1001,file6,
we need to mearge and put it in sorted order
the problem is its not coming in sorted order
Back to top
gcicchet Senior Member Joined: 28 Jul 2006Posts: 1702 Location: Australia
Hi,
you must be doing something wrong.
Gerry
Back to top
raki_new New User Joined: 10 Feb 2009Posts: 26 Location: chennai
My sort card is:
SORT FIELDS=(60,15,CH,A,
01,02,CH,A)
OUTREC FIELDS=(5,224),CONVERT
END
Instead of this way
1,1001,file1,
2,1001,file2,
3,1001,file3,
4,1001,file4,
5,1001,file5,
6,1001,file6,
it gets sorted in this way
5,1001,file5,
2,1001,file2,
1,1001,file1,
3,1001,file3,
6,1001,file6,
.. Randomly
But 1001,1002,1003. .. are in order
Hope u get my point
Back to top
gcicchet Senior Member Joined: 28 Jul 2006Posts: 1702 Location: Australia
Hi,
you are sorting and not merging, is the file FB or VB ?
Gerry
Back to top
raki_new New User Joined: 10 Feb 2009Posts: 26 Location: chennai
The file Is VB..
THe ouput is after merging
Back to top
enrico-sorichetti Superior Member Joined: 14 Mar 2007Posts: 10873 Location: italy
You are not showing anything useful
You talk about one field, but the sort card quotes 2
the data does not match the sort card
and ... ... ...
show the exact layout and content of the fields
and maybe You might get some help
Back to top
gcicchet Senior Member Joined: 28 Jul 2006Posts: 1702 Location: Australia
Hi,
If your records are VB, then they have a 4-byte RDW followed by the data, you have not allowed for this. 01,02,CH,A is definitely incorrect
Gerry
Back to top
raki_new New User Joined: 10 Feb 2009Posts: 26 Location: chennai
Code:
//STEP010 EXEC PGM=SORT
//SORTIN DD DSN=TXXXX.AE.CONTRACT,
// DISP=SHR
// DD DSN=TXXXX.AE.PARTY,
// DISP=SHR
// DD DSN=TXXXX.AE.AGENT,
// DISP=SHR
// DD DSN=TXXXX.AE.TRANS,
// DISP=SHR
// DD DSN=TXXXX.AE.CHARGE,
// DISP=SHR
// DD DSN=TXXXX.AE.FUND,
// DISP=SHR
//SORTOUT DD DSN=TSOXXXX.ITASCA.AE(+1),
// DISP=(NEW,CATLG,DELETE),
// DATACLAS=DATAF,
// LRECL=14200,RECFM=VB
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(60,15,CH,A, * ACCOUNT ID
01,02,CH,A) * SORTER KEY
//* 92,8,CH,A) * COPYBOOK ID
OUTREC FIELDS=(5,224),CONVERT
END
/*
//*
Back to top
raki_new New User Joined: 10 Feb 2009Posts: 26 Location: chennai
The file i gave is just a example
Back to top
enrico-sorichetti Superior Member Joined: 14 Mar 2007Posts: 10873 Location: italy
until You post more descriptive data we cannot do anything,
the jcl does not add any useful info
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
raki_new,
As Gerry said, since your records are VB, you need to account for the RDW in positions 1-4. The first data byte starts in position 5, not in position 1. Try this:
Code:
SORT FIELDS=(64,15,CH,A, * ACCOUNT ID
05,02,CH,A) * SORTER KEY
Back to top
Please enable JavaScript!