MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Strange SORT problem

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
lenovo
Beginner


Joined: 27 Nov 2008
Posts: 31
Topics: 9
Location: India

PostPosted: Wed Jan 18, 2012 10:14 am    Post subject: Strange SORT problem Reply with quote

Hi,
I have a strange SORT problem with the production jcl. A single dataset is being used by 3 different sort steps.
The sort criteria is similar in all the 3 steps. From the last the 3 or 4 days, the third step is failing with the
reason sort capacity exceeded and first 2 steps are fine. See below for the example

Code:

//STEP01  EXEC PGM=SORT,PARM='SIZE(MAX)'
//SORTIN    DD DSN=data set 1,DISP=OLD
//SORTOUT   DD DSN=output-1,DISP=SHR
//SORTWK01  DD UNIT=ALLOC,SPACE=(TRK,(100,10),RLSE)
//SORTWK02  DD UNIT=ALLOC,SPACE=(TRK,(100,10),RLSE)
//SYSOUT    DD SYSOUT=*
//SYSIN     DD *
  SORT FIELDS=(77,3,CH,A)
  INCLUDE COND=(77,3,CH,EQ,C'100',AND,76,1,CH,EQ,C'I')
/*

//STEP02  EXEC PGM=SORT,PARM='SIZE(MAX)'
//SORTIN    DD DSN=data set 1,DISP=OLD
//SORTOUT   DD DSN=output-2,DISP=SHR
//SORTWK01  DD UNIT=ALLOC,SPACE=(TRK,(100,10),RLSE)
//SORTWK02  DD UNIT=ALLOC,SPACE=(TRK,(100,10),RLSE)
//SYSOUT    DD SYSOUT=*
//SYSIN     DD *
  SORT FIELDS=(77,3,CH,A)
  INCLUDE COND=(77,3,CH,EQ,C'100',AND,76,1,CH,EQ,C'I')
/*

//STEP03  EXEC PGM=SORT,PARM='SIZE(MAX)'
//SORTIN    DD DSN=data set 1,DISP=OLD
//SORTOUT   DD DSN=output-3,DISP=SHR
//SORTWK01  DD UNIT=ALLOC,SPACE=(TRK,(100,10),RLSE)
//SORTWK02  DD UNIT=ALLOC,SPACE=(TRK,(100,10),RLSE)
//SYSOUT    DD SYSOUT=*
//SYSIN     DD *
  SORT FIELDS=(77,3,CH,A)
  INCLUDE COND=(77,3,CH,EQ,C'100',AND,76,1,CH,EQ,C'I')
/*

After fail, we increase the space for temporary sort dataset in the 3rd step and it works fine. Is this the problem with SORT space
or some storage issue?
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Wed Jan 18, 2012 11:13 am    Post subject: Reply with quote

Why on earth is that being not done as a single job step?
Back to top
View user's profile Send private message
lenovo
Beginner


Joined: 27 Nov 2008
Posts: 31
Topics: 9
Location: India

PostPosted: Wed Jan 18, 2012 11:26 am    Post subject: Reply with quote

I completely agree with you but thats an existing design. So i can't comment on that.
Back to top
View user's profile Send private message
seagull
Beginner


Joined: 13 Sep 2006
Posts: 5
Topics: 0

PostPosted: Wed Jan 18, 2012 12:21 pm    Post subject: Reply with quote

Where and how are output-1, output-2 and output-3 defined? Are they all defined with the same amount of space? Are they all being defined on the same disk pack, and then the first two take up all the available space before the third file is created?
_________________
"Programming today is a race between software engineers striving to build bigger and better idiot- proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Jan 18, 2012 12:29 pm    Post subject: Reply with quote

lenovo,

I would suggest to get rid of the 3 steps and code this single step
Code:

//STEP01    EXEC PGM=SORT
//SYSOUT    DD SYSOUT=*
//SORTIN    DD DSN=data set 1,DISP=OLD
//OUT1      DD DSN=output-1,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(CYL,(X,Y),RLSE)
//*
//OUT2      DD DSN=output-2,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(CYL,(X,Y),RLSE)
//*
//OUT3      DD DSN=output-3,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(CYL,(X,Y),RLSE)
//*
//SYSIN     DD *
  OPTION DYNALLOC=(SYSDA,16)
  INCLUDE COND=(77,3,CH,EQ,C'100',AND,76,1,CH,EQ,C'I')
  SORT FIELDS=(77,3,CH,A)
  OUTFIL FNAMES=(OUT1,OUT2,OUT3)
/*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Jan 18, 2012 12:39 pm    Post subject: Reply with quote

lenovo,

SORT CAPACITY EXCEEDED means you don't have enough work data set space. I'm guessing the reason for that is you allocated work data sets (//SORTWKdd DDs) in each step and that space is not being released between steps (regardless of the RLSE parameter). I suspect if you just removed the //SORTWKdd DD statements, DFSORT would work fine using dynamically allocated work data sets which it releases between steps.

We always recommend the use of dynamically allocated work data sets rather than JCL SORTWKdd DD statements. For more information, see:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA60/A.0?DT=20110608113434

And, of course, this could easily be done in one DFSORT step with OUTFIL statements - that would certainly require less work space. Are you not allowed to suggest a better way to do something? If you can make a change to the SPACE parameters and/or remove the //SORTWKdd DD statements, why can't you just change the job to a single step?
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Anuj Dhawan
Intermediate


Joined: 19 Jul 2007
Posts: 298
Topics: 7
Location: Mumbai,India

PostPosted: Thu Jan 19, 2012 4:29 am    Post subject: Reply with quote

Some how I believe that what you say here on this board, lenovo, about this probelm is your percption about the problem and not the actual thing becasue I've seen SORT CAPACITY EXCEEDED at times and that has a solution. Specially when you use DfSort and Kolusu and Frank are on this thread; said that - suggest you share the SYSOUT of failed job with us.
_________________
Regards,
Anuj
Back to top
View user's profile Send private message
lenovo
Beginner


Joined: 27 Nov 2008
Posts: 31
Topics: 9
Location: India

PostPosted: Mon Jan 23, 2012 10:40 am    Post subject: Reply with quote

Thanks all for the inputs. I have changed the job in one step.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group