MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Please help me to compare 2 files.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
ldushkin
Beginner


Joined: 05 Apr 2006
Posts: 56
Topics: 20

PostPosted: Wed Apr 26, 2006 7:24 am    Post subject: Please help me to compare 2 files. Reply with quote

I have two input files with different layout and I need to compare fields from different position
Code:

File1
D2HG.WITHOUT.DUP.RECORDS.NTFY.R1000.TEST    length : 22
----+----1----+----2---
***********************
{0077215012{0077215013                       

File2
D2HG.WITHOUT.DUP.RECORDS.PROF.R1000         length : 11
----+----1----+----2--
**********************
{0000000116     

I have to compare field from file1 started from position 12 11 byte, with field from file2 started
from position 1 11 byte. I got error, please take a look my JCL. I appreciate all your help.     

* ADD '22' IDENTIFIER FOR FILE2 RECORDS.                             
COPY FROM(IN2) TO(T1) USING(CTL2)                                     
SYT020I  SYNCSORT CALLED WITH IDENTIFIER "0002"                               
SYT030I  OPERATION COMPLETED WITH RETURN CODE 0                               
                                                                               
* SPLICE TO MATCH UP RECORDS AND WRITE THEM TO THEIR                 
* APPROPRIATE OUTPUT FILES.                                           
SPLICE FROM(T1) TO(OUT12) ON(1,22,CH) WITH(26,1) -                   
USING(CTL3) KEEPNODUPS                                               
SYT020I  SYNCSORT CALLED WITH IDENTIFIER "0003"                               
SYT012E  SYNCSORT COMPLETED UNSUCCESSFULLY                                     
SYT030I  OPERATION COMPLETED WITH RETURN CODE 16                               
                                                                               
SYT015I  PROCESSING MODE CHANGED FROM "STOP" TO "SCAN" DUE TO OPERATION FAILURE
                                                                               
SYT004I  SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 16                     


JCL

//S1 EXEC PGM=ICETOOL                                         
//TOOLMSG DD SYSOUT=*                                         
//DFSMSG DD SYSOUT=*                                         
//IN1 DD DISP=SHR,DSN=D2HG.WITHOUT.DUP.RECORDS.NTFY.R1000.TEST
//IN2 DD DISP=SHR,DSN=D2HG.WITHOUT.DUP.RECORDS.PROF.R1000     
//***OUT12 DD SYSOUT=*  NAMES IN FILE1 AND FILE2             
//OUT12 DD DSN=D2HG.MATCH1,                                   
//         DISP=(NEW,CATLG,DELETE),                           
//         SPACE=(CYL,(200,20),RLSE),                         
//         DCB=(BLKSIZE=0,LRECL=22,RECFM=FB,DSORG=PS)         
//****OUT1 DD SYSOUT=*   NAMES IN FILE1 ONLY                 
//OUT1 DD  DSN=D2HG.NTFY1,                                   
//         DISP=(NEW,CATLG,DELETE),                           
//         SPACE=(CYL,(200,20),RLSE),                         
//         DCB=(BLKSIZE=0,LRECL=22,RECFM=FB,DSORG=PS)         
//***OUT2 DD SYSOUT=*   NAMES IN FILE2 ONLY                   
//OUT2 DD  DSN=D2HG.PROF1,                                   
//         DISP=(NEW,CATLG,DELETE),                           
//         SPACE=(CYL,(1200,20),RLSE),                       
//         DCB=(BLKSIZE=0,LRECL=22,RECFM=FB,DSORG=PS) 
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(200,10),RLSE),
//** USE MOD FOR T1                                   
//  DISP=(MOD,PASS)                                   
//TOOLIN DD *                                         
* ADD '11' IDENTIFIER FOR FILE1 RECORDS.               
COPY FROM(IN1) TO(T1) USING(CTL1)                     
* ADD '22' IDENTIFIER FOR FILE2 RECORDS.               
COPY FROM(IN2) TO(T1) USING(CTL2)                     
* SPLICE TO MATCH UP RECORDS AND WRITE THEM TO THEIR   
* APPROPRIATE OUTPUT FILES.                           
SPLICE FROM(T1) TO(OUT12) ON(1,22,CH) WITH(26,1) -     
USING(CTL3) KEEPNODUPS                                 
/*                                                     
//CTL1CNTL DD *                                       
* MARK FILE1 RECORDS WITH '11'                         
  OUTREC FIELDS=(12,11,22:C'11')                       
/*                                                     
//CTL2CNTL DD *                                               
* MARK FILE2 RECORDS WITH '22'                               
  OUTREC FIELDS=(1,11,12:C'22')                               
/*                                                           
//CTL3CNTL DD *                                               
* WRITE MATCHING RECORDS TO OUT12 FILE. REMOVE ID.           
  OUTFIL FNAMES=OUT12,INCLUDE=(12,2,CH,EQ,C'12'),OUTREC=(1,11)
* WRITE FILE1 ONLY RECORDS TO OUT1 FILE. REMOVE ID.           
  OUTFIL FNAMES=OUT1,INCLUDE=(22,2,CH,EQ,C'11'),OUTREC=(1,11)
* WRITE FILE2 ONLY RECORDS TO OUT2 FILE. REMOVE ID.           
  OUTFIL FNAMES=OUT2,INCLUDE=(12,2,CH,EQ,C'22'),OUTREC=(1,11)
/*
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Apr 26, 2006 8:45 am    Post subject: Reply with quote

ldushkin,

The SYT messages indicate that you are using SYNCSORT. Post your DFSMSG's here so that we can take a look at them.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ldushkin
Beginner


Joined: 05 Apr 2006
Posts: 56
Topics: 20

PostPosted: Wed Apr 26, 2006 8:55 am    Post subject: Reply with quote

Here DFSMSG messages

Thank you very much

SYNCSORT FOR Z/OS 1.1DRI TPF3A U.S. PATENTS: 4210961, 5117495 (C) 2002 SYNC
z/OS 1.5.0
PRODUCT LICENSED FOR CPU SERIAL NUMBER 20F9E, MODEL 2084 304 LICEN
CTL1CNTL :
OUTREC FIELDS=(12,11,22:C'11') 0024000
PARMLIST :
OPTION RESINV=0,ARESINV=0,MSGDDN=DFSMSG,SORTIN=IN1,SORTOUT=T1,SORTDD=CTL1,COPY
WER428I CALLER-PROVIDED IDENTIFIER IS "0001"
WER108I IN1 : RECFM=FB ; LRECL= 22; BLKSIZE= 27984
WER237I OUTREC RECORD LENGTH = 23
WER110I T1 : RECFM=FB ; LRECL= 23; BLKSIZE= 27991
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER054I RCD IN 1000, OUT 1000
WER169I RELEASE 1.1D BATCH 0414 TPF LEVEL 3A
WER052I END SYNCSORT - D2HGMERG,S1,,DIAG=A200,600C,8A8A,E0C6,EA76,4CA2,8AC8,EE
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Apr 26, 2006 9:35 am    Post subject: Reply with quote

ldushkin,

Please post the ENTIRE DFSMSG messages.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ldushkin
Beginner


Joined: 05 Apr 2006
Posts: 56
Topics: 20

PostPosted: Wed Apr 26, 2006 10:27 am    Post subject: Reply with quote

sorry, I got you

******************************** Top of Data ***********************************
SYNCSORT FOR Z/OS 1.1DRI TPF3A U.S. PATENTS: 4210961, 5117495 (C) 2002 SYNC
z/OS 1.5.0
PRODUCT LICENSED FOR CPU SERIAL NUMBER 20F9E, MODEL 2084 304 LICEN
CTL1CNTL :
OUTREC FIELDS=(12,11,22:C'11') 0024000
PARMLIST :
OPTION RESINV=0,ARESINV=0,MSGDDN=DFSMSG,SORTIN=IN1,SORTOUT=T1,SORTDD=CTL1,COPY
WER428I CALLER-PROVIDED IDENTIFIER IS "0001"
WER108I IN1 : RECFM=FB ; LRECL= 22; BLKSIZE= 27984
WER237I OUTREC RECORD LENGTH = 23
WER110I T1 : RECFM=FB ; LRECL= 23; BLKSIZE= 27991
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER054I RCD IN 1000, OUT 1000
WER169I RELEASE 1.1D BATCH 0414 TPF LEVEL 3A
WER052I END SYNCSORT - D2HGMERG,S1,,DIAG=A200,600C,8A8A,E0C6,EA76,4CA2,8AC8,EE

SYNCSORT FOR Z/OS 1.1DRI TPF3A U.S. PATENTS: 4210961, 5117495 (C) 2002 SYNC
z/OS 1.5.0
PRODUCT LICENSED FOR CPU SERIAL NUMBER 20F9E, MODEL 2084 304 LICEN
CTL2CNTL :
OUTREC FIELDS=(1,11,12:C'22') 0028000
PARMLIST :
OPTION RESINV=0,ARESINV=0,MSGDDN=DFSMSG,SORTIN=IN2,SORTOUT=T1,SORTDD=CTL2,COPY
WER428I CALLER-PROVIDED IDENTIFIER IS "0002"
WER108I IN2 : RECFM=FB ; LRECL= 11; BLKSIZE= 27995
WER237I OUTREC RECORD LENGTH = 13
WER110I T1 : RECFM=FB ; LRECL= 23; BLKSIZE= 27991
WER462I OUTPUT LRECL DIFFERS FROM SORTOUT LRECL
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER054I RCD IN 1001, OUT 1001
WER169I RELEASE 1.1D BATCH 0414 TPF LEVEL 3A
WER052I END SYNCSORT - D2HGMERG,S1,,DIAG=EA00,E80E,C28A,E04E,A276,4C82,02C8,CC


OUTFIL FNAMES=OUT12,INCLUDE=(12,2,CH,EQ,C'12'),OUTREC=(1,11) 0032
* WRITE FILE1 ONLY RECORDS TO OUT1 FILE. REMOVE ID. 0033
OUTFIL FNAMES=OUT1,INCLUDE=(22,2,CH,EQ,C'11'),OUTREC=(1,11) 0034
* WRITE FILE2 ONLY RECORDS TO OUT2 FILE. REMOVE ID. 0035
OUTFIL FNAMES=OUT2,INCLUDE=(12,2,CH,EQ,C'22'),OUTREC=(1,11) 0036
PARMLIST :
OPTION RESINV=0,ARESINV=0,MSGDDN=DFSMSG,SORTIN=T1,SORTDD=CTL3,SORTOUT=OUT12,
LLOC,CMP=CLC,NOVLSHRT,EQUALS
SORT FIELDS=(00001,0022,CH,A)
MODS E35=(SYNCT#35,4096,,N)
WER428I CALLER-PROVIDED IDENTIFIER IS "0003"
WER164B 24,452K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 2,028K BYTES USED
WER146B 20K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I T1 : RECFM=FB ; LRECL= 23; BLKSIZE= 27991
WER110I OUT12 : RECFM=FB ; LRECL= 22; BLKSIZE= 27984
WER110I OUT1 : RECFM=FB ; LRECL= 22; BLKSIZE= 27984
WER110I OUT2 : RECFM=FB ; LRECL= 22; BLKSIZE= 27984
WER247A OUT12 HAS INCOMPATIBLE LRECL
WER247A OUT1 HAS INCOMPATIBLE LRECL
WER247A OUT2 HAS INCOMPATIBLE LRECL
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
******************************* Bottom of Data *
Back to top
View user's profile Send private message
hariavinash
Beginner


Joined: 21 Jan 2005
Posts: 52
Topics: 7

PostPosted: Wed Apr 26, 2006 10:46 am    Post subject: Reply with quote

i ran this job without errors. the only error i had was the TOOLIN statements needed a 1 column push.

cheers
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Apr 26, 2006 10:47 am    Post subject: Reply with quote

Quote:

WER247A OUT12 HAS INCOMPATIBLE LRECL
WER247A OUT1 HAS INCOMPATIBLE LRECL
WER247A OUT2 HAS INCOMPATIBLE LRECL



ldushkin,

The above messages should tell you what went wrong with the job. T1 has an lrecl of 23 and you hardcoded an lrecl of 22 on all the output files.

With sort you never have to code the DCB parameters as they will be automatically calculated by sort. So remove the DCB parm on the OUT files and your job should run ok.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ldushkin
Beginner


Joined: 05 Apr 2006
Posts: 56
Topics: 20

PostPosted: Wed Apr 26, 2006 12:26 pm    Post subject: Reply with quote

Thank you Kolusu,

I just ran my JCL it works fine, but the field {0077215013 has in both file after ran only insert in file D2HG.NTFY1, not insert in file D2HG.MATCH1 and full file D2HG.PROF1.

My output:
D2HG.MATCH1 empty
D2HG.NTFY1 1 record
D2HG.PROF1 1000 records

Please when you have a chance take a look my job
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Apr 26, 2006 1:11 pm    Post subject: Reply with quote

ldushkin,

You are just wasting my time as well as your time. First understand the job and then code the job. If you then get a problem then come back with messages and we can help you.

Here is a job which will give you the desired results.

Code:

//STEP0200 EXEC PGM=ICETOOL                                   
//TOOLMSG  DD SYSOUT=*                                         
//DFSMSG   DD SYSOUT=*                                         
//IN1      DD *                                               
{0077215012{0077215013                                         
//IN2      DD *                                               
{0000000116                                                   
{0077215013                                                   
//T1       DD DSN=&&T1,UNIT=SYSDA,SPACE=(TRK,(5,5)),           
//            DISP=(MOD,PASS)                                 
//OUT12    DD SYSOUT=*                                         
//OUT1     DD SYSOUT=*                                         
//OUT2     DD SYSOUT=*                                         
//TOOLIN DD *                                                 
* ADD '11' IDENTIFIER FOR FILE1 RECORDS.                       
COPY FROM(IN1) TO(T1) USING(CTL1)                             
* ADD '22' IDENTIFIER FOR FILE2 RECORDS.                       
COPY FROM(IN2) TO(T1) USING(CTL2)                             
* SPLICE TO MATCH UP RECORDS AND WRITE THEM TO THEIR           
* APPROPRIATE OUTPUT FILES.                                   
SPLICE FROM(T1) TO(OUT12) ON(12,11,CH) WITH(24,1) -           
USING(CTL3) KEEPNODUPS                                         
/*                                                             
//CTL1CNTL DD *                                               
* MARK FILE1 RECORDS WITH '11'                                 
  OUTREC FIELDS=(01,22,C'11')                                 
/*                                                             
//CTL2CNTL DD *                                               
* MARK FILE2 RECORDS WITH '22'                                 
  OUTREC FIELDS=(11X,01,11,C'22')                             
/*                                                             
//CTL3CNTL DD *                                               
* WRITE MATCHING RECORDS TO OUT12 FILE. REMOVE ID.             
  OUTFIL FNAMES=OUT12,INCLUDE=(23,2,CH,EQ,C'12'),OUTREC=(1,22)
* WRITE FILE1 ONLY RECORDS TO OUT1 FILE. REMOVE ID.           
  OUTFIL FNAMES=OUT1,INCLUDE=(23,2,CH,EQ,C'11'),OUTREC=(1,22) 
* WRITE FILE2 ONLY RECORDS TO OUT2 FILE. REMOVE ID.           
  OUTFIL FNAMES=OUT2,INCLUDE=(23,2,CH,EQ,C'22'),OUTREC=(1,22) 
/*                                                             


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group