Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
Ron,
I believe the Assembler expansion for an INSPECT CONVERTING using WS fields in the FROM and TO, as opposed to literals in the FROM and TO, will cause a CALL/BALR to a COBOL run-time module.
I've found that when using literals and the target of the translation has a length of not greater than 768 and is not using reference modification, the compiler will generate three in-line "TR" instructions. Otherwise, a run-time module is called <sigh>.
For whatever reason (and I think this should be amended), the maximum literal length is 160, which is an odd maximum.
Inquiring minds want/need to know --- so I compiled a little test. You are correct, Bill - it appears that if the conversion tables are 256-bytes each (as in the code I provided), then a call is made to run-time subroutine IGZCIN1. I tried it both as a 967-byte source field, and as four smaller defined sub-fields - in each case calls were made to the subroutine (one for each defined field/sub-field, so it's presumably more efficient to convert one 967-byte field than four smaller fields).
Code:
L 2,92(0,9) TGTFIXD+92
L 15,68(0,2) V(IGZCIN1 )
LA 1,149(0,10) PGMLIT AT +145
BALR 14,15