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
 

 

how to identify the next location of the specific word.
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
ssprabhu

New User


Joined: 25 Apr 2005
Posts: 67
Location: pune

PostPosted: Mon Jul 28, 2008 1:22 pm    Post subject: how to identify the next location of the specific word.
Reply with quote

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
View user's profile Send private message

ssprabhu

New User


Joined: 25 Apr 2005
Posts: 67
Location: pune

PostPosted: Mon Jul 28, 2008 1:45 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Mon Jul 28, 2008 3:17 pm    Post subject:
Reply with quote

Why is this change ? if you change the confidential data how will you retrieve it ??
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jul 28, 2008 5:30 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ssprabhu

New User


Joined: 25 Apr 2005
Posts: 67
Location: pune

PostPosted: Mon Jul 28, 2008 6:33 pm    Post subject:
Reply with quote

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
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 743
Location: Germany

PostPosted: Mon Jul 28, 2008 6:46 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ssprabhu

New User


Joined: 25 Apr 2005
Posts: 67
Location: pune

PostPosted: Mon Jul 28, 2008 6:57 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Jul 28, 2008 7:10 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ssprabhu

New User


Joined: 25 Apr 2005
Posts: 67
Location: pune

PostPosted: Mon Jul 28, 2008 7:26 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Jul 28, 2008 7:39 pm    Post subject:
Reply with quote

Is 'cust name =' in your test data?
Back to top
View user's profile Send private message
ssprabhu

New User


Joined: 25 Apr 2005
Posts: 67
Location: pune

PostPosted: Mon Jul 28, 2008 7:51 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Mon Jul 28, 2008 8:13 pm    Post subject:
Reply with quote

can you please post your other INSPECT stmts for name and pan ???
Back to top
View user's profile Send private message
ssprabhu

New User


Joined: 25 Apr 2005
Posts: 67
Location: pune

PostPosted: Mon Jul 28, 2008 8:22 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Mon Jul 28, 2008 8:25 pm    Post subject: Re: how to identify the next location of the specific word.
Reply with quote

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
View user's profile Send private message
ssprabhu

New User


Joined: 25 Apr 2005
Posts: 67
Location: pune

PostPosted: Mon Jul 28, 2008 8:43 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Mon Jul 28, 2008 8:55 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7909
Location: Bellevue, IA

PostPosted: Mon Jul 28, 2008 8:55 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ssprabhu

New User


Joined: 25 Apr 2005
Posts: 67
Location: pune

PostPosted: Mon Jul 28, 2008 9:02 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ssprabhu

New User


Joined: 25 Apr 2005
Posts: 67
Location: pune

PostPosted: Mon Jul 28, 2008 9:09 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ssprabhu

New User


Joined: 25 Apr 2005
Posts: 67
Location: pune

PostPosted: Mon Jul 28, 2008 9:14 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts how to split records based on specifi... Venkata Ramayya DFSORT/ICETOOL 6 Wed Sep 28, 2016 3:20 am
No new posts How to calculate an specific transact... lind sh CICS 2 Tue Sep 13, 2016 9:20 pm
No new posts DFSORT sorting only specific records akodakka DFSORT/ICETOOL 4 Thu Aug 04, 2016 11:24 am
No new posts Mainframe opening for 3 to 10 yrs exp... Placementatpune Mainframe Jobs 0 Tue Jul 05, 2016 12:02 pm
No new posts insert the same records but chancing ... danylele74 DB2 6 Mon May 02, 2016 7:22 pm


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