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

COBOL NON PRINTABLE CHARACTERS


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Bill O'Boyle

CICS Moderator


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

PostPosted: Thu Oct 07, 2010 1:34 am
Reply with quote

dbzTHEdinosauer wrote:
Ronald Burr,

thanks for the clarification. I spent some time going thru the manual and
missed the part that identifier-6 & 7 had to be elementary items.

Dick,

This restriction borders on "nutty". Why would the compiler folks impose this?

Whether it's addressed at a group level or at an elementary level, it's the same address. icon_eek.gif

I guess they have their reasons. icon_rolleyes.gif

BTW, I missed this too in the manual. icon_wink.gif

Bill
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Thu Oct 07, 2010 2:45 am
Reply with quote

Bill O'Boyle wrote:
This restriction borders on "nutty". Why would the compiler folks impose this?

Whether it's addressed at a group level or at an elementary level, it's the same address. icon_eek.gif

Bill


I agree.

The requirement that both of the identifiers be "elementary" items does seem a bit arbitrary, given that each of the group-items and its respective redefined elementary items have the same address, the same length, and the same class (alphanumeric).

I guess that's why I mis-remembered that requirement when I posted the original code. I only remembered the requirements that both identifiers had to have the same length, and that identifier-6 could not contain duplicate character values. Hopefully, I won't mis-remember similarly in the future.
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Thu Oct 07, 2010 12:37 pm
Reply with quote

ooops... I had posted the same as Ronald Burr about the redefines... I hadn't read the 2 page.


icon_redface.gif
Back to top
View user's profile Send private message
essence21

New User


Joined: 05 Dec 2008
Posts: 20
Location: mumbai

PostPosted: Thu Oct 07, 2010 5:09 pm
Reply with quote

Thanks All,

Its working perfectly now.

I feel the issue was cropping up due to 03 level defined under 05.. i now modified to 01 --> 03 --> 05.. And its working ok.

Thank you for your help...

Just one more thing i was wondering what be the CPU usage if this is inserted into a scheduler which runs 1 minute frequency and the field is PIC X(967)
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Thu Oct 07, 2010 5:55 pm
Reply with quote

An INSPECT...CONVERTING statement in COBOL results in assembler TRANSLATE instructions, which are very, very fast - especially when compared to any other method of performing the same task. The Principles of Operation Manual describes the TRANSLATE instruction thusly:

"The bytes of the first operand are selected one by one for translation, proceeding left to right. Each argument byte is added to the initial second operand address. The addition is performed following the rules for address arithmetic, with the argument byte treated as an eight-bit unsigned binary integer and extended with zeros on the left. The sum is used as the address of the function byte, which then replaces the original argument byte."

Since your source field is more than 256 bytes ( the limit for a single TRANSLATE instruction ), and of a FIXED length, I'm "assuming" that the compiler will simply generate FOUR such TRANSLATE instructions ( three of 256 bytes each, and one for the remainder (199 bytes)) in order to convert the entire field.

If the field were of a VARIABLE length, the underlying code would have to contain a "loop" to perform zero or more 256-byte TRANSLATEs, followed by one for the remainder ( when it becomes less than 256 bytes ). Though somewhat less efficient than when dealing with FIXED length fields, it would still be the fastest method available to accomplish the task.
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: Thu Oct 07, 2010 6:58 pm
Reply with quote

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.

Bill
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Fri Oct 08, 2010 12:13 am
Reply with quote

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                                 
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top