Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
CPU Optimization for mainframe

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
mahasweta

New User


Joined: 27 May 2003
Posts: 2

PostPosted: Tue May 27, 2003 3:42 pm    Post subject: CPU Optimization for mainframe
Reply with quote

Hi,

Has anybody worked on CPU Optimization exercise for mainframe. Please share the methodologies or best practices with me. I need to know a general approach towards this exercise.


Regards,
Mahasweta
Back to top
View user's profile Send private message
References
mcmillan

Site Admin


Joined: 18 May 2003
Posts: 919
Location: India

PostPosted: Wed May 28, 2003 9:21 am    Post subject: PLATFORM?
Reply with quote

Please mention all products involved in your project.
Back to top
View user's profile Send private message
mahasweta

New User


Joined: 27 May 2003
Posts: 2

PostPosted: Wed May 28, 2003 10:10 am    Post subject: CPU Optimization on mainframe
Reply with quote

Hi,

Thanks for the reply. I am not sure of the languages involved. I need the general approach towards this irrespective of the platform.

Regards,
Mahasweta
Back to top
View user's profile Send private message
Ravi

New User


Joined: 23 May 2003
Posts: 4
Location: Chennai

PostPosted: Wed May 28, 2003 2:17 pm    Post subject:
Reply with quote

General Programming for CPU optimization!

> Try to make your logic as simple as possible.
> Avoid as much looping as possible.
> Reduce the no. of function calls.
> Try to reduce No. of variables declared.
> Reduce no. of conditions. Ex. Set some flag to true for a condition use that flag instead of nested conditions.
> If you are using files try to have a clear of how data is and then either use a ordinary dataset or VSAM files depending on your requirement which increases the performance.
> Try to remove redundant function calls.
> If you have some complex calculation in common and initializing few varibles in common try to not keep them in loop unless until they are required and the value changes for each loop.

In DB2.
> Try to minimize the builtin function calls.
> Use Platinum Detector or Strobe Utilites for optimizing a query. (Provided you have them installed).
> In the where condition evaluate the columns having keys are indexes.
> If you are joining any tables in a query in the from clause have the first table declared which is having max. rows n second table with 2nd max. rows and so on.
> Try not to use Unions and inner selects unless until required.
> If a table is used in max. of the applications like a master table from which all the other applications are using them then replicate that table and move the primary key values into that table with curent timestamp as another column and use this table later on in your programs so that the load the master table will be reduced. This is entirely dependent on your requirement and also on the usage of that table.
> Use DB2 stored procedures instead of Remote Stored Procedures while using frontend screens like (Web or PB).


As far as I know it all depends on your program and the logic you are following.

In all the Programming Guide's for COBOL or PL/1 or any programming lang. provided in IBM manuals there will be a chapter on the Coding for better performance or Improving performance. You can refer those chapters.

Generally there will be 3 books provided in IBM Manuals for a particular language. They are

1. Language Reference (Which contains the syntax n builtin functions n variables)
2. Messages and Codes (Which contains the error codes and messages generated when a program fails or warning comes)
3. Programming Guide (Which talks about the compilers and the programming techinques to be followed.)

All opinions are welcome.
Back to top
View user's profile Send private message
mcmillan

Site Admin


Joined: 18 May 2003
Posts: 919
Location: India

PostPosted: Fri May 30, 2003 4:11 am    Post subject:
Reply with quote

Please consider this too...

Code:
1. Compile your programs with OPTIMIZE option.
2. Remove all Unnecessary Debugging facilities. It highly reduces CPU overhead.
3. Remove all your Subroutines with Nested Programs, if possible.
4. Make use of GLOBAL & EXTERNAL Variables, if necessary.
5. Suggest to develop everything in a TOP DOWN structured Strategy.
6. Avoid using Unnecessary STRING handling functions.
7. Use external FAST sort (JCL DFSORT under FASTSRT Compiler option) instead of COBOL sort.
8. Use INDEX variables / INDEX data items instead of Subscripts.
9. Encourage using REDEFINES and POINTER types.
10. Avoid unnecessary use of Sequence control verbs and DYNAMIC Calls.
11. Encourage using Computational usage clauses for Numeric data such as Counters, Icrementers, Loop variants.
12. Prefer CICS/FMS instead of COBOL/FMS.
13. Use CICS Pseudo Conversation if you have to receive a map.
14. Parallelize your code with SQL performance tuning Guidelines.
15. Prevent high data transfer by Initializing Default BMS fields (with FRSET & FSET)
16. Avoid using GO TOs.
17. Compile your programs to be REENTRANT, if it is shared by more than one user.
18. Compile your programs to be RESIDENT if you use Library routines.
19. Use Proper AMODE function. Don't misuse above line unnecessarily.
20. Use SSRANGE Compiler option or use NOSSRANGE Runtime option to avoid run time overhead.
21. delete unreferenced data items and the associated code to initialize their VALUE clauses.
22. Remove unnecessary branches
23. Avoid inefficient branches
24. Avoid the code for the out-of-line PERFORM statement, moving the performed paragraphs in-line,where possible
25. Avoid the code for a CALL to a contained (nested) program, moving the called statements in-line,where possible
26. Eliminate duplicate computations
27. Avoid constant computations
28. Aggregate moves of contiguous, equal-sized items into a single move
29. Delete unreachable code
30. Avoid using unnecessary MultiPage commands


Quote:
On the average, OPTIMIZE(STD) was 4% faster than NOOPTIMIZE, with a range of 17% faster to equivalent.
On the average, OPTIMIZE(FULL) was equivalent to OPTIMIZE(STD).
One RENT program calling a RENT subprogram with 500 unreferenced data items with VALUE clauses was 3% faster with OPTIMIZE(STD) and 5% faster with OPTIMIZE(FULL).
The same RENT program calling a RENT subprogram with 500 unreferenced data items with VALUE clauses using PROGRAM IS INITIAL was 6% faster with OPTIMIZE(STD) and 80% faster with OPTIMIZE(FULL).



For more info, please refer:
http://www.ibmmainframes.com/references/a7.html

Please specify your Environment (at least batch/online, which Database?).Which type of optimization you need? (SPEED OPT / STORAGE OPT). We can't help more until you specify the background!

Suggestions and corrections? welcome...
Back to top
View user's profile Send private message
Ravi

New User


Joined: 23 May 2003
Posts: 4
Location: Chennai

PostPosted: Mon Jun 02, 2003 12:10 pm    Post subject:
Reply with quote

This link might be just add on for how CPU utilization was reduced and which became a + point for a company.
http://www.tcs.com/0_case_studies/service_practices/atc_consumption_reduction.htm
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1