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
 

 

Performance:INSPECT Replacing all VS INSPECT Converting to

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sutirtha mukherjee

New User


Joined: 04 Mar 2008
Posts: 6
Location: Chennai

PostPosted: Fri Mar 07, 2008 11:28 am    Post subject: Performance:INSPECT Replacing all VS INSPECT Converting to
Reply with quote

Hi,

Can you please tell me which would be less CPU time consuming
INSPECT REPLACING ALL or INSPECT CONVERTING TO?

Thanks,
Sutirtha
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: Fri Mar 07, 2008 5:33 pm    Post subject: INSPECT Replacing all VS INSPECT Converting
Reply with quote

INSPECT REPLACING, regardless whether you're using WS or literals, always generates a BALR/CALL to a COBOL run-time routine. This is also true with INSPECT CONVERTING with WS.

However, INSPECT CONVERTING with literals generates a single in-line TR (Translate) instruction and would be the more efficient and less costly method.

Note that I believe the literal-length maximum is 160-bytes, but this should be reviewed and confirmed.

HTH....

Regards,

Bill
Back to top
View user's profile Send private message
sutirtha mukherjee

New User


Joined: 04 Mar 2008
Posts: 6
Location: Chennai

PostPosted: Fri Mar 07, 2008 5:52 pm    Post subject: Performance:INSPECT Replacing all VS INSPECT Converting to
Reply with quote

Thanks a lot, Bill

I would be using this INSPECT in a loop 2000 times ...
so inspect converting might save time ...
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: Fri Mar 07, 2008 7:16 pm    Post subject: Performance:INSPECT Replacing all
Reply with quote

If the area that you're trying to convert is 2000 bytes long, then it would be much more efficient to issue a single INSPECT CONVERTING or INSPECT REPLACING, which may (or would) result in a single BALR/CALL to the COBOL runtime module, but it would be far cheaper than 2000 In-Line TR instructions in a loop.

Can I ask what you're converting "from" and "to"?

Regards,

Bill
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
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
This topic is locked: you cannot edit posts or make replies. DB2 query Using Recursion, Converting... smilewithashu2 DB2 3 Tue Jan 03, 2017 12:50 pm
No new posts BC, BCR, BRC, BRCL performance steve-myers PL/I & Assembler 0 Fri Dec 23, 2016 7:44 am


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