Saturday, March 30, 2013

Performance tuning points for Mainframe applications

May be as they worry the Moores law have saturated, May be the chips used to get smarter at a better rate. 

The more fancy and much demanded work at many instances these days as I see is to scale up the business critical software applications. The resource rich legacy Mainframe applications which rarely worry about the performance also appears to be shifting focus towards this front.

Below is the list of usual tactics to attack the mainframe performance problems - Am going to try and keep this unsorted by any order list updated as when there is a new entrant I learn about.

JCL Techniques

1) The buf no which is signifies the buffers used to read is installation specific and is usually defined one or two - Override this to of more value like 20 to 50. 
[DCB=BUFNO=50 ] - Should be done with carefull because over allocating buffers is as bad as not allocating. 
2) If feasible migrate away from tape - this doesnt improve considerably at many instances due to the advancements in the tapes storage managements - but I think it is worth verifying this dimension.
3) Shift the region size and time parameters from step level to the job level if possible.
4) Try allocating sortwork files when dealing with sort.
5) Reasonable amount of secondary space to the data sets.
6) Scratch with IDCAMS rather than IEFBR14.
7) Replace IEBGENERS with DFsort/Syncsort to copy. IEBGENER is simply old timer and these sort utilities are optimized to the max level possible. 

Cobol Techniques

1) Verify for too many open and close of the files. Open once and close as minimal as possible. 
2) Initialize copybooks - This is a killer- Its safe not to initialize entire copybooks because it creates too many assembly statements. Try moving than initializing. 
3) Compiler options - SSRANGE consumes lot - If possible override and use NOSSRANGE
4) Whenever possible try to exploit the utilities like DFsort/Easytrieve/SAS available for sorting/joining/Reformatting/reporting instead of homegrown cobol elements. They are tested and proven for performance. 
5) Cobol Sorts ? Inefficient sorting method.
6) Binary search - Search all is preferred over search. 
7) Make it like block contains 0 records on FD
8) Using NoDYNAM
9) Using Indexes over subscripts 
10) Occurs depending is another thing that can be eliminated to miprove a bit 

DB2 Techniques 

1)  Table scan usage prohibits the usage of the indexes, and also not using all the cols indexed in case of composite index would also not make use of the index - So Dummy or force use all the cols that are indexed. Make the query use index. 
2)  Many a times the SQL query in a element as such wouldn't consume more resources but the too many execution of that query would be a killer for performance and would create hot spots  Try caching the results in a cobol table. 
3) Avoid session tables - Instead go for the declared temporary tables. 
4) Try and Reduce the level of queries 
5)  If possible try to take away the exist clause in the query into a separate query. 
6) Multi row fetch 
7) Use of optimize for n rows or fetch first 
8) Of course - Introduce indexes on frequently used cols. 

Indeed Last but not the least - Its good to verify the job scheduling timings and strategies such that when the job gets active it gets all it want and doesn't wait for something midway of their execution. 

Of course not this list neither any list on this topic could be finite to list all of the options and there is always one more interesting way. 

Tuesday, February 05, 2013

Why Weekdays are named so ?

I kind of instructed myself not to write something online which wouldn't be useful to read for someone else, To satisfy that - I made it a point that I should write only the solutions to interesting problems. 

But I am choosing to bend the rule which I set to myself, which is just sticking to interesting and so a post need not be necessarily a solution to a problem but an identification or a collection or perspectives or their combinations at times - should be fine too. This is primarily because I probably not finding enough or searching enough interesting problems, and urge to say something I see interesting to other is very tempting. 

This is one such, definitely not useful,definitely not a solution but because I thought - hey this is interesting I should probably tell it to others.

Getting to the point at last - whats behind the names of weekdays ? In other words Etymology of weekdays 
Sunday - Pretty easy it is suns day. an awesome day definitely.What it reminds is church and holiness
Monday - Moon's day - Interesting. Probably those days every one liked what they did on monday unlike the current scenario - so they appear to have the day named after something cool like moon. 
Tuesday - Pro- Germanic god - Tîwaz who Considered to be god of war , law, Justice or in many other languages - Mars the god of war.Ares is another name. The man day. 
 Wednesday - Basically named after planet, Mercury - Ask me what is the relation here ? Woden or Odin is none but a gods name who is represented as Mercury.
Thursday - Purely Thor's day. That god with the hammer, Its after him. Where is the planet you ask - Am not very sure - some say he is the owner or resident or both of Jupiter
Friday - very aptly named day - the meaning is intact and is very visible - The awesome day - The frigg - the Venus - The goddess of love & beauty- She they say spins cloud. The Girl day.
Saturday - The Saturn's day, the planet with the ring. Saturn is considered to be god for agriculture, wealth and liberation. 
This kind of convention or pattern of naming days after a god who is represented as a planet seems to be in practice very wide i.e - Almost in every language.So if you kind of know all the famous planets name in a language - you have a better chance of deriving weekdays in that same language or intrestingly vice versa.

Interesting you say ? I say - I know I know 

Hmm, Boring you say? I wasted your time ? Sorry not intended! 

See you or myself or both in the next post. ;-)

Update 12/11:
Tangentially to this line of thought - weekdays have not always been 7 days long, and I read something very interesting on Quora about calendars - would like to link to it for further reading Click here