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

Compare Two file of Same LRECL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Meena Chandran

New User


Joined: 28 Dec 2007
Posts: 13
Location: Chennai

PostPosted: Tue Sep 22, 2009 12:35 pm
Reply with quote

Hi ,

I want to compare two files with same LRECL (150) & file format is FB . The key filed (Jobname) is at different postiions in the both the files.
Could anyone help me on this?

FILE A:
Code:
109/17/2009 07:05:46 Unicenter CA-View Output Archival and Viewing (11.0)
SARBCT Batch Processing Utility - Sysout Archival Listing
0ID Jobname Jobid Gen Seq Arc Date Time Loc Lines Pages Blocks Xcode Tseq DRseq
-------------------------------- -------- -------- ----- ----- ---------- ----- ---- ---------- --------- --------- ------- ------ ----- -----
0$AGYX#NM Jobname1 JOB27854 4706 1 09/17/2009 06:24 DISK 3456 67 252
$AGYXCOM  Jobname4 JOB27875 4706 1 09/17/2009 06:24 DISK 4567 67 345
$APO1RST  Jobname3 JOB26592 4706 1 09/17/2009 06:54 DISK 5678 98 098
FILE B:
Code:
XXX#XXX#X#X#XXXXJobname1 NOEX002Owner XXX#XXX#X#XXXXX XXX 980404
YYY#YYY#Y#Y#YYYYJobname2 NOEX005Owner YYY#YYY#Y#YYYYY YYY 980718
XXX#XXX#X#X#XXXXJobname3 NOEX006Owner XXX#XXX#X#XXXXX XXX 980404
My O/P should be:
Code:
109/17/2009 07:05:46 Unicenter CA-View Output Archival and Viewing (11.0)
SARBCT Batch Processing Utility - Sysout Archival Listing
0ID Jobname Jobid Gen Seq Arc Date Time Loc Lines Pages Blocks Xcode Tseq DRseq
-------------------------------- -------- -------- ----- ----- ---------- ----- ---- ---------- --------- --------- ------- ------ ----- -----
0$AGYX#NM Jobname1 JOB27854 4706 1 09/17/2009 06:24 DISK 3456 67 252
$APO1RST  Jobname3 JOB26592 4706 1 09/17/2009 06:54 DISK 5678 98 098


Thanks,
Back to top
View user's profile Send private message
Meena Chandran

New User


Joined: 28 Dec 2007
Posts: 13
Location: Chennai

PostPosted: Tue Sep 22, 2009 1:26 pm
Reply with quote

Key field is at in file 1: 17 th column to 8 char
in file 2 : 35th column to 8 char


Thanks
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Sep 22, 2009 1:32 pm
Reply with quote

You really do need to provide all of the information for people to be able to help you.

What are the positions, lengths and formats of the key fields.
It looks as though you only require matched records from both files, but you have not stated this.
Also, it looks at though you only want records from file 1, but again you need to state this.
The lines above the actual data, are these for information only or do the exist in file1, and are they required in the output.
Which level of DFSORT are you using, as this can affect the solution quite dramatically. Please post the whole line with message code ICE201I from an output using DFSORT.
Back to top
View user's profile Send private message
Meena Chandran

New User


Joined: 28 Dec 2007
Posts: 13
Location: Chennai

PostPosted: Tue Sep 22, 2009 2:32 pm
Reply with quote

Hi Pat,

Here are the answers:

Key field:

File A:
Key filed: 35-8
File length (LRECL): 150
File Format: FBA
Contains Duplicate records: Yes

File B:

Key filed: 17-8
File length (LRECL): 150
File Format: FBA
Contains Duplicate records: No

Yes I need only Matching records that exist from File A.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Sep 22, 2009 7:40 pm
Reply with quote

Hello,

And
Quote:
Which level of DFSORT are you using, as this can affect the solution quite dramatically. Please post the whole line with message code ICE201I from an output using DFSORT.
icon_question.gif
Back to top
View user's profile Send private message
Meena Chandran

New User


Joined: 28 Dec 2007
Posts: 13
Location: Chennai

PostPosted: Tue Sep 22, 2009 8:36 pm
Reply with quote

It's

'ICE201I F RECORD TYPE IS F - DATA STARTS IN POSITION 1 '
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Sep 22, 2009 11:34 pm
Reply with quote

meena chandran,

The following DFSORT/ICETOOL JCl will give you the desired results. I assumed that only the first 4 lines in your FILEA which has the duplicates are the header records

Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                                 
//SORTOUT  DD DSN=&&HDR,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE)     
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                             
  OUTFIL REMOVECC,NODETAIL,BUILD=(150X),HEADER1=('HDR')         
/*                                                             
//STEP0200 EXEC PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                         
//DFSMSG   DD SYSOUT=*                                         
//IN       DD DSN=&&HDR,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT     
//         DD DSN=your unique jobname file,DISP=SHR
//         DD DSN=&&HDR,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT     
//         DD DSN=your duplicate jobname file,DISP=SHR
//OUT      DD SYSOUT=*                                         
//TOOLIN   DD *                                                 
  SPLICE FROM(IN) TO(OUT) ON(167,8,CH) WITH(176,1) -           
  WITHALL KEEPNODUPS USING(CTL1)                               
//CTL1CNTL DD *                                                 
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(151:SEQNUM,8,ZD,16X)),       
  IFTHEN=(WHEN=(1,3,CH,EQ,C'HDR'),OVERLAY=(151:SEQNUM,8,ZD)),   
  IFTHEN=(WHEN=(1,3,CH,NE,C'HDR'),OVERLAY=(159:SEQNUM,8,ZD,     
  151:151,8,ZD,SUB,159,8,ZD,M11,LENGTH=8),HIT=NEXT),           
  IFTHEN=(WHEN=(151,8,ZD,EQ,1),OVERLAY=(167:17,8,C'11')),       
  IFTHEN=(WHEN=(151,8,ZD,EQ,2),OVERLAY=(159:SEQNUM,8,ZD,       
           167:35,8,C'22'),HIT=NEXT),                           
  IFTHEN=(WHEN=(151,8,ZD,EQ,2,AND,159,8,ZD,LE,4),               
  OVERLAY=(167:7X,SEQNUM,1,ZD))                                 
  OUTFIL FNAMES=OUT,BUILD=(1,150),                             
  INCLUDE=(175,2,ZD,EQ,12,OR,(151,8,ZD,EQ,2,AND,159,8,ZD,LE,4)) 
//*
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 WER247A SORTOUT HAS INCOMPATIBLE LRECL SYNCSORT 7
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top