View previous topic :: View next topic
|
Author |
Message |
ssprabhu
New User
Joined: 25 Apr 2005 Posts: 67 Location: pune
|
|
|
|
Can we acheive this by using INSPECt command?
customer dtails , cust Ac No = 21212212, cust Name = ssp , PAN number = 212121,
i want to change this as below..
customer dtails , cust Ac No = XXXXXXXX, cust Name = XXX , passport number = XXXXXX, |
|
Back to top |
|
|
ssprabhu
New User
Joined: 25 Apr 2005 Posts: 67 Location: pune
|
|
|
|
SORRY , TYPO ERROR
Can we acheive this by using INSPECt command?
customer dtails , cust Ac No = 21212212, cust Name = ssp , PAN number = 212121,
i want to change this as below..
customer dtails , cust Ac No = XXXXXXXX, cust Name = XXX , PAN number = XXXXXX,
i mean , need to replace all the confidentioal datas to 'XXXXXX'
there is no constant position of these fields..it would vary at different places .. need your valuable inputs please... |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
Why is this change ? if you change the confidential data how will you retrieve it ?? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
customer dtails , cust Ac No = 21212212, cust Name = ssp , PAN number = 212121,
|
what is constant in the record? what can be used to identify the above combination?
when that is known, then suggestions for UNSTRING, INSPECT, etc... will come.
as far as why? I image you are de-customerizing production data.
Do the data values for either cust Ac No or PAN number always have to remain numeric?
(do you expect to use this data to populate a vsam file or db2 tables?) |
|
Back to top |
|
|
ssprabhu
New User
Joined: 25 Apr 2005 Posts: 67 Location: pune
|
|
|
|
Yes , constant fields are cust Ac No , cust Name and PAN number
i have to obscure all the datas by replacing 'XXXXXXX'
how to acheive this..i have tried so many inspect menthods bu not working ..please advise me... |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Hi
Then, constants seam to be "=" in front and ";" at end of the specific data. Unstring them into diverse fields, transform data in the three fields, you have to make unreadable, and them string them back together. |
|
Back to top |
|
|
ssprabhu
New User
Joined: 25 Apr 2005 Posts: 67 Location: pune
|
|
|
|
UmeySan,
Exactly you got it.. but constant i want to consider as " cust Ac No = "
" cust Name = " and "PAN number = "
because there are so many text must have" = " symobol so we cant only consider this "=" sign..
Please give me the code for this ..UmeySan
Many Thanks in advance |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
perform varying x1 from 1 by 1 until x1 > record-length - 14
if record( x1 : 14) = ' Cust Ac no = '
move 'xxxxxxxx' to record (x1 + 14: 8)
end-if
etc
end-perform. |
|
Back to top |
|
|
ssprabhu
New User
Joined: 25 Apr 2005 Posts: 67 Location: pune
|
|
|
|
Many Thanks craq ...
but i guess we can achieve this by using INSPECT command...please see below..
01 DATA1 PIC X(100) VALUE ' hai cust ac no= 21212212 ,, NAME = 21212 '.
INSPECT DATA1
REPLACING CHARACTERS BY "X" AFTER "cust ac no = "
BEFORE ','
it's successfully replaced for 'xxxxxxxxx' for cust ac no but the same way when i try for cust name and pan number it 's not replacing i dont know the reason....
how can we do it ..what is the problem in logic...
plz plzz....advise |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Is 'cust name =' in your test data? |
|
Back to top |
|
|
ssprabhu
New User
Joined: 25 Apr 2005 Posts: 67 Location: pune
|
|
|
|
No craq,
cust name is not my test date only "name" only is my data ...pplease suugest
this is how i defined-see below ..but this is my testing purpose once i got the logic i will sweep the database and take this different text from database for each account
01 DATA1 PIC X(100) VALUE ' hai cust ac no= 21212212 ,
NAME = 21212 '. |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
can you please post your other INSPECT stmts for name and pan ??? |
|
Back to top |
|
|
ssprabhu
New User
Joined: 25 Apr 2005 Posts: 67 Location: pune
|
|
|
|
please check...
01 DATA1 PIC X(100) VALUE
'HAI cust ac NO = 21212212,NAME = 21212,'.
INSPECT DATA1
REPLACING CHARACTERS BY "X" AFTER "NAME = "
BEFORE ","
DISPLAY DATA1
STOP RUN. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
To convert the NUMERICS to X, couldn't you issue -
Code: |
INSPECT CUST-DTL CONVERTING '0123456789' TO 'XXXXXXXXXX'.
|
Afterwards, begin at the last byte of field CUST-DTL and proceed backwards until you find the literal 'NAME', then go forward, find the '=' and move 'X' to each byte of the customer name, until you hit a subsequent ',' or the end of the field.
Maybe I'm oversimplifying this or I'm not quite understanding the number of sub-fields (and how to identify them) in the CUST-DTL string.
Bill |
|
Back to top |
|
|
ssprabhu
New User
Joined: 25 Apr 2005 Posts: 67 Location: pune
|
|
|
|
Thanks Bill,
I tried this option but probem is see my actual data look like this .so in this case converting statement would work.
cust Ac No= 12121211, cust Name = SBI , cust code = 212121
i want is as below
cust Ac No= XXXXXXXX, cust Name = XXX , cust code = XXXXXX (
constant fields are "cust Ac No= " , "cust Name = " , " cust code = "
in case if u know please throw the soln.. |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
If in your data numerics occur only for cust ac, cust name and cust code
use this
Code: |
inspect data-1 converting "0123456789"
to "xxxxxxxxxx" after initial "cust ac NO = "
|
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Something like
Code: |
WORKING-STORAGE SECTION.
01 WS-DATA.
05 WS-DATA-OLD PIC X(80) VALUE
'cust Ac No= 12121211, cust Name = SBI , cust code = 212121'.
05 WS-DATA-NEW PIC X(80) VALUE
'cust Ac No= 12121211, cust Name = SBI , cust code = 212121'.
PROCEDURE DIVISION.
INSPECT WS-DATA-NEW CONVERTING '1234567890' TO 'XXXXXXXXXX'.
INSPECT WS-DATA-NEW REPLACING CHARACTERS BY 'X'
AFTER 'cust Name = '
BEFORE ' ,'.
DISPLAY WS-DATA-OLD.
DISPLAY WS-DATA-NEW. |
producing
Code: |
cust Ac No= 12121211, cust Name = SBI , cust code = 212121
cust Ac No= XXXXXXXX, cust Name = XXX , cust code = XXXXXX |
? |
|
Back to top |
|
|
ssprabhu
New User
Joined: 25 Apr 2005 Posts: 67 Location: pune
|
|
|
|
i got the soln...all please chk and tell me is there any other simplified soln available.... problem is delimiter just i changed it.
INSPECT DATA1
REPLACING CHARACTERS BY "X" AFTER "cust ac no = "
BEFORE ",cust name ="
INSPECT DATA1
REPLACING CHARACTERS BY "X" AFTER "cust name = "
BEFORE ",cust code = "
INSPECT DATA1
REPLACING CHARACTERS BY "X" AFTER "cust code = "
BEFORE ", "
DISPLAY DATA1
STOP RUN. |
|
Back to top |
|
|
ssprabhu
New User
Joined: 25 Apr 2005 Posts: 67 Location: pune
|
|
|
|
I got the soln..see below i any one knows the simpler than this please kindly let me know...
INSPECT DATA1
REPLACING CHARACTERS BY "X" AFTER "cust ac no = "
BEFORE ", cust NAME ="
INSPECT DATA1
REPLACING CHARACTERS BY "X" AFTER "cust NAME = "
BEFORE ", cust code = "
INSPECT DATA1
REPLACING CHARACTERS BY "X" AFTER "cust code = "
BEFORE ", "
DISPLAY DATA1
STOP RUN.
thanks |
|
Back to top |
|
|
ssprabhu
New User
Joined: 25 Apr 2005 Posts: 67 Location: pune
|
|
|
|
Yes robert u r right...but problem is there could be so many other numeric field as wll in the text ..that we should not change ..only this fields we need to change ..
plz chk my solution and give me the simpler soln than that |
|
Back to top |
|
|
ssprabhu
New User
Joined: 25 Apr 2005 Posts: 67 Location: pune
|
|
|
|
all, please tell me how to convert the 'alpha nuerics to 'XXXXXXXX' |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Based on the latest information you provided, you're not going to get any simpler than three INSPECT statements. |
|
Back to top |
|
|
ssprabhu
New User
Joined: 25 Apr 2005 Posts: 67 Location: pune
|
|
|
|
Yes robert , but there is no other way i have to 3 inispect stmt...
if any other way please advise me... |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
do this in one INSPECT
If input is
'HAI cust ac NO = 21212212,cNAME = sbi,cUST = 333'.
Code: |
inspect ws-name1 replacing
characters by "x" after initial "cust ac NO = " before
initial ",c"
characters by "x" after initial "cNAME = " before
initial ",cU"
characters by "x" after initial "CUST = "
|
but here you have to make sure the before clause changes for each replacing ...it should not be the same ...for No use before ',c' for name add one more letter to the before clause and do not forget to put a before clause for cUST or else the entire string till the max will be filled with "X"
so is cUST is the last in the data use before initial space [/code] |
|
Back to top |
|
|
ssprabhu
New User
Joined: 25 Apr 2005 Posts: 67 Location: pune
|
|
|
|
superb ashimeer..... |
|
Back to top |
|
|
|