Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Split records in a dataset to multiple dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Vidusha

New User


Joined: 01 Feb 2006
Posts: 20
Location: Chennai

PostPosted: Wed Feb 08, 2006 4:41 pm    Post subject: Split records in a dataset to multiple dataset
Reply with quote

How to split records in a dataset to multiple dataset.

Say there is a input dataset with 50,000 records. I want to copy them to 5 dataset 10,000 each. (based on the count)

Could any one provide solution for this.

Thanks in advance
Vidhya
Back to top
View user's profile Send private message

Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 464

PostPosted: Wed Feb 08, 2006 4:51 pm    Post subject: Re: Split records in a dataset to multiple dataset
Reply with quote

Hi Vidhya

This topic already discussed in forum so may times. Please make search you will get lot of material...

Regards
Rupesh
Back to top
View user's profile Send private message
rajesh_1183

Active User


Joined: 24 Nov 2005
Posts: 121
Location: Tadepalligudem

PostPosted: Wed Feb 08, 2006 5:18 pm    Post subject:
Reply with quote

Hi vidhya,

try this...

//step exec pgm=sort
//sortin dd dsn=input file
//sortof1 dd dsn=file1
//sortof2 dd dsn=file2
//sortof3 dd dsn=file3
//sortof4 dd dsn=file4
//sortof5 dd dsn=file5
//sysin dd *
option copy
outfil fnames=(1,2,3,4,5),splitby=10000
/*

This might work...
corrections welcomed...

Thanks,
Rajesh
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: Wed Feb 08, 2006 9:19 pm    Post subject:
Reply with quote

Quote:
outfil fnames=(1,2,3,4,5),splitby=10000


Actually, that should be FILES= not FNAMES=.

Quote:
Say there is a input dataset with 50,000 records. I want to copy them to 5 dataset 10,000 each. (based on the count)


Here are two ways to do this with DFSORT:

Code:

//S1 EXEC PGM=SORT
//SORTIN DD DSN=...  input file
//OUT1 DD DSN=...    output file1
//OUT2 DD DSN=...    output file2
//OUT3 DD DSN=...    output file3
//OUT4 DD DSN=...    output file4
//OUT5 DD DSN=...    output file5
//SYSIN DD *
  OPTION COPY
  OUTFIL FNAMES=(OUT1,OUT2,OUT3,OUT4,OUT5),SPLITBY=10000
/*


Code:

//S2 EXEC PGM=SORT
//SORTIN DD DSN=...  input file
//OUT1 DD DSN=...    output file1
//OUT2 DD DSN=...    output file2
//OUT3 DD DSN=...    output file3
//OUT4 DD DSN=...    output file4
//OUT5 DD DSN=...    output file5
//SYSIN DD *
  OPTION COPY
  OUTFIL FNAMES=OUT1,ENDREC=10000
  OUTFIL FNAMES=OUT2,STARTREC=10001,ENDREC=20000
  OUTFIL FNAMES=OUT3,STARTREC=20001,ENDREC=30000
  OUTFIL FNAMES=OUT4,STARTREC=30001,ENDREC=40000
  OUTFIL FNAMES=OUT5,SAVE
/*
Back to top
View user's profile Send private message
rajesh_1183

Active User


Joined: 24 Nov 2005
Posts: 121
Location: Tadepalligudem

PostPosted: Thu Feb 09, 2006 9:42 am    Post subject:
Reply with quote

Hi frank..

Is that FNAMES= or FILES= ...????

becoz u have also written FNAMES=...

clarify it plz..

Thanks,
Rajesh
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: Thu Feb 09, 2006 10:00 pm    Post subject:
Reply with quote

Rajesh,

You can use FNAMES or FILES, but you have to use them properly to connect up with the OUTFIL ddnames.

I prefer FNAMES because it can be used with any ddnames, e.g.

Code:

//OUT1 DD DSN=...
//OUT2 DD DSN=...
...
   FNAMES=(OUT1,OUT2)


If you use FILES, then the ddname must be of the form SORTOFx or SORTOFxx and you only specify x or xx, e.g.

Code:

//SORTOF1 DD DSN=...
//SORTOF2 DD DSN=...
...
   FILES=(1,2)


In your case, you needed FILES=(1,2,3,4,5) but you had FNAMES=(1,2,3,4,5).
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 6 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us