Performance Tuning

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
shashi_IT
Member
Posts: 2
Joined: Tue Oct 15, 2013 12:08 pm

Performance Tuning

Post by shashi_IT » Tue Oct 15, 2013 12:24 pm

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

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Tue Oct 15, 2013 1:18 pm

Write a prigram to take the keys and extract the data using the key.

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.

shashi_IT
Member
Posts: 2
Joined: Tue Oct 15, 2013 12:08 pm

Post by shashi_IT » Wed Oct 16, 2013 10:13 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.

User avatar
Gurugars
Active Member
Posts: 107
Joined: Sat Oct 23, 2010 2:17 pm
Location: Chennai,India.

Post by Gurugars » Wed Oct 16, 2013 11:12 am

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.
Guru:-)

You're never fully dressed without a smile :)

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Wed Oct 16, 2013 11:47 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.
Last edited by William Collins on Wed Oct 16, 2013 5:55 pm, edited 1 time in total.

User avatar
Gurugars
Active Member
Posts: 107
Joined: Sat Oct 23, 2010 2:17 pm
Location: Chennai,India.

Post by Gurugars » Wed Oct 16, 2013 4:46 pm

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.
Guru:-)

You're never fully dressed without a smile :)

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Wed Oct 16, 2013 5:58 pm

The link is for a sequential pass of a VSAM file. You'd need a keyed READ, and if multiple records of the same key, a START and GET until the key is different from that requested.

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Wed Oct 16, 2013 9:50 pm

Easytrieve, COBOL, or SORT would pass all 56M records unless a keyed read is done . . .
Have a good one

User avatar
Gurugars
Active Member
Posts: 107
Joined: Sat Oct 23, 2010 2:17 pm
Location: Chennai,India.

Post by Gurugars » Thu Oct 17, 2013 10:32 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.
Guru:-)

You're never fully dressed without a smile :)

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Thu Oct 17, 2013 1:04 pm

You are free to believe what you like, no need to apologise.

You need to look in your Easytrieve Plus manual and see what GET does. Then see what READ does... have al look at all theI/O in fact.

academyindia4

Topic deleted by Admin

Post by academyindia4 » Mon Jan 25, 2016 9:44 pm

<< Content deleted By Admin >>

Post Reply

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



Other References
Mainframe Tools and others