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 ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts PLI - printing from multiple programs Pedro PL/I & Assembler 8 Fri Sep 08, 2017 6:36 am
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Mainframe dataset split purushottam DFSORT/ICETOOL 13 Tue Aug 29, 2017 12:28 pm

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