IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Masking variable size field - min 10 bytes max 19 bytes


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 199
Location: india

PostPosted: Wed Dec 21, 2022 10:15 am
Reply with quote

Hello Guys,

I need to mask a variable size field (min 10 bytes, max 19 bytes) as per my sample input and output data below

Input data
Code:

1348701373183741089
438748760387351370
1938491384
13453413413313
634133434123
32313134132
7129481974199149


Output data

Code:

1348XXXXXXXXXX1089
4387XXXXXXXXX1370
1938XX1384
1345XXXXXX3313
6341XXXX4123
3231XXX4132
7129XXXXXXXX9149



Masking Rules - Only the first and last 4 bytes of the field should be visible while the remaining (in-between) bytes should be be masked with X

Please help me with some ideas on how i can achieve this using sort.

Thank you. Rajat
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1255
Location: Bamberg, Germany

PostPosted: Wed Dec 21, 2022 11:01 am
Reply with quote

Code:
OPTION COPY                                                     
ALTSEQ CODE=(F0E7,F1E7,F2E7,F3E7,F4E7,F5E7,F6E7,F7E7,F8E7,F9E7)
INREC IFTHEN=(WHEN=INIT,                                       
  OVERLAY=(5:5,15,JFY=(SHIFT=RIGHT),5:5,11,TRAN=ALTSEQ,         
           1:1,19,SQZ=(SHIFT=LEFT)))                           
END
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 199
Location: india

PostPosted: Wed Dec 21, 2022 3:50 pm
Reply with quote

Joerg.Findeisen wrote:
Code:
OPTION COPY                                                     
ALTSEQ CODE=(F0E7,F1E7,F2E7,F3E7,F4E7,F5E7,F6E7,F7E7,F8E7,F9E7)
INREC IFTHEN=(WHEN=INIT,                                       
  OVERLAY=(5:5,15,JFY=(SHIFT=RIGHT),5:5,11,TRAN=ALTSEQ,         
           1:1,19,SQZ=(SHIFT=LEFT)))                           
END


Fantastic - Thank you !!
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1255
Location: Bamberg, Germany

PostPosted: Wed Dec 21, 2022 7:14 pm
Reply with quote

Pleasure. Thanks for feedback, and also for providing input in the right format to work with.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Wed Dec 21, 2022 7:49 pm
Reply with quote

In this simple case, even IFTHEN parameter is not required:

Code:
 OPTION COPY                                                     
 ALTSEQ CODE=(F0E7,F1E7,F2E7,F3E7,F4E7,F5E7,F6E7,F7E7,F8E7,F9E7)
 INREC  OVERLAY=(5:5,15,JFY=(SHIFT=RIGHT),
                 5:5,11,TRAN=ALTSEQ,         
                 1:1,19,SQZ=(SHIFT=LEFT))                           
 END
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Using Java/C/C++ to retrieve dataset ... Java & MQSeries 6
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts Variable Output file name DFSORT/ICETOOL 8
Search our Forums:

Back to Top