Merging the records based on key and repl data using ICETOOL



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

Merging the records based on key and repl data using ICETOOL

Postby svrkreddy » Sat Nov 03, 2012 1:12 am

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
svrkreddy
 
Posts: 3
Joined: Sat Nov 03, 2012 1:00 am
Has thanked: 0 time
Been thanked: 0 time

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

 

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

Postby dick scherrer » Sat Nov 03, 2012 1:28 am

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?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

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

Postby svrkreddy » Sat Nov 03, 2012 1:46 am

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.
svrkreddy
 
Posts: 3
Joined: Sat Nov 03, 2012 1:00 am
Has thanked: 0 time
Been thanked: 0 time

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

Postby Akatsukami » Sat Nov 03, 2012 2:04 am

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
.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1053
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

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

Postby svrkreddy » Sat Nov 03, 2012 2:23 am

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
svrkreddy
 
Posts: 3
Joined: Sat Nov 03, 2012 1:00 am
Has thanked: 0 time
Been thanked: 0 time

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

Postby BillyBoyo » Sat Nov 03, 2012 5:05 am

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.
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