View previous topic :: View next topic
|
Author |
Message |
laxmi
New User
Joined: 24 May 2005 Posts: 9
|
|
|
|
i have a doubt that how to sort two or more files by
using external sort
plz anyone give syntax
thanks in advance |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
laxmi:
1. What do the files look like (LRECL, RECFM)?
2. What is the key or keys you wish to sort on (position, length, type)?
3. What is the desired output format (i.e. same LRECL and RECFM as the input)? |
|
Back to top |
|
|
laxmi
New User
Joined: 24 May 2005 Posts: 9
|
|
|
|
for example my files are FILE1 , FILE2 having the below data
FILE1
2SINDHU
1SIRI
6AKSHAYA
3PHANI
5RAM
4VIJAY
FILE2
10PREM
7GIRI
9ABDUL
8DEVI
NOW I WANT TO SORT BASED ON THE OFFSETS OF TWO FILES
to get the output of below
1siri
2sindhu
3phani
4vijay
5ram
6akshaya
7giri
8devi
9abdul
10prem
in the third file |
|
Back to top |
|
|
subhash gowda Warnings : 1 New User
Joined: 02 Jun 2005 Posts: 12
|
|
|
|
if ur file parameter and field parameter of the both file are same,then do the df sort for both the file and merge the both the file,then u can get the desired output |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Iaxmi,
You didn't give the LRECL and RECFM of the two input files. So let's assume they both have RECFM=FB and the same LRECL (e.g. 80). Then you can use the following DFSORT job to sort the two files:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file1
// DD DSN=... input file2
//SORTOUT DD DSN=... output file
//SYSIN DD *
SORT FIELDS=(...)
/*
|
Now if your data really looks like you've shown and you have 1-digit numbers in position 1 (e.g. 1) and 2-digit numbers (e.g. 10) in positions 1-2, then you'd have to use a SORT statement like this to sort on those numbers correctly:
Code: |
SORT FIELDS=(1,2,UFF,A)
|
You'll need z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004) in order to use DFSORT's new UFF format. Only DFSORT has this format, so if you don't have DFSORT, you won't be able to use it. If you do have DFSORT, but you don't have the Dec, 2004 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the Dec, 2004 PTF, see:
Use [URL] BBCode for External Links
I assume you don't really want to change the data from uppercase to lowercase as you show in your example, but if you do, DFSORT can do that as well.
If this doesn't answer your question, then you need to be more specific about what you want to do. |
|
Back to top |
|
|
|