View previous topic :: View next topic
|
Author |
Message |
anishkannath
New User
Joined: 23 Oct 2007 Posts: 5 Location: Hyderabad
|
|
|
|
Hi,
I have a requirement to split the records into various o/p files based on the input value. We dont know how many o/p files will be required as this purely depends on a indicator in input record
Sample:- ( here splitting records based on 4 th byte. So here there will be 3 o/p files) Some cases we may have 5 or even 10 o/p files depneding on input.
SORTIN
AAA1
AAA1
AAA2
AAA3
O/P
File - 1
AAA1
AAA1
File - 2
AAA2
File - 3
AAA3
Can we allocate these o/p files based on the input value ?
Thanks,
Anish kannath |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
anishkannath,
If the indicator is just 1 byte numeric then you can only have a max of 10 different value (0 thru 9). Allocate 10 files and delete all the empty files.
Did you look at the smart dfsort tricks
# Split a file to n output files dynamically
# Five ways to split a data set
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000094 |
|
Back to top |
|
|
anishkannath
New User
Joined: 23 Oct 2007 Posts: 5 Location: Hyderabad
|
|
|
|
Hi,
My indicator is actually 8 bytes.. I have just indicates as one byte in the example. So we can have more number of records.
Thanks,
Anish Kannath |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
are you saying there could be 100 million different values ?
Good luck and I hope the 8 bytes is not a PD field.
Gerry |
|
Back to top |
|
|
anishkannath
New User
Joined: 23 Oct 2007 Posts: 5 Location: Hyderabad
|
|
|
|
I never said we can have that many records , only thing is that i am not sure abt how many o/p files needs to be created as this depends on the input. BTB that field is an alpha numeric one.
I saw an example using internal reader and am trying to use that. Just want to know if there is any other way rather than submitting a JCL thru internal reader. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
anishkannath wrote: |
BTB that field is an alpha numeric one.
|
An 8 byte alpha numeric can have 40,320 combinations of names. Remember that the maximum number of DD statements per job step is 3273, based on the number of single DD statements allowed for a TIOT (task input output table) control block size of 64K. This limit can be different depending on the installation-defined TIOT size.The IBM-supplied default TIOT size is 32K.
anishkannath wrote: |
I saw an example using internal reader and am trying to use that. Just want to know if there is any other way rather than submitting a JCL thru internal reader. |
AFAIK there is no other way other than calling SVC99 via program to write your output.
Good Luck |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Kolusu,
Quote: |
An 8 byte alpha numeric can have 40,320 combinations of names. |
Can you please explain on how you arrived at this number.
Gerry |
|
Back to top |
|
|
senjay
Active User
Joined: 10 May 2007 Posts: 147 Location: India
|
|
|
|
With all respect to Skolusu and though my answer is not directly related to OP, here is the answer for Gcicchet's question.
Since the OP can choose from 26 alphabets (A-Z) and 10 numerals (0-9), taking the number of digits as X (which is here 26 + 10 = 36), and the number of bytes the OP has to form is Y (which is here 8), the maximum possible number of different values for the 8 byte field, with repeated characters allowed, is X^Y = 36^8 = 2821109907456
|
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Senthil,
that was how I arrived at 100 million, mine was based on numeric only
Quote: |
If the indicator is just 1 byte numeric |
Gerry |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
gcicchet wrote: |
Hi Kolusu,
Quote: |
An 8 byte alpha numeric can have 40,320 combinations of names. |
Can you please explain on how you arrived at this number.
Gerry |
oops my bad , I just considered 8 factorial which came up to that number. As senjay explained the permutations and combinations number is much bigger. |
|
Back to top |
|
|
|