Cobol program performance Improvement



Ask about System customization & performance, Workload management, I/O device configuration etc.

Cobol program performance Improvement

Postby anoopm7 » Mon Mar 24, 2008 1:27 pm

Hi all,

I want to reduce the CPU usuage by my cobol program. The program mainly utilises the CPU time to EVALUATE using a WHEN statment which repeats for 140times thus causing the program to run for a longer time.
Please tell me how i can replace the WHEN statment and put a more effective wayb of doing it.

eg:

WHEN 127
ADD +1 TO WS-127-CT
WHEN 128
ADD +1 TO WS-128-CT
WHEN 129
ADD +1 TO WS-129-CT
WHEN 130
ADD +1 TO WS-130-CT

It goes on checking from 0-140.
anoopm7
 
Posts: 12
Joined: Sun Feb 10, 2008 12:55 am
Has thanked: 0 time
Been thanked: 0 time

Re: Cobol program performance Improvment.

Postby dick scherrer » Mon Mar 24, 2008 10:12 pm

Hello,

Set up an array and use the "when" value as a subscript rather than using the evaluate.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Cobol program performance Improvment.

Postby anoopm7 » Fri Mar 28, 2008 4:33 pm

Appreciate your timely response.

Could any one suggest me few CPU usage optimiaztion techniques. This would be highly helpful as iam now doing a performance check for my programs.


Thanks
Anoop ;)
anoopm7
 
Posts: 12
Joined: Sun Feb 10, 2008 12:55 am
Has thanked: 0 time
Been thanked: 0 time

Re: Cobol program performance Improvment.

Postby dick scherrer » Fri Mar 28, 2008 10:04 pm

Hello,

The way this sort of thing is typically done is to work with the performance measurement people for your system and identify which parts of the code use the most resources (if there is an interest in this level of performance measurement, they will have tools to use to measure). Once the "heavy" user sections of code are identified, they can be reviewed to see how they process and how they might possibly be improved.

Most performance improvements are made by changing the way i/o is done or the way database activity is done.

Keep in mind that it is more important that the code always executes correctly and that the code is maintainable.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Cobol program performance Improvment.

Postby pi17388 » Sun Jul 20, 2008 6:31 am

Excessive/Unnecessary CPU time in cobol is consumed by compiler generated statements involved in packing/unpacking numeric fields. If you compile your programs with options that produce the assembler code for the program (options vary by compiler) you can rather quickly see which cobol statements are generating assembler statements that could be eliminated by simply changing the definition of the target/source data items.

There are a number of cpu saving techniques depending on the type of program but I would wholehartedly agree with the comment about I/O -- there's an old adage, "the fastest I/O is the one you never do", so if your program is I/O intensive and you want to reduce elapsed time (and svc/system cpu time) -- find ways to do less I/Os.
pi17388
 
Posts: 6
Joined: Tue Feb 19, 2008 9:33 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Cobol program performance Improvment.

Postby jayind » Mon Jul 21, 2008 5:08 pm

Few other reasons I came across... (unnecessary I/Os as explained by Dick)

1. Bad SQL statements - having wildcard where clauses, improper optimizing path,
2. Unnecessary file reads - unnecessary loops, unnecessary reads,
3. sharing of files - improper scheduling of jobs causing contention

etc..

Hope these make sense...

regards,
jayind
jayind
 
Posts: 62
Joined: Wed Apr 23, 2008 1:37 pm
Location: Chennai, India
Has thanked: 0 time
Been thanked: 0 time


Return to System programming

 


  • Related topics
    Replies
    Views
    Last post