not getting desired output using SPLICE



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

not getting desired output using SPLICE

Postby Ashok Raju » Tue Nov 01, 2011 3:23 pm

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.
Ashok Raju
 
Posts: 13
Joined: Tue Oct 25, 2011 3:45 pm
Has thanked: 0 time
Been thanked: 0 time

Re: not getting desired output using SPLICE

 

Re: not getting desired output using SPLICE

Postby Frank Yaeger » Wed Nov 02, 2011 2:14 am

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.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: not getting desired output using SPLICE

Postby Ashok Raju » Wed Nov 02, 2011 2:16 pm

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
Ashok Raju
 
Posts: 13
Joined: Tue Oct 25, 2011 3:45 pm
Has thanked: 0 time
Been thanked: 0 time

Re: not getting desired output using SPLICE

Postby Frank Yaeger » Wed Nov 02, 2011 11:41 pm

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.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: not getting desired output using SPLICE

Postby Ashok Raju » Thu Nov 03, 2011 2:02 pm

Thank you Frank,

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

Regards,
Raju
Ashok Raju
 
Posts: 13
Joined: Tue Oct 25, 2011 3:45 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post