IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

split i/p to o/p based on the input


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
anishkannath

New User


Joined: 23 Oct 2007
Posts: 5
Location: Hyderabad

PostPosted: Tue Mar 30, 2010 1:19 am
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Mar 30, 2010 2:14 am
Reply with quote

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
View user's profile Send private message
anishkannath

New User


Joined: 23 Oct 2007
Posts: 5
Location: Hyderabad

PostPosted: Tue Mar 30, 2010 2:31 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Mar 30, 2010 3:06 am
Reply with quote

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
View user's profile Send private message
anishkannath

New User


Joined: 23 Oct 2007
Posts: 5
Location: Hyderabad

PostPosted: Tue Mar 30, 2010 3:14 am
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Mar 30, 2010 3:31 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Mar 30, 2010 5:19 am
Reply with quote

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
View user's profile Send private message
senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Tue Mar 30, 2010 12:14 pm
Reply with quote

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
icon_eek.gif
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Mar 30, 2010 2:41 pm
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Mar 30, 2010 10:01 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts force tablespace using LISTDEF input DB2 1
No new posts Two input files & writing counter... DFSORT/ICETOOL 12
Search our Forums:

Back to Top