Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Sort Six files mearge to one based on one SEQ ID

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Sort Six files mearge to one based on one SEQ ID
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: 1703
Location: Australia

PostPosted: Fri Feb 13, 2009 3:26 pm    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Fri Feb 13, 2009 3:32 pm    Post subject:
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    Post subject:
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10277
Location: italy

PostPosted: Fri Feb 13, 2009 3:39 pm    Post subject: Reply to: Sort Six files mearge to one based on one SEQ ID
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: 1703
Location: Australia

PostPosted: Fri Feb 13, 2009 3:44 pm    Post subject:
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    Post subject:
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    Post subject:
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10277
Location: italy

PostPosted: Fri Feb 13, 2009 4:10 pm    Post subject: Reply to: Sort Six files mearge to one based on one SEQ ID
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 Moderator


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

PostPosted: Fri Feb 13, 2009 9:33 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us