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

compare two fields


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

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Mon Mar 13, 2006 4:08 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Mar 13, 2006 10:12 pm
Reply with quote

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
View user's profile Send private message
Deepa.m

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Tue Mar 14, 2006 10:41 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Mar 14, 2006 9:42 pm
Reply with quote

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
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 and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Compare two files with a key and writ... SYNCSORT 3
No new posts Compare latest 2 rows of a table usin... DB2 1
Search our Forums:

Back to Top