File Split



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

File Split

Postby Vineet » Sat Jun 22, 2013 2:37 am

Hi All,

I have a a query regarding Splitting a File. I have a sequntial File with Attributes as LRECL = 80, RECFM = FB. I want to create 2 Files. Below is the requirement.

1. Lets Consider Record 1/2.
If the Value at Position (3,1) = 1 Or 2 AND Subsequent Record is Having Value at Position (3,1) = 3, and Value from Position 5,33 (|000000613|000000011|000004088|) is same then the Record Having
Value 1 or 2 to be written to File A.

2. Lets Consider Record 4/5/6 Value at Position = 1 / 2 / 3 & there is no Susequent record then the record to be written to File B.


Record 1
8|1|000000613|000000011|000004088|Crystal Light On the Go Sticks ---> To Be Written To File A
8|3|000000613|000000011|000004088|Crystal Light On the Go Sticks

Record 2
8|2|000000614|000000011|000004089|Crystal Light On the Go Sticks ---> To Be Written To File A
8|3|000000614|000000011|000004089|Crystal Light On the Go Sticks

Record 3
8|1|000000615|000000011|000004090|Crystal Light On the Go Sticks ---> To Be Written To File A
8|3|000000615|000000011|000004090|Crystal Light On the Go Sticks

Record 4
8|1|000000616|000000011|000004091|Crystal Light On the Go Sticks ---> To Be Written To File B
No Subsequent Record, like Record 1/2/3.

Record 5
8|2|000000618|000000011|000004091|Crystal Light On the Go Sticks ---> To Be Written To File B
No Subsequent Record, like Record 1/2/3.

Record 6
8|3|000000619|000000011|000004091|Crystal Light On the Go Sticks ---> To Be Written To File B
No Subsequent Record, like Record 1/2/3.


Thanks
Vineet
 
Posts: 86
Joined: Tue Jun 19, 2007 11:38 am
Has thanked: 0 time
Been thanked: 0 time

Re: File Split

 

Re: File Split

Postby BillyBoyo » Sat Jun 22, 2013 4:42 am

Is another way of putting what you want:

I have a key at 5,9

If I have two records with that key, write to File 1
If I have one record with that key, write to File 2
There are no other possibilities

Otherwise, please amend your sample input and expected output to show any other possibilities.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post