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

Performance:INSPECT Replacing all VS INSPECT Converting to


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Mar 07, 2008 5:33 pm
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
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Mar 07, 2008 7:16 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts exploiting Z16 performance PL/I & Assembler 2
No new posts Converting fixed length file to excel... IBM Tools 7
No new posts JOIN STATEMENT PERFORMANCE. DFSORT/ICETOOL 12
Search our Forums:

Back to Top