Masking by Overlay



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

Masking by Overlay

Postby vkumarg3 » Tue Sep 18, 2012 5:03 pm

Hi all,

I have ip PS file with few sample records.

My task is to sort the file based on the name and scramble or mask the field.

Sort based on name i have done. But Scramble logic i dont know.Please help.

Scramble logic:

Every second byte of the name field is to be replaced with 'X'.

Example :

In input file name field is ABCDEFG means, scrambled file should be AXCXEXG.



In JCL i should implement this. Should OVERLAY command to be used? Thanks in advance.
vkumarg3
 
Posts: 29
Joined: Fri Jan 06, 2012 9:29 am
Has thanked: 10 times
Been thanked: 0 time

Re: Masking by Overlay

Postby BillyBoyo » Tue Sep 18, 2012 5:08 pm

OVERLAY=(2:C'X',4:C'X',6:C'X'....


Change all the columns (those numbers followed by a colon) to be the positions you want "masked" in that way.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Masking by Overlay

Postby NicC » Tue Sep 18, 2012 6:06 pm

JCL does not have an OVERLAY command - sort does though.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Masking by Overlay

Postby vkumarg3 » Fri Sep 21, 2012 12:07 pm

@ Billy and NicC : Thanks

I faced one issue in this.

I implemented this logic on Name field X(10).

Sample records are given below:
abc
abcdefgh

So my output file came like this
aXcX X X X
aXcXeXgX X.

X replacement should stop once name ends right. So i used IFTHEN= with overlay command.

Like

IFTHEN=(WHEN=(2,1,CH,NE,C' '),
          OVERLAY=(2:C'X'),HIT=NEXT),
      IFTHEN=(WHEN=(4,1,CH,NE,C' '),
          OVERLAY=(4:C'X'),HIT=NEXT),
      IFTHEN=(WHEN=(6,1,CH,NE,C' '),
          OVERLAY=(6:C'X'),HIT=NEXT),........

But it is like hard coding. Does anyother approach there to solve this?

Code'd and column positions - values before : - corrected to reflect postions in WHEN=s.
vkumarg3
 
Posts: 29
Joined: Fri Jan 06, 2012 9:29 am
Has thanked: 10 times
Been thanked: 0 time

Re: Masking by Overlay

Postby BillyBoyo » Fri Sep 21, 2012 12:30 pm

FRED SPOON
RUPERT BREAKFAST
JIM BUTTER


FXEX XPXOX X X X
RXPXRX XRXAXFXSX
JXMXBXTXEX X X X


Some examples might help.

With the "blind" OVERLAY you get the above for my sample data.

If the data were constrained to being two separate elements, then a general-purpose programming language will probably be able to fix-up the first, as the "pattern" of trailing X and space.

However, getting the X between JIM and BUTTER would not be possible directly.

The approach you have now is probably a good one, considering that DFSort is not a gp programming language...
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post