Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
compare two fields

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Deepa.m
Warnings : 1

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Mon Mar 13, 2006 4:08 pm    Post subject: compare two fields
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 Moderator


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

PostPosted: Mon Mar 13, 2006 10:12 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
Back to top
View user's profile Send private message
Deepa.m
Warnings : 1

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Tue Mar 14, 2006 10:41 am    Post subject:
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 Moderator


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

PostPosted: Tue Mar 14, 2006 9:42 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us