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

DATA MASKING


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
beruoist

New User


Joined: 14 Nov 2007
Posts: 70
Location: mumbai

PostPosted: Wed Dec 17, 2008 2:08 pm
Reply with quote

I have a alphanumeric variable which can contain values like below

#X= "ASCBDADJK 903485"

what i have to do is examine the variable and replace all the A-Z to X and 0-9 to 9..rest of the spaces and other characters should be unchanged.

I had thought of one logic.

#I (N2)
#J (N2)
#VAR (A1/1:26) CONST<'A''B''C''D''E''F''G''H''I''J''K''L''M''N''O''P''Q''R''S''T''U''V''W''X''Y''Z'>
#NUM (N1/10) CONST <'1''2''3''4''5''6''7''8''9''0'>
*
*
For #I 1 26
EXAMINE #X for #VAR(#I) replace with 'X'
#I=#I+1
end-for
*
For #J 1 10
EXAMINE #X for #NUM(#J) replace with '9'
#J=#J+1
end-for
*
*

Note- I havent tested this logic yet,Hope this will work fine.

My question is,Is thier is any easier way to do this ?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Dec 17, 2008 3:30 pm
Reply with quote

There is no other option. In order for your statements to work as expected, change "replace" to "replace all".

O.
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 -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts JCL EXEC PARM data in C Java & MQSeries 2
Search our Forums:

Back to Top