Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us