Performance Tuning
Moderators: Frank Yaeger, Moderator Group
Performance Tuning
Hello Everyone,
I am trying to fetch few records based on the account as key from Input KSDS VSAM file into flat file.Count in input VSAM file is nearly 56 Millions. I want to reduce the CPU time and Elapse time for this sort.
Current CPU time : 2.50, Elapse time : 22.64
Step from JCL : STEP016 EXEC PGM=SORT,PARM='MINCORE=512K'
Sort card : SORT FIELDS=COPY
INCLUDE COND=(1,1,BI,NE,1,1,BI,OR,
5,11,CH,EQ,C'account1',OR,
5,11,CH,EQ,C'account2',OR,
.
.
.
5,11,CH,EQ,C'account54',OR,
1,1,BI,NE,1,1,BI)
Any help will be greatly appreciated.Thanks
I am trying to fetch few records based on the account as key from Input KSDS VSAM file into flat file.Count in input VSAM file is nearly 56 Millions. I want to reduce the CPU time and Elapse time for this sort.
Current CPU time : 2.50, Elapse time : 22.64
Step from JCL : STEP016 EXEC PGM=SORT,PARM='MINCORE=512K'
Sort card : SORT FIELDS=COPY
INCLUDE COND=(1,1,BI,NE,1,1,BI,OR,
5,11,CH,EQ,C'account1',OR,
5,11,CH,EQ,C'account2',OR,
.
.
.
5,11,CH,EQ,C'account54',OR,
1,1,BI,NE,1,1,BI)
Any help will be greatly appreciated.Thanks
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
Thanks William for your reply.
We want it should be done thru jcl sort not thru cobol sort.
(your comment) -->The problem with the SORT is that it will read the 56M records, even if you've extracted all your accounts after 1,000 records.
Ans : My account contain like 'Z%' ,so it has to read the whole file and extract the expected result from input file.
Kindly reply fast .Thank you.
We want it should be done thru jcl sort not thru cobol sort.
(your comment) -->The problem with the SORT is that it will read the 56M records, even if you've extracted all your accounts after 1,000 records.
Ans : My account contain like 'Z%' ,so it has to read the whole file and extract the expected result from input file.
Kindly reply fast .Thank you.
All your OR conditions would be applied against each of 56M records that may be the reason it is taking time.
Do you have any condition that can be put as AND against all these OR conditions.? - If so include that first.
i.e., as you said your account numbers would be like 'Z%' from this are all your account numbers starting with 'Z'?
Also keep the most possible condition first in the COND.
Giving more clarity on the input and output file condition would be much helpful to give you some suggetsions.
Do you have any condition that can be put as AND against all these OR conditions.? - If so include that first.
i.e., as you said your account numbers would be like 'Z%' from this are all your account numbers starting with 'Z'?
Also keep the most possible condition first in the COND.
Giving more clarity on the input and output file condition would be much helpful to give you some suggetsions.
Guru:-)
You're never fully dressed without a smile
You're never fully dressed without a smile
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
I'm not suggesting "cobol sort", I'm suggesting a program in a language which can do keyed reads on a KSDS.
For the quantify of account numbers you could physically get on an INCLUDE statement, it is going to be much more efficient to do keyed reads.
You are not sorting the data, All you are doing is including data for the account numbers you want.
You could get rid of the first and last OR, which are from somethng which genrated your INCLUDE. That would help a very litle, but nowhere near as much as the keyed reads would.
For the quantify of account numbers you could physically get on an INCLUDE statement, it is going to be much more efficient to do keyed reads.
You are not sorting the data, All you are doing is including data for the account numbers you want.
You could get rid of the first and last OR, which are from somethng which genrated your INCLUDE. That would help a very litle, but nowhere near as much as the keyed reads would.
Last edited by William Collins on Wed Oct 16, 2013 5:55 pm, edited 1 time in total.
Then, what about doing this in Easytrieve.? You can read (or) search the file based on key.
Sample easytrieve code if you are not familiar with it -
http://code.xmlgadgets.com/2010/08/27/r ... asytrieve/
PS - Sorry, moderators can remove the link if it is violating the forum's rule in anyways.
Sample easytrieve code if you are not familiar with it -
http://code.xmlgadgets.com/2010/08/27/r ... asytrieve/
PS - Sorry, moderators can remove the link if it is violating the forum's rule in anyways.
Guru:-)
You're never fully dressed without a smile
You're never fully dressed without a smile
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
William -
Sorry, But I believe the example provided in the link is a KEY'ed read. This is how a KSDS random read will happen in Easytrieve. EOF mentioned in the program is for FILE1, that might have confused you. Please correct me if I am wrong.
Sorry, currently I left without mainframe machine, else I would have tested the code and confirmed the same.
Sorry, But I believe the example provided in the link is a KEY'ed read. This is how a KSDS random read will happen in Easytrieve. EOF mentioned in the program is for FILE1, that might have confused you. Please correct me if I am wrong.
Sorry, currently I left without mainframe machine, else I would have tested the code and confirmed the same.
Guru:-)
You're never fully dressed without a smile
You're never fully dressed without a smile
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page