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

Sort two files and copy them in a single step


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

New User


Joined: 13 Feb 2007
Posts: 54
Location: Pune India

PostPosted: Wed Aug 22, 2007 4:42 pm
Reply with quote

hi
i need to sort two files and copy them in a single step.also, i need to give some include condition for sorting

the intention is somewhat like this
//EXEC PGM SORT
//SORTIN DD DSN=DSNAME1
DD DSN=DSNAME2
//SORTOUT DD DSN=DSNAME3
SYSIN DD DSN=CARDLIBRARY NAME

In the card library, can i give steps for both sorting and including??
im planning to give
SORT FIELDS=(......)
INCLUDE COND =
SORT FILEDS=COPY
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Canada

PostPosted: Wed Aug 22, 2007 5:07 pm
Reply with quote

did you make a try and what was the result you got? icon_question.gif
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Aug 22, 2007 5:11 pm
Reply with quote

rohitcognizant
1. Do you want to SORT and combine the 2 i/p files to one o/p file?
2. Show some example of what you wanted to do? like i/p and o/p records and there details(sample)
3. In the SORT card you show 2 SORT statement's icon_rolleyes.gif
Back to top
View user's profile Send private message
rohitcognizant

New User


Joined: 13 Feb 2007
Posts: 54
Location: Pune India

PostPosted: Wed Aug 22, 2007 5:49 pm
Reply with quote

no i have not tried it out i just wanted to know if that is possible or not...

ok as i cant give two sort statements in one sortcard , how can i carry out this opereation..wot i have is two files having same layouts with header and trailers ..I
have to first remove the header and trailer(that can be done using sort as the first letters of header and trailer will be PIM always).

Then i need to combine all the other records in both the files and make it into a common file.
can i do that??
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Aug 22, 2007 5:57 pm
Reply with quote

rohitcognizant wrote:
wot i have is two files having same layouts with header and trailers ..I
have to first remove the header and trailer(that can be done using sort as the first letters of header and trailer will be PIM always).

Then i need to combine all the other records in both the files and make it into a common file.
can i do that??
Probably, but as long as you are satified with giving out hints as to what you need/want, it will be hard to say for sure....
A couple examples of both your input files and examples of (both?) your output files would be a nice beginning....
Lrecls & recfms? key locations?
Back to top
View user's profile Send private message
rohitcognizant

New User


Joined: 13 Feb 2007
Posts: 54
Location: Pune India

PostPosted: Wed Aug 22, 2007 6:43 pm
Reply with quote

ok the first file has somethging like this

PIM 20070820
002 reece north carolina 300000
003 randy california 400000
PIM 56343999

the second file has contents
PIM 20070820
002 dwayne washington 300000
003 randy charlton 400000
PIM 45634999

i want to make it into a single file having the contents.
002 dwayne washington 300000
003 debra charlton 400000
002 reece north carolina 300000
003 randy california 400000

i juust want to sort the contents in the two files(by the second field "name"
) and get it into an output file without the header and trailer.can i do it in one single step of sorting??
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Aug 22, 2007 7:07 pm
Reply with quote

rohitcognizant wrote:

Code:
PIM 20070820
002 reece  north carolina   300000
003 randy  california       400000
PIM 56343999


the second file has contents
Code:
PIM 20070820
002 dwayne washington       300000
003 randy  charlton         400000
PIM 45634999


i want to make it into a single file having the contents.
Code:
002 dwayne washington       300000
003 debra  charlton         400000
002 reece  north carolina   300000
003 randy  california       400000
Quote:
can i do it in one single step of sorting??
Yes, omit the PIMs and sort on the required field after concatinating the two inputs.......
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: Wed Aug 22, 2007 9:12 pm
Reply with quote

Quote:
juust want to sort the contents in the two files(by the second field "name"


The output you show is NOT sorted that way. But to give you the idea, the DFSORT job you want would be something like this:

Code:

//S1    EXEC  PGM=ICEMAN                       
//SYSOUT    DD  SYSOUT=*                       
//SORTIN DD DSN=...  input file1
//   DD DSN=...  input file2                                   
//SORTOUT DD DSN=...   output file                           
//SYSIN    DD    *                             
  OMIT COND=(1,3,CH,EQ,C'PIM')                 
  OPTION EQUALS                                 
  SORT FIELDS=(p,m,CH,A)                       


where p,m is the starting position and length of the field you want to sort on.
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