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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: split i/p to o/p based on the input
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    Post subject:
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

http://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    Post subject: Reply to: split i/p to o/p based on the input
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: 1703
Location: Australia

PostPosted: Tue Mar 30, 2010 3:06 am    Post subject:
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    Post subject: Reply to: split i/p to o/p based on the input
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    Post subject: Re: Reply to: split i/p to o/p based on the input
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: 1703
Location: Australia

PostPosted: Tue Mar 30, 2010 5:19 am    Post subject:
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    Post subject: Reply to: split i/p to o/p based on the input
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: 1703
Location: Australia

PostPosted: Tue Mar 30, 2010 2:41 pm    Post subject:
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    Post subject:
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    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 Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


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