Page 1 of 1

Merging the records based on key and repl data using ICETOOL

PostPosted: Sat Nov 03, 2012 1:12 am
by svrkreddy
Hello All, I have requirement where I need to merge 2 records based on key but I also need to Replace data with 'Y' if any of one the records has 'Y' in it. Below is the example. Using ICETOOL

Input
======
key-filed data
======== =======
IP366413 NNYNNY
IP366413 YNNNNY
IP366416 YYNNNN
IP366416 YNNNYN

Output
======
IP366413 YNYNNY
IP366416 YYNNYN

Re: Merging the records based on key and repl data using ICE

PostPosted: Sat Nov 03, 2012 1:28 am
by dick scherrer
Hello and welcome to the forum,

Why does someone believe this must be done using ICETOOL?

A MERGE (in IT) combines data from 2 separate files based on some key(s). This request has only a single input file. . .

All of the input records have a Y in them - whay are they not all selected?

Re: Merging the records based on key and repl data using ICE

PostPosted: Sat Nov 03, 2012 1:46 am
by svrkreddy
First of all thank you for your quick reply.

To answer first question...I have to enhance the current ICETOOL functionality, I wanted to add this condition as well. I don't want to use new tool.

I wanted to create unique records based on key field(Pos 1 to 8) and merge the position 10 to 15, if it has a Y in any one of the records(consider each position as separate between 10 to 15), I need to place Y in the output records, if both records position has N then it should be N.

hope this help to understand my requirements.

Re: Merging the records based on key and repl data using ICE

PostPosted: Sat Nov 03, 2012 2:04 am
by Akatsukami
svrkreddy wrote:To answer first question...I have to enhance the current ICETOOL functionality, I wanted to add this condition as well.

Perhaps, then, you could let us know the current functionality, as this may affect our advice to you.

Please copy and paste the JCL and control cards -- do not retype them, as this may introduce irrelevant errors -- and enclose them
in Code tags, to preserve    alignment
.

Re: Merging the records based on key and repl data using ICE

PostPosted: Sat Nov 03, 2012 2:23 am
by svrkreddy
Here is the code and this is my last step in my job, I am talking about 'ERROR FLAGS - 20' which had 20 different postions with N's and Y's, I need to merge them.

DISPLAY FROM(IN) LIST(OUT) -                         
TITLE('AB1234D2(A) ABCD HEALTH - ABCD ERROR FLAGS')  -
BLANK DATE TIME PAGE -                               
HEADER('PLAN')                  -                     
HEADER('PART ID      ‘ )    -                     
HEADER('PIN')                   -                     
HEADER('CONTRACT')              -                     
HEADER('ERROR FLAGS - 20')  -                     
ON(1,6,CH)        -                                   
ON(7,17,CH)       -                                   
ON(248,7,CH)      -                                   
ON(255,8,CH)      -                                   
ON(266,20,CH)


Code'd, for what it was worth

Re: Merging the records based on key and repl data using ICE

PostPosted: Sat Nov 03, 2012 5:05 am
by BillyBoyo
Well, since you can't use a CNTL file with DISPLAY I can't see a way of amending what you have to get what you want.

You'll need to pre-process your file to keep the DISPLAY, or use the reporting functions of OUTFIL in place of the DISPLAY.