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

how to identify the next location of the specific word.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ssprabhu

New User


Joined: 25 Apr 2005
Posts: 67
Location: pune

PostPosted: Mon Jul 28, 2008 9:16 pm
Reply with quote

all, please tell me how to convert the 'alpha nuerics to 'XXXXXXXX'
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Mon Jul 28, 2008 9:21 pm
Reply with quote

Based on the latest information you provided, you're not going to get any simpler than three INSPECT statements.
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:24 pm
Reply with quote

Yes robert , but there is no other way i have to 3 inispect stmt...
if any other way please advise me...
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 9:32 pm
Reply with quote

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

New User


Joined: 25 Apr 2005
Posts: 67
Location: pune

PostPosted: Mon Jul 28, 2008 9:43 pm
Reply with quote

superb ashimeer.....
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:44 pm
Reply with quote

All,

please tell me how to convert the 'alpha nuerics to 'XXXXXXXX'

what is the synatx...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 9:46 pm
Reply with quote

Alpha numeric will be treated as character .... what exactly do you want to convert ?
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 10:01 pm
Reply with quote

ok..ok...In case my date is like this PASSWORD = 12-34-21 .
so in this case i believe your above soln also do so ..am i rite ?

plz correct me if iam wrong...
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 10:12 pm
Reply with quote

Hai ,

Some times the text contains different naming conventions like
CUST ACCCOUNT NUMBER (or) CUST AC NO (OR) CUST NO.etc..

so is there any other way in one INSPECT command... like by using OR (or) AND type ...please let me know...


Many thanks in ADVANCE....
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Jul 29, 2008 12:14 am
Reply with quote

instead of using literals in the INSPECT command syntax,
use variables
(personally, I would table everything),
and loop thru one (1) <there, you won your stupid bet>
INSPECT command,
modifying the variables before each invocation.
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 -> COBOL Programming Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Mainframe openings in Techmahnidra fo... Mainframe Jobs 0
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts How to identify the transaction categ... IMS DB/DC 3
No new posts replace word 'MONTH' with current mon... SYNCSORT 11
Search our Forums:

Back to Top