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: 10232
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: 10232
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 Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm


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