Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Masking one field in a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
suzeet

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Fri Sep 13, 2013 1:50 pm    Post subject: Masking one field in a file
Reply with quote

Hi
I want to mask one field in a file as the example below

Code:

00000123456789
00012345678902
01234567891234

It will show up first 4 digits after 0 and last 4 digit as below
Code:

000001234*6789
0001234***8902
01234*****1234


The file is a fixed length of 80 and the field starts from column 1. The length of the field is 16.
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Fri Sep 13, 2013 5:35 pm    Post subject:
Reply with quote

What would be the expected output when you have input like

Code:
00000012345678
01234012345678
Back to top
View user's profile Send private message
suzeet

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Fri Sep 13, 2013 5:46 pm    Post subject: Reply to: Masinking Data
Reply with quote

The Expected output would be
Code:

00000012345678
01234*****5678
Back to top
View user's profile Send private message
bodatrinadh

Active User


Joined: 05 Jan 2007
Posts: 101
Location: chennai (India)

PostPosted: Fri Sep 13, 2013 5:52 pm    Post subject: Reply to: Masinking Data
Reply with quote

Hi Suzeet,

Check this code -

Code:

//STEP01   EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
00000123456789
00001234567890
00012345678902
00123456789021
01234567891234
1234567890XZCX
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *     
  INREC IFTHEN=(WHEN=(1,4,CH,EQ,C'1234'),OVERLAY=(5:C'*****')),
        IFTHEN=(WHEN=(2,4,CH,EQ,C'1234'),OVERLAY=(6:C'****')),
        IFTHEN=(WHEN=(3,4,CH,EQ,C'1234'),OVERLAY=(7:C'***')),
        IFTHEN=(WHEN=(4,4,CH,EQ,C'1234'),OVERLAY=(8:C'**')),
        IFTHEN=(WHEN=(5,4,CH,EQ,C'1234'),OVERLAY=(9:C'*'))
  SORT FIELDS=COPY


Output :-

Code:

00000123456789 
00001234*67890 
0001234**78902 
001234***89021 
01234****91234 
1234*****0XZCX 


Thanks
-3nadh
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Sep 13, 2013 6:09 pm    Post subject: Reply to: Masinking Data
Reply with quote

the 123456789... are just place holders,

the trigger is/are the leading zeroe(s)

probably something along the lines of ...

Code:
//SYSIN    DD *     
  INREC IFTHEN=(WHEN=(1,5,CH,EQ,C'00000'),OVERLAY=(10:C'*')),
        IFTHEN=(WHEN=(1,4,CH,EQ,C'0000'),OVERLAY=(9:C'**')),
        IFTHEN=(WHEN=(1,3,CH,EQ,C'000'),OVERLAY=(8:C'***')),
        IFTHEN=(WHEN=(1,2,CH,EQ,C'00'),OVERLAY=(7:C'****')),
        IFTHEN=(WHEN=(1,1,CH,EQ,C'0'),OVERLAY=(6:C'*****'))
  SORT FIELDS=COPY


might fit better the requirement

warning, NOT TESTED, seems reasonable anyway
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Fri Sep 13, 2013 6:47 pm    Post subject: Reply to: Masinking Data
Reply with quote

I'd put

Code:
        IFTHEN=(WHEN=(1,6,CH,EQ,C'000000'),OVERLAY=(1:1,1)),


first, as a "just in case". No data will change (the data at position 1 will be placed at position 1) but all the other IFTHENs will be avoided.

Otherwise, for the short field, it looks fine to me. Of course, we may expect TS to come back admitting the it is 24 bytes long :-)
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 17 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us