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 

Records being dropped when using SYNCTOOL

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


Joined: 27 Jan 2003
Posts: 41
Topics: 16

PostPosted: Wed Nov 05, 2003 9:31 am    Post subject: Records being dropped when using SYNCTOOL Reply with quote

I have a job which does the following

1. Writes out only the header record of FILE-A, to TEMP1
2. Skips the header rec of FILE-B , and writes out the detail recs to a file TEMP2.
3. Merges these 2 files, to create TEMP3, which is later used for downstream processing.

This is the JCL I had written using SYNCTOOL.

Code:

//STEP01  EXEC PGM=SYNCTOOL                                 
//DFSMSG   DD SYSOUT=*                                       
//TOOLMSG  DD SYSOUT=*                                       
//SYSUDUMP DD SYSOUT=*                                       
//IN1      DD DSN=MY.INPUT.FILE-A.,DISP=SHR               
//IN2      DD DSN=MY.INPUT.FILE-B,DISP=SHR               
//TEMP1    DD DSN=&&T1,DISP=(,PASS)                         
//TEMP2    DD DSN=&&T2,DISP=(,PASS)                         
//TEMP3    DD DSN=&&T1,DISP=(,PASS)
//              DD DSN=&&T2,DISP=(,PASS)                         
//OUT       DD DSN=&&T3,DISP=(,PASS)
//TOOLIN   DD *                                             
 SORT FROM(IN1) USING(CTL1)                                 
 SORT FROM(IN2) USING(CTL2)                                 
 SORT FROM(TEMP3) TO(OUT) USING(CTL3)
/*                                                           
//CTL1CNTL DD *                                             
 SORT FIELDS=COPY,STOPAFT=1                                 
 OUTFIL FNAMES=TEMP1                                         
//CTL2CNTL DD *                                             
 SORT FIELDS=COPY,SKIPREC=1                                 
 OUTFIL FNAMES=TEMP2                                         
//CTL1CNTL DD *                                             
 SORT FIELDS=COPY
 OUTFIL FNAMES=TEMP3
/*                                         


Now when I run this, the number of recs copied to TEMP3 varies with each run, (even though FILE-A and FILE-B are always the same).
The total recs that were supposed to be written into TEMP3 were around 12 million, however when I ran this job for the first time wrote 7.8 million records to TEMP3 and the second time it wrote out 4.7 million.
I have managed to fix this problem with a work around logic . But I havent been able to account for this strange behavior.
It would be great if someone could explain to me, why this occurs and whether I am unaware of any restrictions while using SYNCTOOL.

Thanks
Puru
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Nov 05, 2003 10:06 am    Post subject: Reply with quote

Puru,

I see a couple of errors in your Job.

1. There is no CTL3CNTL ddname at all.You have CTL1CNTL twice.
2. The disp parameters are wrong for the concated files.
3. You don't need a SORT verb for any of the copy operations

The following JCL will give you the desired results.

Code:

//STEP0100 EXEC PGM=SYNCTOOL                                 
//TOOLMSG  DD SYSOUT=*                                       
//DFSMSG   DD SYSOUT=*                                       
//IN1      DD DSN=MY.INPUT.FILE-A,
//            DISP=SHR               
//IN2      DD DSN=MY.INPUT.FILE-B,
//            DISP=SHR               
//T1       DD DSN=&T1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)                         
//T2       DD DSN=&T2,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE)                         
//CON      DD DSN=&T1,DISP=OLD,VOL=REF=*.T1
//         DD DSN=&T2,DISP=OLD,VOL=REF=*.T2
//OUT      DD DSN=THE OUTPUT FILE,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//TOOLIN   DD *                           
  COPY FROM(IN1) TO(T1) USING(CTL1)                                 
  COPY FROM(IN2) TO(T2) USING(CTL2)                                 
  COPY FROM(CON) TO(OUT)
//CTL1CNTL DD  *     
    OPTION STOPAFT=1   
//CTL2CNTL  DD *     
    OPTION SKIPREC=1   
//*                   


Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
patnekar
Beginner


Joined: 27 Jan 2003
Posts: 41
Topics: 16

PostPosted: Wed Nov 05, 2003 10:37 am    Post subject: Reply with quote

Kolusu,
Thanks will try your JCL and get back to you. As for the CTL3 missing, I did have that in my JCL, when editing it for this post, I had missed it. I also had the DISP=SHR for the concatenated files, along with the VOL=REF=*.TEMP. Thus my JCL looked similar to the one which you have posted. I apologise for the errors.

Thanks

Puru
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Nov 05, 2003 10:58 am    Post subject: Reply with quote

Puru,

On second thougts you can totally eliminate the 3rd copy step.Code disp=MOD for the output file.

The following JCL will give you the desired results.I coded a delete step before the sort to avoid appending of data for every run.

Code:

//STEP0100  EXEC  PGM=IEFBR14                       
//FILE01   DD  DSN=YOUR OUTPUT FILE,
//             DISP=(MOD,DELETE,DELETE),
//             SPACE=(CYL,(1,1),RLSE)             
//*                                                 
//STEP0200 EXEC PGM=SYNCTOOL
//TOOLMSG   DD SYSOUT=*   
//DFSMSG    DD SYSOUT=*   
//IN1       DD DSN=YOUR,INPUT.FILE-A,
//             DISP=SHR
//IN2       DD DSN=YOUR,INPUT.FILE-B,
//             DISP=SHR
//OUT       DD DSN=YOUR OUTPUT FILE,       
//             DISP=(MOD,CATLG,DELETE),
//             UNIT=SYSDA,             
//             SPACE=(CYL,(X,Y),RLSE) 
//TOOLIN   DD *                           
  COPY FROM(IN1) TO(OUT) USING(CTL1)
  COPY FROM(IN2) TO(OUT) USING(CTL2)
//CTL1CNTL    DD *           
  OPTION STOPAFT=1     
//CTL2CNTL    DD *         
  OPTION SKIPREC=1   
//*


Hope this helps...

cheers

kolusu

PS: You don't apologize for the errors. You will learn when you make mistakes.


Last edited by kolusu on Sat Apr 17, 2004 8:21 am; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ravikumar_sri2001
Beginner


Joined: 06 Dec 2002
Posts: 117
Topics: 44
Location: Chennai,India

PostPosted: Mon Jan 05, 2004 6:30 am    Post subject: Reply with quote

Kolusu,

It seems you missed "TOOLIN" in second job step.

Thanks,
Ravikumar.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Jan 05, 2004 9:53 am    Post subject: Reply with quote

Ravikumar,

Sure I did miss the TOOLIN statements.I am editing the post to reflect the change.Thanks for pointing out the mistake.

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