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

Sort Six files mearge to one based on one SEQ ID


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
raki_new

New User


Joined: 10 Feb 2009
Posts: 26
Location: chennai

PostPosted: Fri Feb 13, 2009 3:19 pm
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Feb 13, 2009 3:26 pm
Reply with quote

Hi,

you must be doing something wrong.


Gerry
Back to top
View user's profile Send private message
raki_new

New User


Joined: 10 Feb 2009
Posts: 26
Location: chennai

PostPosted: Fri Feb 13, 2009 3:29 pm
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Feb 13, 2009 3:32 pm
Reply with quote

Hi,

you are sorting and not merging, is the file FB or VB ?


Gerry
Back to top
View user's profile Send private message
raki_new

New User


Joined: 10 Feb 2009
Posts: 26
Location: chennai

PostPosted: Fri Feb 13, 2009 3:38 pm
Reply with quote

The file Is VB..
THe ouput is after merging
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Feb 13, 2009 3:39 pm
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Feb 13, 2009 3:44 pm
Reply with quote

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
View user's profile Send private message
raki_new

New User


Joined: 10 Feb 2009
Posts: 26
Location: chennai

PostPosted: Fri Feb 13, 2009 3:55 pm
Reply with quote

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
View user's profile Send private message
raki_new

New User


Joined: 10 Feb 2009
Posts: 26
Location: chennai

PostPosted: Fri Feb 13, 2009 3:56 pm
Reply with quote

The file i gave is just a example
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Feb 13, 2009 4:10 pm
Reply with quote

until You post more descriptive data we cannot do anything,
the jcl does not add any useful info
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Feb 13, 2009 9:33 pm
Reply with quote

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
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top