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
 

 

comparision of two files on a particular field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 130
Location: Guntur

PostPosted: Sat Jan 19, 2008 12:10 am    Post subject: comparision of two files on a particular field
Reply with quote

hi ,

i have a requirement like i have two files each with 5183 record length and fba recfm

now i have to compare the two files depending on a particular field in it

can any one give me a sort card using which i can compare only that field in both the files if got mismatch then display it in the output file.
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: Sat Jan 19, 2008 12:19 am    Post subject:
Reply with quote

Your requirement is unclear and your description does not contain any real details.

Please show an example of the records in each input file (relevant fields only) and what you expect for output. Give the starting position, length and format of each relevant field. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 130
Location: Guntur

PostPosted: Sat Jan 19, 2008 12:27 am    Post subject:
Reply with quote

hi frank,

thanks for your response

file1

name addr city state eff-dt .......
aaaa sssss dddd fffff 20060604

file2

name addr city state eff-dt .......
aaaa sssss dddd fffff 20070604


the eff-dt for some of the records is changing those records i need to trace out.

eff-dt is of length 10

since rec lngth is 5183 it is from 4510 to 4520

you take recordlength as 80 and give me the sort card i will change it accordingly.
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 456
Location: Belgium

PostPosted: Sat Jan 19, 2008 1:15 am    Post subject:
Reply with quote

Quote:
eff-dt is of length 10

since rec lngth is 5183 it is from 4510 to 4520

4510 to 4520 makes length of 11...
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Jan 19, 2008 1:37 am    Post subject: Reply to: comparision of two files on a particular field
Reply with quote

And the data posted look like a length of 8 . . .

Quote:
If you can't convince them, confuse them
It is working icon_smile.gif
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: Sat Jan 19, 2008 1:54 am    Post subject:
Reply with quote

Balakrishna,

Besides the confusion about where the key is and how long it is, you still didn't say anything about duplicates, or show a good example of input records and expected output records. Are you trying to provide the minimum information you can get away with? I'm happy to help, but I don't have time to guess at what you want, and I can't read your mind.
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 130
Location: Guntur

PostPosted: Mon Jan 21, 2008 11:00 am    Post subject: Reply to: comparision of two files on a particular field
Reply with quote

Hi All,

I am very sorry that i didn't provide you all the information you needed,

both the files are ps having same type of data, but some of the records differs,i need to track those records and write into another file.

both the files have same attributes with record length 5183 and recfm fba,

i cant give you the exact example since it is very big record, i am giving you the sample which reflects the same as i need.

file-1 :
name addr city sum-no eff-dt

file-2 :
name addr city sum-no eff-dt

here sum-no is the unique key and eff-dt i need to check in both the files whether same or not.

sum-no is of length 10 from 60-69

eff-dt length 10 from 70-79

name is of length 20
addr of length -30
city of length 10

now can you give me sort card for this, file size for this sample is 80 and recfm is fba.

if i forgot any information to specify kindly let me know.
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 Jan 21, 2008 11:04 pm    Post subject:
Reply with quote

Quote:
i cant give you the exact example since it is very big record, i am giving you the sample which reflects the same as i need.


I don't need the entire record - I just need the relevant fields which appear to be the sum-no and eff-dt.

I still don't know what you want to do. I don't know if either file can have duplicates within it. I don't know if every record in file1 has a sum-no match in file2, or there are records in file1 with a sum-no that isn't in file2, or there are records in file2 with a sum-no that isn't in file1 or what. I don't know if you just want records from file1 in the output, or just records from file2 in the output, or records from file1 and file2 in the output.

You don't seem to understand how to explain your requirement (despite the fact that there are hundreds of examples on this board), so I'll show you an example of what I'm looking for.

Let's say that every record in file1 has a sum-no match in file2, and for output you want the records from file1 and file2 that have a match on sum-no but don't have a match on eff-dt. There are no duplicates for sum-no within file1, and there are no duplicates for sum-no within file2.

So for example (I'm just showing the sum-no and eff-dt):

Input file1 has these records:

Code:

.....KEY01     2008-01-21
.....KEY02     2008-01-10
.....KEY03     2008-01-18
.....KEY04     2008-01-19


and input file2 has these records:

Code:

.....KEY01     2008-01-21
.....KEY02     2008-01-11
.....KEY03     2008-01-17
.....KEY04     2008-01-19


and you want the output file to contain these records:

Code:

.....KEY02     2008-01-10
.....KEY02     2008-01-11
.....KEY03     2008-01-17
.....KEY03     2008-01-18


then you could use this DFSORT/ICETOOL job:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//CON DD DSN=...  input file1
//    DD DSN=...  input file2
//OUT DD DSN=...  output file
//TOOLIN DD *
SELECT FROM(CON) TO(OUT) ON(60,10,CH) ON(70,10,CH) NODUPS
/*


Now, depending on what you really want, the job would change accordingly. So if you can show me what you want with examples like I gave above, then I can show you how to do it with DFSORT/ICETOOL.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Jan 22, 2008 1:01 am    Post subject:
Reply with quote

You can use SUPERC with the CMPCOLM statement.

O.
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 130
Location: Guntur

PostPosted: Tue Jan 22, 2008 11:55 am    Post subject:
Reply with quote

Hi Frank,

What you have understood is exactly same as what i need.

except the output file it should be like below
Code:

sum-no   eff-dt1             eff-dt2
KEY02     2008-01-10      2008-01-11
KEY03     2008-01-17      2008-01-18



and there will not be any duplicates in both the files and the change will be in eff-dt field only in both the files remaining data will be same in both the files for each and every record. The number of records are also same in both the files.

From next post onwards i will try to elaborate my requirement clearly.
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 Jan 22, 2008 10:58 pm    Post subject:
Reply with quote

Now we're getting somewhere.

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL                                         
//TOOLMSG DD SYSOUT=*                                             
//DFSMSG  DD SYSOUT=* 
//IN1 DD DSN=...  input file1
//IN2 DD DSN=...  input file2
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)     
//OUT DD DSN=...  output file                                           
//TOOLIN DD *                                                     
COPY FROM(IN1) TO(T1) USING(CTL1)                                 
COPY FROM(IN2) TO(T1) USING(CTL2)                                 
SPLICE FROM(T1) TO(OUT) ON(1,10,CH) -                             
 WITH(27,10) USING(CTL3)                                         
/*                                                               
//CTL1CNTL DD *                                                   
  INREC BUILD=(1:60,10,11:70,10,36:X) 
/*                           
//CTL2CNTL DD *                                                   
  INREC BUILD=(1:60,10,27:70,10)         
/*                       
//CTL3CNTL DD *                                                   
  OUTFIL FNAMES=OUT,INCLUDE=(11,10,CH,NE,27,10,CH)
/*               


OUT will have:

Code:

KEY02     2008-01-10      2008-01-11 
KEY03     2008-01-18      2008-01-17 


Not sure why your output example shows the dates reversed for KEY03.
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 456
Location: Belgium

PostPosted: Wed Jan 23, 2008 6:40 pm    Post subject:
Reply with quote

SYNCSORT is not DFSORT plouf
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: Wed Jan 23, 2008 10:18 pm    Post subject:
Reply with quote

Prashant,

My job runs fine with DFSORT's ICETOOL. But the SYT messages indicate you're using Syncsort's SYNCTOOL, not DFSORT's ICETOOL.

I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm


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