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

Comparex utility - COPYSPLIT option


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

New User


Joined: 01 Sep 2008
Posts: 32
Location: chennaii

PostPosted: Mon Sep 01, 2008 10:53 am
Reply with quote

Can anyone help me with how to use Comparex utility with copysplit option ?


I want to compare 2 files of diff format but with same key in diff positions. I need 3 output dataset, one with common records & the other 2 with the different records ( present in file 1 & not in file 2 and vice versa).

i found COPYSPLIT option in COMPAREX online help tutorial, in which more output files like output datasets (SYSUT3A-SYSUT3E) are possible.

Couldnt find further info.. Can anyone help me ?
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Sep 01, 2008 11:22 am
Reply with quote

kothai,

You can achieve this using syncsort/dfsort. Do you have any of these products installed in your shop?

Thanks,
Arun
Back to top
View user's profile Send private message
kothai

New User


Joined: 01 Sep 2008
Posts: 32
Location: chennaii

PostPosted: Mon Sep 01, 2008 11:24 am
Reply with quote

Hi,

yes, I have them installed.
Syncsort uses 2 -3 steps to acheive this isnt?
Is it possible in a single step ?
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Sep 01, 2008 11:28 am
Reply with quote

Quote:
Is it possible in a single step ?

I think it's possible.
Can you post here the LRECL/RECFM of the input/output files, position of the key field and some sample records.

Thanks,
Arun
Back to top
View user's profile Send private message
kothai

New User


Joined: 01 Sep 2008
Posts: 32
Location: chennaii

PostPosted: Mon Sep 01, 2008 11:35 am
Reply with quote

Hi Arun,

Thanks first of all for replying.

File 1 - FB - LrecL = 10 key (1,7)
File 2 - FB - LecL = 216 Key (207,7)

I need output datasets as

file 3 lecL = 216 Common records
File 4 lecl = 216 ( present in file 2 not in file 1)
File 5 LecL = 10 ( present in file 1 not in file 2)


Thanks ,
kothai. E
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Sep 01, 2008 12:04 pm
Reply with quote

Kothai,

If your shop has SYNCSORT FOR Z/OS 1.2 or above, you can try the below JCL.

Code:
//STEP1    EXEC PGM=SORT                                               
//SORTOUT  DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//SORTJNF1 DD DSN=file-1 --------> FB,LRECL=10                         
//SORTJNF2 DD DSN=file-2 --------> FB,LRECL=216                       
//NOMATCH1 DD DSN=file-3 --------> FB,LRECL=10 (Non matching in file-1)
//NOMATCH2 DD DSN=file-4 --------> FB,LRECL=216(Non matching in file-2)
//MATCH    DD DSN=file-5 --------> FB,LRECL=216(Matching records)     
//SYSIN    DD *                                                       
  JOINKEYS FILE=F1,FIELDS=(1,7,A)                                     
  JOINKEYS FILE=F2,FIELDS=(207,7,A)                                   
  JOIN UNPAIRED                                                       
  REFORMAT FIELDS=(F1:1,10,F2:1,216),FILL=X'FF'                       
  SORT FIELDS=COPY                                                     
  OUTFIL FNAMES=NOMATCH1,INCLUDE=(11,1,BI,EQ,X'FF'),                   
         BUILD=(1,10)                                                 
  OUTFIL FNAMES=NOMATCH2,INCLUDE=(1,1,BI,EQ,X'FF'),                   
         BUILD=(11,216)                                               
  OUTFIL FNAMES=MATCH,SAVE,                                           
         BUILD=(11,216)       


If this does n't satisfy your requirement, you need to provide more inputs.

Thanks,
Arun
Back to top
View user's profile Send private message
kothai

New User


Joined: 01 Sep 2008
Posts: 32
Location: chennaii

PostPosted: Mon Sep 01, 2008 12:08 pm
Reply with quote

Thanks for the response. I will try & let u know Arun
Back to top
View user's profile Send private message
kothai

New User


Joined: 01 Sep 2008
Posts: 32
Location: chennaii

PostPosted: Mon Sep 01, 2008 1:28 pm
Reply with quote

Hi arun . I am getting


JOINKEYS FILE=F1,FIELDS=(1,7,A)
$
STATEMENT DEFINER ERROR
JOINKEYS FILE=F2,FIELDS=(207,7,A)
$
STATEMENT DEFINER ERROR
JOIN UNPAIRED
$
STATEMENT DEFINER ERROR


I couldnt proceed further as I am not able to follow the code.

Help if u find time
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Sep 01, 2008 2:00 pm
Reply with quote

kothai,

Can you post here the relevant error messages from your SYSOUT.

Thanks,
Arun
Back to top
View user's profile Send private message
kothai

New User


Joined: 01 Sep 2008
Posts: 32
Location: chennaii

PostPosted: Mon Sep 01, 2008 2:19 pm
Reply with quote

STATEMENT DEFINER ERROR
REFORMAT FIELDS=(F1:1,10,F2:1,216),FILL=X'FF'
$
STATEMENT DEFINER ERROR
SORT FIELDS=COPY
OUTFIL FNAMES=NOMATCH1,INCLUDE=(11,1,BI,EQ,X'FF'),
BUILD=(1,10)
SORTIN NOT DEFINED
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Sep 01, 2008 2:40 pm
Reply with quote

Quote:
SORTIN NOT DEFINED

kothai,

As the message indicates, does your jcl have a SORTIN dd statement?
SYNCSORT messages start with WER. Do you have any such messages?

Post your entire sysout messages as well as the JCL you used using the "Code" tag given. After typing your message, use "Preview" to make sure everything's fine and then do a "Submit".

Thanks,
Arun
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 SCOPE PENDING option -check data DB2 2
No new posts REASON 00D70014 in load utility DB2 6
No new posts OUTFIL with SAVE option DFSORT/ICETOOL 7
No new posts CICS vs LE: STORAGE option CICS 0
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
Search our Forums:

Back to Top