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

Compare two VB Files to get unmatched where Fields > 4080


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Hima1985

New User


Joined: 17 Apr 2009
Posts: 70
Location: India

PostPosted: Wed Apr 22, 2009 5:37 pm
Reply with quote

Hi! This is my First post in this Forum. Here is my requirement:

2 Input Files with each of length - VB/Lrecl : 4504
2 Output Files needed each of length - VB/Lrecl = 4504

1st output file contains: Records present in File1 and missed in File2
2nd output file contains: Records present in File2 and missed in File1

Could someone pls suggest the solution using Sort Utility...

Here one more condition is there is no key field to compare . My requirement is to check byte by byte of the records. All the data in Record1 of File1 should be matching with corresponding record1 of File2.

For Example:

Input File1:

02323ABCDEFG
02323ABCDEFG
0454545BCDEFG
023243334EFG
02323ABCDEFG

Input File2:
02323ABCDEFG
02323ABCDEFG
0454545BCDEFG
03453535334EFG
02323ABCDEFG
00000000123131

Output File1:
023243334EFG

Output File2:
03453535334EFG
00000000123131
Back to top
View user's profile Send private message
Hima1985

New User


Joined: 17 Apr 2009
Posts: 70
Location: India

PostPosted: Wed Apr 22, 2009 7:04 pm
Reply with quote

Hello again... Actually i have tried using the below code for Input File FB/lrecl = 80 and it worked well...

SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,80,A)
JOINKEYS FILE=F2,FIELDS=(1,80,A)
REFORMAT FIELDS=(F1:1,80,F2:1,80),FILL=X'FF'
JOIN UNPAIRED
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(81,1,BI,EQ,X'FF'),OUTREC=(1,80)
OUTFIL FILES=02,INCLUDE=(1,1,BI,EQ,X'FF'),OUTREC=(81,80)
/*

But when Am trying the similar code for Input files VB/Lrecl = 4504, Am getting the numeric filed error at: JOINKEYS FILE=F1,FIELDS=(1,4504,A)

Could someone please suggest me on this ..

Thank You.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Apr 22, 2009 7:06 pm
Reply with quote

Quote:
Could someone please suggest me on this ..
Could you please post all the sysout?
Back to top
View user's profile Send private message
Hima1985

New User


Joined: 17 Apr 2009
Posts: 70
Location: India

PostPosted: Wed Apr 22, 2009 7:15 pm
Reply with quote

Sorry , i do not have access to copy/paste the sysout from my mainframe screen to this forum ... anyways i will provide the sysout
it goes like this:

SYSIN:
Code:
JOINKEYS FILE=F1,FIELDS=(1,4504,A)
*
JOINKEYS FILE=F2,FIELDS=(1,4504,A)
*
REFORMAT FIELDS=(F1:1,4504,F2:1,4504),FILL=X'FF'
JOIN UNPAIRED
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(4505,1,BI,EQ,X'FF'),OUTREC=(1,4504)
OUTFIL FILES=02,INCLUDE=(1,1,BI,EQ,X'FF'),OUTREC=(4505,4504)

WER271A JOINKEYS STATEMENT : NUMERIC FIELD ERROR
WER271A JOINKEYS STATEMENT : NUMERIC FIELD ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Apr 22, 2009 7:26 pm
Reply with quote

CICS Guy wrote:
Quote:
Could someone please suggest me on this ..
Could you please post all the sysout?
All the sysout?

Are those JOINKEYS starting incorrectly in cc1 or correctly in cc2?
Back to top
View user's profile Send private message
Chinnadu

New User


Joined: 05 Mar 2009
Posts: 46
Location: Hyderabad

PostPosted: Wed Apr 22, 2009 7:30 pm
Reply with quote

Hima,

Try with ICETOOL. Change the compare field position before you submit it.

Code:
//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//FILEA DD DSN=FILEA,DISP=SHR (FB/80)
//FILEB DD DSN=FILEB,DISP=SHR (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//FILEC DD DSN=FILEC,DISP=(NEW,CATLG,DELETE)   (FB/80)
//FILED DD DSN=FILED,DISP=(NEW,CATLG,DELETE)   (FB/80)
//TOOLIN DD *
COPY FROM(FILEA) TO(T1) USING(CTL1)
COPY FROM(FILEB) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(FILEC) ON(1,9,ZD) KEEPNODUPS -
  WITH(81,1) USING(CTL3)
SPLICE FROM(T1) TO(FILED) ON(1,9,ZD) KEEPNODUPS -
  WITH(81,1) USING(CTL4)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(81:C'BB')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(81:C'VV')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=FILEC,INCLUDE=(81,2,CH,EQ,C'BB'),
    BUILD=(1,80)
//CTL4CNTL DD *
  OUTFIL FNAMES=FILEC,INCLUDE=(81,2,CH,EQ,C'VV'),
    BUILD=(1,80)
Back to top
View user's profile Send private message
Hima1985

New User


Joined: 17 Apr 2009
Posts: 70
Location: India

PostPosted: Wed Apr 22, 2009 7:36 pm
Reply with quote

Hi Chinnadu ,

Thanks for this solution, but here we wont be using ICETOOL . So Im jus looking for a solution using SORT utility only...

Thank You.
Back to top
View user's profile Send private message
Hima1985

New User


Joined: 17 Apr 2009
Posts: 70
Location: India

PostPosted: Wed Apr 22, 2009 7:46 pm
Reply with quote

Quote:
Are those JOINKEYS starting incorrectly in cc1 or correctly in cc2?


It is starting from 2nd column only ...
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Apr 22, 2009 7:51 pm
Reply with quote

Hima1985 wrote:
Quote:
Are those JOINKEYS starting incorrectly in cc1 or correctly in cc2?


It is starting from 2nd column only ...
Well it didn't look like it......
William Thompson wrote:
CICS Guy wrote:
Quote:
Could someone please suggest me on this ..
Could you please post all the sysout?
All the sysout?
All the sysout?
Back to top
View user's profile Send private message
Hima1985

New User


Joined: 17 Apr 2009
Posts: 70
Location: India

PostPosted: Wed Apr 22, 2009 8:01 pm
Reply with quote

Well, Complete SYSOUT:

Code:

SYSIN:
    JOINKEYS FILE=F1,FIELDS=(1,4504,A)
                               *
    JOINKEYS FILE=F2,FIELDS=(1,4504,A)
                               *
     REFORMAT FIELDS=(F1:1,4504,F2:1,4504),FILL=X'FF'
     JOIN UNPAIRED
     SORT FIELDS=COPY
     OUTFIL FILES=01,INCLUDE=(4505,1,BI,EQ,X'FF'),OUTREC=(1,4504)
     OUTFIL FILES=02,INCLUDE=(1,1,BI,EQ,X'FF'),OUTREC=(4505,4504)
   END

WER271A JOINKEYS STATEMENT : NUMERIC FIELD ERROR
WER271A JOINKEYS STATEMENT : NUMERIC FIELD ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE


This is all the SYSOUT displayed apart from License information of SYNCSORT
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Apr 22, 2009 8:04 pm
Reply with quote

Hima1985 wrote:
This is all the SYSOUT displayed apart from License information of SYNCSORT
Ha Ha.....
That is exactly what I was looking for, please post it.
Back to top
View user's profile Send private message
Hima1985

New User


Joined: 17 Apr 2009
Posts: 70
Location: India

PostPosted: Wed Apr 22, 2009 8:13 pm
Reply with quote

icon_smile.gif

Code:
1 SYNCSORT FOR Z/OS  1.3.2.0R  U.S. PATENTS: 4210961, 5117495 (C) 2007 SYNCSORT INC.  DATE 2009/112  TIME=09.40.32

      Z/OS  1.9.0

SYNCSORT LICENSED FOR CPU SERIAL NUMBER XXXXX, MODEL XXXX   LICENSE /PRODUCT EXPIRATION DATE: 02 OCT 2010


"encrypted"..icon_smile.gif
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Apr 22, 2009 8:15 pm
Reply with quote

SyncSort for z/OS 1.3 Programmer’s Guide wrote:
WER271A statement STATEMENT: NUMERIC FIELD ERROR
EXPLANATION: A numeric field has been improperly specified on the indicated SyncSort control statement.

And wrote:
Each JOINKEYS field may be anywhere within the record through column 32750, the maximum length of a field is 4080 bytes, and the sum of all fields on a JOINKEYS statement cannot exceed 4080 bytes.
Back to top
View user's profile Send private message
Hima1985

New User


Joined: 17 Apr 2009
Posts: 70
Location: India

PostPosted: Wed Apr 22, 2009 8:25 pm
Reply with quote

Then how could I compare the whole record (byte by byte) in two files in this case as my file length itself is exceeding 4080 length ... Do i have to choose some key to compare or any other solution ?? Please suggest ...
Back to top
View user's profile Send private message
subinraj

New User


Joined: 04 Sep 2007
Posts: 16
Location: Bangalore

PostPosted: Wed Apr 22, 2009 9:32 pm
Reply with quote

Since you are using VB input file the first 4 bytes should be used for the RDW (Record Descriptor word). So the compare fields should start from 5th byte. Try using following sort card. Here i have used input files with VB/LRECL=80

Code:
JOINKEYS FILE=F1,FIELDS=(5,76,A)                         
JOINKEYS FILE=F2,FIELDS=(5,76,A)                         
REFORMAT FIELDS=(F1:1,80,F2:1,80),FILL=X'FF'             
JOIN UNPAIRED,ONLY                                       
SORT FIELDS=COPY                                         
OUTFIL FILES=01,INCLUDE=(85,1,BI,EQ,X'FF'),OUTREC=(5,76)
OUTFIL FILES=02,INCLUDE=(5,1,BI,EQ,X'FF'),OUTREC=(85,76)
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: Wed Apr 22, 2009 10:01 pm
Reply with quote

Hello,

How does this accomplish comparing 4500+ bytes when the limit is 4080?
Back to top
View user's profile Send private message
Hima1985

New User


Joined: 17 Apr 2009
Posts: 70
Location: India

PostPosted: Thu Apr 23, 2009 8:33 am
Reply with quote

Hi Subinraj,

Quote:
Here i have used input files with VB/LRECL=80


But my input file length itself is exceeding 4080 length.. though this code may work for VB/LRECL=80 , it would not be working for VB/LRECL=4504 ..
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top