|
|
| Author |
Message |
vijikesavan
Active User
Joined: 04 Oct 2006 Posts: 101 Location: NJ, USA
|
|
|
|
Hi,
We have a program with multiple string statements in it. These constitiute to high CPU and we are looking for ways to reduce it. Few stmnts we can remove but we need to retain most of them.
Can anyone suggest me a replacement for "STRING" statements for performance?
Any pointers will be appreciated.
Thanks,
Viji |
|
| Back to top |
|
 |
References
|
Posted: Mon May 19, 2008 9:20 pm Post subject: Re: STRING Statement Performance improvement |
 |
|
|
 |
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 970 Location: Virginia, USA
|
|
|
|
| What are the string statements? Many times they can be replaced with moves with reference modification. |
|
| Back to top |
|
 |
vijikesavan
Active User
Joined: 04 Oct 2006 Posts: 101 Location: NJ, USA
|
|
|
|
The STRING statement is like this:
| Code: |
STRING
'ABCDEFG PROGRAM MUST ABEND - REASON = '
FUXBLKCA-RC
' LENGTH REQUESTED '
EDIT-LENGTH
DELIMITED BY SIZE
INTO DMSG-TEXT-2 |
|
|
| Back to top |
|
 |
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 970 Location: Virginia, USA
|
|
|
|
| vijikesavan wrote: |
The STRING statement is like this:
| Code: |
STRING
'ABCDEFG PROGRAM MUST ABEND - REASON = '
FUXBLKCA-RC
' LENGTH REQUESTED '
EDIT-LENGTH
DELIMITED BY SIZE
INTO DMSG-TEXT-2 |
|
What a waste
| Code: |
MOVE 'ABCDEFG PROGRAM MUST ABEND - REASON = ' TO DMSG-
TEXT-2.
MOVE FUXBLKCA-RC TO DMSG-TEXT-2 (39 : 2).
MOVE 'LENGTH REQUESTED' TO DMSG-TEXT-2 (42 : 16).
MOVE EDIT-LENGTH TO DMSG-TEXT-2 (58 : 2).
|
Depending on the length of edit-length and fuxblkca-rc you may need to change some of the start positions and lengths. |
|
| Back to top |
|
 |
enrico-sorichetti
Global Moderator
Joined: 14 Mar 2007 Posts: 2560 Location: italy
|
|
|
|
Unless the people who wrote the compiler fouled up things
there should be not a big difference in performance,,
thats just a series of moves
something that could be done, and it' s being done quite frequently in such evaluation,
is to write two simple programs performing lets say 10000 times the buffer build
one program using the string operator
the other one the moves
and look at the cpu and elapsed times
( no I/O just the moves )
unless the compiler is soooo smart to realize that
the destination variables are never used on the right side of a statement
and discard all the operations done on them
the C compiler just does that
for a the average cobol programmer it should take a few minutes
( after all he has a whole program to cannibalize )
I would do it myself, but I do not speak cobol
another way would be to run a compile and look at the assembler listing |
|
| Back to top |
|
 |
Bill O'Boyle
Active User
Joined: 14 Jan 2008 Posts: 268 Location: Orlando, FL, USA
|
|
|
|
Keep the STRING Verb and compile the program using the LIST,NOOFFSET compile options and post the Assembler expansion of the STRING.
As Enrico has said, it should just be a series of MVC's.
I'd be surprised if a COBOL run-time routine is invoked, although this can't be ruled out until the expansion can be reviewed.
Regards,
Bill |
|
| Back to top |
|
 |
|
|