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.
Cobol program performance Improvement
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: Cobol program performance Improvment.
Hello,
Set up an array and use the "when" value as a subscript rather than using the evaluate.
Set up an array and use the "when" value as a subscript rather than using the evaluate.
Hope this helps,
d.sch.
d.sch.
-
- Posts: 12
- Joined: Sun Feb 10, 2008 12:55 am
- Skillset: cobol,Db2,JCL,File-aid,CICS
- Referer: BY google search
Re: Cobol program performance Improvment.
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
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

- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: Cobol program performance Improvment.
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.
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.
d.sch.
-
- Posts: 6
- Joined: Tue Feb 19, 2008 9:33 pm
- Skillset: mvs, cobol, jcl, vsam, pl/1, racf, ca-7, ca-11, sas
- Referer: web search
Re: Cobol program performance Improvment.
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.
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.
-
- Posts: 62
- Joined: Wed Apr 23, 2008 1:37 pm
- Skillset: Mainframe - JCL, COBOL, VSAM, DB2, REXX, CICS
- Referer: Internet Search
- Location: Chennai, India
- Contact:
Re: Cobol program performance Improvment.
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
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
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Calling Java program on UNIX/USS from a COBOL CICS program?
by zbius » Tue Nov 05, 2024 2:37 pm » in IBM Cobol - 2
- 2566
-
by zbius
View the latest post
Wed Nov 06, 2024 6:02 pm
-
-
- 2
- 3148
-
by enrico-sorichetti
View the latest post
Mon Oct 30, 2023 6:25 pm
-
- 1
- 2415
-
by engh
View the latest post
Fri Jul 08, 2022 7:31 pm
-
- 6
- 1920
-
by sergeyken
View the latest post
Sat Jul 17, 2021 12:38 am
-
-
Find the version of a cobol program through its load module
by vinigim » Fri Oct 30, 2020 3:16 am » in IBM Cobol - 5
- 5132
-
by chaat
View the latest post
Sat Nov 07, 2020 8:40 am
-