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
 
comparing file

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

New User


Joined: 10 Feb 2008
Posts: 19
Location: bhuneswar

PostPosted: Fri Nov 27, 2009 10:50 pm    Post subject: comparing file
Reply with quote

1) to extract the last record from file A and compare the extracted record with records from file B, If a match is found place duplicate records in file C,
If file B also has duplicate records, they needs to be placed in file C,
2) File D to contain unique records

Files record length 2000 and Fixed block.

For example

FILE A records

AAAAAAAAAXYAA12345
BBBBBBBBBXYBB17890
CCCCCCCCCXYCC22222
CCCCCCCCCXYCC22222
DDDDDDDDDXYDD44444
EEEEEEEEEXYEE55555

FILE B

AAAAAAAAAXYAA12346
BBBBBBBBBXYBB17898
CCCCCCCCCXYCC22222
FFFFFFFFFFXYFF33333
DDDDDDDDDXYDD44444

file C output

CCCCCCCCCXYCC22222
CCCCCCCCCXYCC22222
DDDDDDDDDXYDD44444 -> from File A
DDDDDDDDDXYDD44444 -> from file B

file D output

AAAAAAAAAXYAA12345
BBBBBBBBBXYBB17890
EEEEEEEEEXYEE55555

Comparison of file A and B is done on columns 14 to 18

I am having a limitation to use SUBSET, GROUP functions and created the below jcl for this
Code:

//STEP021   EXEC  PGM=ICETOOL                                           
//TOOLMSG   DD  SYSOUT=*                                               
//DFSMSG    DD  SYSOUT=*                                               
//IN1 DD DSN=FILE1,DISP=SHR                                     
//IN2 DD DSN=FILE2,DISP=SHR                                     
//T1  DD DSN=FILE3,                                             
//*                                                                     
//OUT DD DSN=FILE4,                                             
//*
//OUT1 DD DSN=FILE5,                                             
//*-----------------------------------------------------------------   
//TOOLIN DD *                                                           
COPY FROM(IN2) TO(T1) USING(CTL2)                                       
COPY FROM(IN1) TO(T1) USING(CTL1)                                       
SELECT FROM(T1) TO(OUT) ON(14,4,CH) NODUPS USING(CTL3) DISCARD(OUT1)     
//CTL1CNTL DD *                                                         
  INREC OVERLAY=(2001:SEQNUM,8,ZD)                                     
  SORT FIELDS=(2001,8,ZD,D)                                             
  OUTFIL FNAMES=T1,ENDREC=01,BUILD=(1,2000)                             
/*                                                                     
//CTL2CNTL DD *                                                         
  INCLUDE COND=(10,2,CH,EQ,C'XY')                                       
  INREC OVERLAY=(2000:C'1')                                             
/*                                                                     
//CTL3CNTL DD *                                                         
     OUTFIL FNAMES=OUT,INCLUDE=(2000,1,CH,EQ,C'1'),                     
     BUILD=(1,1999,1X)                                                 
/*           

But in CTL2CNTL column 2000 is overlayed, that overtypes if data is already available in column 2000.
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 Nov 30, 2009 11:38 pm    Post subject:
Reply with quote

Your description of what you want is very confusing and your example doesn't help.

Quote:
to extract the last record from file A and compare the extracted record with records from file B, ...


The last record in file A is the 55555 record - there's no match for this in File B, so I don't understand your 1) rule.

In File C, where do the two 22222 records come from (file A or file B or both)? Why do the 44444 records come from fileA and fileB?

You need to show a better example of input and expected output that makes it clear where each output record comes from. You need to do a better job of explaining the "rules" for getting from input to output.
Back to top
View user's profile Send private message
sumitmalik29
Warnings : 1

New User


Joined: 10 Feb 2008
Posts: 19
Location: bhuneswar

PostPosted: Tue Dec 08, 2009 6:10 pm    Post subject:
Reply with quote

Frank, Very Sorry for creating confusion.
Instead of writing file A , I have written file B and vice-versa

Correcting the rule 1
I have to compare the last record from file B i.e. (44444) with the records from file A.

Now the last record (44444) from file B matches with record from file A, these matching records will be placed in file C.
Also the file A has duplicate records within itself i.e. (22222) so they will also be placed in file C.

Now the records left in file A will be unique and will be put to file D

File D records:
12345
17890
55555

Thanks
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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 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

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