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 more than 1 file using the same sort condition

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Abi

New User


Joined: 27 Jul 2005
Posts: 35
Location: Chennai

PostPosted: Mon Jul 20, 2009 3:53 pm    Post subject: Sort more than 1 file using the same sort condition
Reply with quote

Hi,

I have 3 files
File 1 ,File 2 & File 3 .I need to sort all these files using the cond SORT FIELDS=(72,5,CH,A) and need to generate 3 o/p files .

Is it possible to sort 3 different files to form 3 output files with the same sort condition in a single step .
Back to top
View user's profile Send private message

bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 208
Location: Cochin/Kerala/India

PostPosted: Mon Jul 20, 2009 5:36 pm    Post subject:
Reply with quote

Is any way to identify the records which is coming from whcih file?
Can you post the record structure also?
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Mon Jul 20, 2009 5:58 pm    Post subject:
Reply with quote

Abi,

Assuming there is no criteria and just a plain sort on fields (72,5,CH,A)

Code:

//S1      EXEC PGM=ICETOOL                   
//TOOLMSG DD SYSOUT=*                       
//DFSMSG  DD SYSOUT=*                       
//IN1     DD DSN=<INPUT 1>,DISP=SHR         
//IN2     DD DSN=<INPUT 2>,DISP=SHR         
//IN3     DD DSN=<INPUT 3>,DISP=SHR         
//OUT1    DD DSN=<OUTPUT 1>,                 
//           DISP=(NEW,CATLG,DELETE),
//           SPACE=(CYL,(100,100),RLSE)     
//OUT2    DD DSN=<OUTPUT 2>,                 
//           DISP=(NEW,CATLG,DELETE),
//           SPACE=(CYL,(100,100),RLSE)     
//OUT3    DD DSN=<OUTPUT 3>,                 
//           DISP=(NEW,CATLG,DELETE),
//           SPACE=(CYL,(100,100),RLSE)     
//TOOLIN DD *                               
  SORT FROM(IN1) TO(OUT1) USING(CTL1)       
  SORT FROM(IN2) TO(OUT2) USING(CTL1)       
  SORT FROM(IN3) TO(OUT3) USING(CTL1)       
/*                                           
//CTL1CNTL DD *                             
  SORT FIELDS=(72,5,CH,A)                   
/*                                           



OUT1 will have sorted IN1
OUT2 will have sorted IN2
OUT3 will have sorted IN3

Please try this and let me know if this is what you want.
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: Mon Jul 20, 2009 9:53 pm    Post subject:
Reply with quote

Abi,

Whether or not you can do this in one pass or three passes depends on the RECFM and LRECL of the input files, and what the records in each input file look like.

Please show an example of the records in each input file and what you expect for the output files. Give the RECFM and LRECL of the input file. Give the starting position, length and format of each relevant field.
Back to top
View user's profile Send private message
Abi

New User


Joined: 27 Jul 2005
Posts: 35
Location: Chennai

PostPosted: Tue Jul 21, 2009 12:49 pm    Post subject:
Reply with quote

Thank all of you for the response .I tried the jcl given by premkrishnan
.It worked .

Frank ,
All the three files has LRECL=1703 and RECFM=VB
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: Tue Jul 21, 2009 8:38 pm    Post subject:
Reply with quote

Quote:
Please show an example of the records in each input file and what you expect for the output files. Give the RECFM and LRECL of the input file. Give the starting position, length and format of each relevant field.


You only supplied one piece of the three pieces of information I asked for.
Back to top
View user's profile Send private message
Abi

New User


Joined: 27 Jul 2005
Posts: 35
Location: Chennai

PostPosted: Wed Jul 22, 2009 11:45 am    Post subject:
Reply with quote

Sorry ,

All the thre input files consists of agent detailswhich will occur more than once .I need to sort the file on agent id (0GGWT)in position 68 and it's of length 5 so the on similar agents
since it's a VB file i gave starting position of the sort as 72.sort on fields (72,5,CH,A)

EX: i/p File

01B41XXXXXXXXXXXXXXXXXXXXXX0GGWTXXXXXXXXXXXXXXXXXXXXX
01B41XXXXXXXXXXXXXXXXXXXXXX0GGWWXXXXXXXXXXXXXXXXXXXXX
01B41XXXXXXXXXXXXXXXXXXXXXX0GGWWXXXXXXXXXXXXXXXXXXXXX
01B41XXXXXXXXXXXXXXXXXXXXXX0FEGJXXXXXXXXXXXXXXXXXXXXX
01B41XXXXXXXXXXXXXXXXXXXXXX0GGWWXXXXXXXXXXXXXXXXXXXXX
O/P
01B41XXXXXXXXXXXXXXXXXXXXXX0GGWTXXXXXXXXXXXXXXXXXXXXX
01B41XXXXXXXXXXXXXXXXXXXXXX0GGWWXXXXXXXXXXXXXXXXXXXXX
01B41XXXXXXXXXXXXXXXXXXXXXX0GGWWXXXXXXXXXXXXXXXXXXXXX
01B41XXXXXXXXXXXXXXXXXXXXXX0GGWWXXXXXXXXXXXXXXXXXXXXX
01B41XXXXXXXXXXXXXXXXXXXXXX0FEGJXXXXXXXXXXXXXXXXXXXXX
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: Wed Jul 22, 2009 8:54 pm    Post subject:
Reply with quote

Quote:
Please show an example of the records in each input file


each input file. Showing just one input file doesn't help. I'm trying to determine if there's anything unique in each input file that identifies it. If not, then you can't do it in one pass.
Back to top
View user's profile Send private message
Abi

New User


Joined: 27 Jul 2005
Posts: 35
Location: Chennai

PostPosted: Thu Jul 23, 2009 10:16 am    Post subject:
Reply with quote

All the 3 i/p file are of same record structure ,the different is that it consists of different region codes in the 4th position of the file and it's of length is 2.

Can't i use the icetool jcl give above ?
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: Thu Jul 23, 2009 9:43 pm    Post subject:
Reply with quote

Quote:
Can't i use the icetool jcl give above ?


Yes, you can use that 3 pass solution. I was trying to determine if you could use a 1 pass solution which might be more efficient. If each file only has a specific set of region codes, then a 1 pass solution might be possible, but at this point, it's probably not worth pursuing if you're ok with the 3 pass solution.
Back to top
View user's profile Send private message
Abi

New User


Joined: 27 Jul 2005
Posts: 35
Location: Chennai

PostPosted: Mon Jul 27, 2009 4:11 pm    Post subject:
Reply with quote

Hi Frank,
I'm curious to know the 1 pass solution also . icon_biggrin.gif
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Mon Jul 27, 2009 7:53 pm    Post subject:
Reply with quote

It look to me that the ICETOOL solution above uses 1 pass of each of the input files. I believe that that would be more efficient than 1 pass of all 3 files put together. Am I wrong about this? Normally the efficiency goes down by a power of the number of records being sorted, doesn't it?
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: Mon Jul 27, 2009 8:59 pm    Post subject:
Reply with quote

Quote:
I believe that that would be more efficient than 1 pass of all 3 files put together. Am I wrong about this?


You may actually be right (I was thinking of copy operations, not sort operations). However, whether three smaller sorts or one larger sort would be more efficient depends on a lot of factors. The only way to know for sure would be try both and compare. But I agree that I should have said "might be more efficient" rather than "would be more efficient". I've corrected my post.

Quote:
I'm curious to know the 1 pass solution also


If the records of each file are identifiable, we can sort them all and then use OUTFIL with INCLUDE to write the sorted records to the correct output files. I'm guessing the records of each file are NOT identifiable here so that solution wouldn't apply.
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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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