Page 1 of 1

not getting desired output using SPLICE

PostPosted: Tue Nov 01, 2011 3:23 pm
by Ashok Raju
Hi,

I wrote a job using ICETOOL's SPLICE.

the logic is
SPLICE FROM(IN) TO(OUT) ON(1,7,CH) WITHALL WITH(12,1)


IN file has following records
pol0000 0001xxxxname1 ####
pol0000 0002yyyygame11
pol0000 0002zzzzgame12
pol0001 0001aaaaname2 ****
pol0001 0002bbbbgame21

Desired OUT file records are
pol0000 0002yyyyname1
pol0000 0002zzzzname1
pol0001 0002bbbbname2

I'm getting the following records in OUT file
pol0000 0002xxxxname1 ####
pol0000 0002xxxxname1 ####
pol0001 0002aaaaname2 ****

Some rules:
1)only records having 2 at position 12 must retrieve.
2)only name values(having 1 at position 12) should replace game values(having 2 at position 12). remaining must not be replaced.

Re: not getting desired output using SPLICE

PostPosted: Wed Nov 02, 2011 2:14 am
by Frank Yaeger
For the example you show, this DFSORT/ICETOOL SPLICE operator would give you the output you say you want:

SPLICE FROM(IN) TO(OUT) ON(1,7,CH) WITHALL WITH(1,16) WITH(23,4)


However, it assumes that every group will have a record with '1' in 12 followed by one or more records with '2' in 12.
If that's not what you have, then you'll need to explain in more detail what you do have and the complete set of rules you want to use.

Re: not getting desired output using SPLICE

PostPosted: Wed Nov 02, 2011 2:16 pm
by Ashok Raju
Frank,

that is only an example.
let me explain the actual thing in detail.
==> the input file has policy numbers(pos 1-23),some data, policy holder name{only records having '1' in 54}(pos 63-152),
error detail{only records having '2' in 54}(pos 69-370),
1--------------23-----------------54--------63----69-------------------152-------370
pol0000000001XXXXXXXXXXXX 1 ---------name11111111111111111
pol0000000001XXXXXXXXXXXX 2 ----------------error detail111111111111111
pol0000000001XXXXXXXXXXXX 2 ----------------error detail111111100000000
pol0000000002YYYYYYYYYYYY 1 ---------name22222222222222222
pol0000000002YYYYYYYYYYYY 2 ----------------error detail222222222222222
pol0000000003ZZZZZZZZZZZZ 1 ---------name33333333333333333
pol0000000003ZZZZZZZZZZZZ 2 ----------------error detail333333333333333
==> the output file should be formatted with only records having '2' in 54.
==> the format of output file is policy numbers(1-23), some data, policy holder name(taken from same policy number and '1' in 54), error detail
Eg:
1--------------23-----------------54-------63--------------------------152 153-------------------------------- 522
pol0000000001XXXXXXXXXXXX 2----------name111111111111111111 error detail1111111111111111111
pol0000000001XXXXXXXXXXXX 2----------name111111111111111111 error detail1111111111100000000
pol0000000002YYYYYYYYYYYY 2 ---------name222222222222222222 error detail2222222222222222222
pol0000000003ZZZZZZZZZZZZ 2 ---------name333333333333333333 error detail3333333333333333333

Hope you understand..

Thanks,
Raju

Re: not getting desired output using SPLICE

PostPosted: Wed Nov 02, 2011 11:41 pm
by Frank Yaeger
I'm having trouble figuring out the fields in your record.

But you should be able to use the same type of SPLICE statement I used. You just need to specify the WITH fields as the fields in the '2' (overlay) records. The other fields will come from the '1' (base) record.

I'd suggest you try playing around with the WITH fields until you get what you want.

Re: not getting desired output using SPLICE

PostPosted: Thu Nov 03, 2011 2:02 pm
by Ashok Raju
Thank you Frank,

I formatted the file, later used SPLICE accordingly...

Regards,
Raju