Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Split file dynamically using SYNCTOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Split file dynamically using SYNCTOOL
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: 2150
Location: At my coffee table

PostPosted: Thu Apr 23, 2009 5:43 am    Post subject: Re: Split file dynamically using ICETOOL
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Thu Apr 23, 2009 5:53 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us