View previous topic :: View next topic
|
Author |
Message |
rohitcognizant
New User
Joined: 13 Feb 2007 Posts: 54 Location: Pune India
|
|
|
|
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 |
|
|
muthuvel
Active User
Joined: 29 Nov 2005 Posts: 217 Location: Canada
|
|
|
|
did you make a try and what was the result you got? |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
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 |
|
Back to top |
|
|
rohitcognizant
New User
Joined: 13 Feb 2007 Posts: 54 Location: Pune India
|
|
|
|
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 |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
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 |
|
|
rohitcognizant
New User
Joined: 13 Feb 2007 Posts: 54 Location: Pune India
|
|
|
|
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 |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|