View previous topic :: View next topic
|
Author |
Message |
Deepa.m
New User
Joined: 28 Apr 2005 Posts: 99
|
|
|
|
I want to compare the 3rd and 4th fields of the file and if they match move the matched records to output file 1 else to output file 2.
have some default file attributes and assume other misng details..
i want a sort card for this ..
thanks,
Deepa |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use a DFSORT job like the following to do what you asked for. p3,m3,f3 is the starting position, length and format of your third field and p4,m4,f4 is the starting position, length and format of your fourth field .
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//OUT1 DD DSN=... output file1
//OUT2 DD DSN=... output file2
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=OUT1,INCLUDE=(p3,m3,f3,EQ,p4,m4,f4)
OUTFIL FNAMES=OUT2,SAVE
/*
|
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
Deepa.m
New User
Joined: 28 Apr 2005 Posts: 99
|
|
|
|
Frank,
thanks..but i have made a mistake in explaining the problem...actually there are two files..I need to compare the 3rd field in the first file with the 4th field in the second file. if they are eual move to out1 else out2.
file1:
LLLTEE10 H A 0010000200001650000000000
file2:
LLLL157TESS10H A 005600000000409800000000
THANKS,
DEEPA |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Do you only have one record in each file?
What is the starting position, length and format of the 3rd field in file1?
What is the starting position, length and format of the 4th field in file2?
What is the RECFM and LRECL of file1 and file2? |
|
Back to top |
|
|
|