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

Split file dynamically using SYNCTOOL


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

New User


Joined: 18 Apr 2007
Posts: 23
Location: Chennai

PostPosted: Thu Apr 23, 2009 5:30 am
Reply with quote

I'm using the below mentioned JOB to split a file into 2 equal files with recs in the same order as the input file.

For instance I have a file with 10 recs
1
2
3
4
5
6
7
8
9
0

I wish to create file 1 with recs 1 through 5 and file 2 with recs 6 through 10

The job is as below:

Code:
//SORT4    EXEC PGM=SYNCTOOL                                 
//TOOLMSG DD SYSOUT=*                                       
//DFSMSG  DD SYSOUT=*                                       
//IN       DD DSN=TOP1.BALASH.FILE,DISP=SHR                 
//C1       DD DSN=&&C1,SPACE=(TRK,(20,5),RLSE),DISP=(,PASS) 
//T1       DD DSN=&&T1,SPACE=(TRK,(20,5),RLSE),DISP=(,PASS,)
//CTL3CNTL DD *                                             
  OUTFIL FNAMES=(OUT1,OUT2),                                 
//         DD DSN=*.C1,VOL=REF=*.C1,DISP=(OLD,PASS)         
/*                                                           
//OUT1     DD DSN=TOP1.BALASH.OUTFILE1,                     
//            SPACE=(TRK,(20,5),RLSE),DISP=(NEW,CATLG,DELETE)
//OUT2     DD DSN=TOP1.BALASH.OUTFILE2,                     
//            SPACE=(TRK,(20,5),RLSE),DISP=(NEW,CATLG,DELETE)
//TOOLIN  DD *                           
  COPY FROM(IN) USING(CTL1)             
  COPY FROM(T1) TO(C1) USING(CTL2)       
  COPY FROM(IN) USING(CTL3)             
/*                                       
//CTL1CNTL DD *                         
  OUTFIL FNAMES=T1,REMOVECC,NODETAIL,   
  TRAILER1=(COUNT=(M11,LENGTH=8))       
/*                                       
//CTL2CNTL DD *                         
  OUTREC BUILD=(2X,C'SPLIT1R=',         
    1,8,ZD,DIV,+02,TO=ZD,LENGTH=11,80:X)
/*                                       
//*                                     

I get an ABEND as the CTL3 output is not numeric
CTL3CNTL :
Code:
  OUTFIL FNAMES=(OUT1,OUT2),                   
  SPLIT1R=0000000000E                           
          *                                   
WER428I  CALLER-PROVIDED IDENTIFIER IS "0003"   
WER271A  OUTFIL STATEMENT  : NUMERIC FIELD ERROR
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000   
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE   


How do i fix this?

Thanks,
Hariharan
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: Thu Apr 23, 2009 5:43 am
Reply with quote

hariharan_82 wrote:
I get an ABEND as the CTL3 output is not numeric
CTL3CNTL :
Code:
  OUTFIL FNAMES=(OUT1,OUT2),                   
  SPLIT1R=0000000000E                           
          *                                   
WER428I  CALLER-PROVIDED IDENTIFIER IS "0003"   
WER271A  OUTFIL STATEMENT  : NUMERIC FIELD ERROR
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000   
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE   
SyncSort for z/OS 1.3 Programmer’s Guide wrote:
The SPLITBY=n parameter writes groups of records in rotation among multiple output data sets and distributes multiple records at a time among the OUTFIL data sets. n specifies the number of records to split by.
Where did "0000000000E" become a "number"?
What "number" did you intend to split by?
Back to top
View user's profile Send private message
hariharan_82

New User


Joined: 18 Apr 2007
Posts: 23
Location: Chennai

PostPosted: Thu Apr 23, 2009 5:46 am
Reply with quote

0000000000E is what is getting written dynamically to the C1 fiel which shoudl actually look like

OUTFIL FNAMES=(OUT1,OUT2),
SPLIT1R=00000000005

which implies that '5' recs should be written to each file in the same order of occurrence as the input file.

Thanks,
Hari
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: Thu Apr 23, 2009 5:53 am
Reply with quote

Go with the best advice posible, similar problem, similar answer:
Frank Yaeger wrote:
TO=ZDF instead of TO=ZD should get you the same thing for Syncsort.
Back to top
View user's profile Send private message
hariharan_82

New User


Joined: 18 Apr 2007
Posts: 23
Location: Chennai

PostPosted: Thu Apr 23, 2009 6:08 am
Reply with quote

That was great. Thanks much.
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 FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top