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
 

 

How to split a file into multiple output files.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
rahul.banik

New User


Joined: 23 Jan 2007
Posts: 16
Location: Mysore

PostPosted: Tue Jan 29, 2008 1:49 pm    Post subject: How to split a file into multiple output files.
Reply with quote

Hi All,

My requirement is like that.

Create Jcl to split the input file into 10 files with each file containing 700,000 detail records and the last file containing all the remaining records. There is a header record in the input file and this needs to be copied to all the split files. If there are less number of records in the input file (less than 7 Million), some of the split files will have only the header record.
First record of the input is the header record and it's starting char is 'H'.

I need your help.

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

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Jan 29, 2008 10:04 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for. Be sure to use MOD for the OUTxx data sets.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//***>> USE MOD FOR OUTXX DATA SETS
//OUT01 DD DISP=MOD,DSN=...  output file 1
//OUT02 DD DISP=MOD,DSN=...  output file 2
...
//OUT10 DD DISP=MOD,DSN=...  output file 10
//TOOLIN   DD    *
COPY FROM(IN) USING(CTL1)
COPY FROM(IN) USING(CTL2)
/*
//CTL1CNTL DD *
  OPTION STOPAFT=1
  OUTFIL FNAMES=(OUT01,OUT02,OUT03,OUT04,OUT05,
    OUT06,OUT07,OUT08,OUT09,OUT10)
/*
//CTL2CNTL DD *
  OPTION SKIPREC=1
  OUTFIL FNAMES=(OUT01,OUT02,OUT03,OUT04,OUT05,
    OUT06,OUT07,OUT08,OUT09,OUT10),
    SPLIT1R=700000
/*
Back to top
View user's profile Send private message
rahul.banik

New User


Joined: 23 Jan 2007
Posts: 16
Location: Mysore

PostPosted: Fri Feb 08, 2008 5:39 pm    Post subject:
Reply with quote

Hi Frank,

I'm very sorry for the late response.Actually there was some mainframeID problem.Today I'm able to test your code.But I got return code 16,i.e. CC=0016.

Here is my job.
Code:

//S1    EXEC  PGM=ICETOOL                           
//TOOLMSG   DD  SYSOUT=*                           
//DFSMSG    DD  SYSOUT=*                           
//IN DD DSN=INPUT.TEST.FILE,DISP=SHR     
//OUT01 DD  DSN=OUTPUT.TEST1,         
//          DISP=(MOD,CATLG,DELETE),               
//          UNIT=WORK,SPACE=(TRK,(200,100),RLSE)   
//OUT02 DD  DSN=OUTPUT.TEST2,               
//          DISP=(MOD,CATLG,DELETE),               
//          UNIT=WORK,SPACE=(TRK,(200,100),RLSE)   
//OUT03 DD  DSN=OUTPUT.TEST3,                 
//          DISP=(MOD,CATLG,DELETE),               
//          UNIT=WORK,SPACE=(TRK,(200,100),RLSE)   
//OUT04 DD  DSN=OUTPUT.TEST4,                 
//          DISP=(MOD,CATLG,DELETE),               
//          UNIT=WORK,SPACE=(TRK,(200,100),RLSE)   
//TOOLIN   DD    *                                 
COPY FROM(IN) USING(CTL1)                           
COPY FROM(IN) USING(CTL2)                           
/*                                                 
//CTL1CNTL DD *                                     
  OPTION STOPAFT=1                                 
  OUTFIL FNAMES=(OUT01,OUT02,OUT03,OUT04)           
/*                                                 
//CTL2CNTL DD *                                     
  OPTION SKIPREC=1                                 
  OUTFIL FNAMES=(OUT01,OUT02,OUT03,OUT04),         
    SPLIT1R=30                                     
/*                                                 


Input file contains 100 records.

I got the following TOOLMSG

Code:
SYNCTOOL RELEASE 1.5.2 - COPYRIGHT 2004  SYNCSORT INC.                   
INITIAL PROCESSING MODE IS "STOP"                                       
"TOOLIN" INTERFACE BEING USED                                           
                                                                     
COPY FROM(IN) USING(CTL1)                                               
SYNCSORT CALLED WITH IDENTIFIER "0001"                                   
OPERATION COMPLETED WITH RETURN CODE 0                                   
                                                                     
COPY FROM(IN) USING(CTL2)                                               
SYNCSORT CALLED WITH IDENTIFIER "0002"                                   
SYNCSORT COMPLETED UNSUCCESSFULLY                                       
OPERATION COMPLETED WITH RETURN CODE 16                                 
                                                                     
PROCESSING MODE CHANGED FROM "STOP" TO "SCAN" DUE TO OPERATION FAILURE
                                                                     
SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 16                       


And from the DFSMSG I got this.
Code:
CTL2CNTL :                                       
  OPTION SKIPREC=1                               
  OUTFIL FNAMES=(OUT01,OUT02,OUT03,OUT04),       
    SPLIT1R=30                                   
    *                                           
WER428I  CALLER-PROVIDED IDENTIFIER IS "0002"
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR       


I need your advice.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Feb 08, 2008 7:49 pm    Post subject:
Reply with quote

Hi,

You are geeting WERXXX mesaages, which means You use Synnsort. Why don't You guys state in the start of thread that which SORT product do You use, so that Franks' efforts are not 'wasted'.
Back to top
View user's profile Send private message
rahul.banik

New User


Joined: 23 Jan 2007
Posts: 16
Location: Mysore

PostPosted: Fri Feb 08, 2008 8:02 pm    Post subject:
Reply with quote

Hi Anuj,

Sorry,but what exact information you want?Whatever I've got from TOOLMSG and DFSMSG,I've mentioned.

Below information Only I've missed.

SYNCSORT FOR Z/OS 1.2.2.3RI
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Fri Feb 08, 2008 10:14 pm    Post subject: Reply to: How to split a file into multiple output files.
Reply with quote

Rahul,

Your application will run fine with SyncSort for z/OS 1.3. The upgrade is free and is available for download at www.syncsort.com/support or you can request a tape.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Feb 08, 2008 10:26 pm    Post subject:
Reply with quote

Note that the job I showed runs fine with DFSORT which has had the SPLIT1R function since April, 2006.
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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am


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