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
 

 

STRING Statement Performance improvement

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

Active User


Joined: 04 Oct 2006
Posts: 118
Location: NJ, USA

PostPosted: Mon May 19, 2008 9:20 pm    Post subject: STRING Statement Performance improvement
Reply with quote

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
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon May 19, 2008 9:27 pm    Post subject:
Reply with quote

What are the string statements? Many times they can be replaced with moves with reference modification.
Back to top
View user's profile Send private message
vijikesavan

Active User


Joined: 04 Oct 2006
Posts: 118
Location: NJ, USA

PostPosted: Mon May 19, 2008 11:09 pm    Post subject: Reply to: STRING Statement Performance improvement
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon May 19, 2008 11:46 pm    Post subject: Re: Reply to: STRING Statement Performance improvement
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10234
Location: italy

PostPosted: Tue May 20, 2008 12:08 am    Post subject: Reply to: STRING Statement Performance improvement
Reply with quote

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 ) icon_smile.gif

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Tue May 20, 2008 1:27 am    Post subject: Re: STRING Statement Performance improvement
Reply with quote

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
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 Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 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