IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

ABEND A JOB USING SORT.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Kumaresan.nk

New User


Joined: 22 Mar 2010
Posts: 31
Location: Chennai

PostPosted: Wed Mar 09, 2011 12:09 pm
Reply with quote

Hi,

I'm taking the count of records which have a field set as 'Y' in my input dataset. Is it possible to abend the job when the count drops below a certain number say 1500. Is it possible to do it in SORT ?
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Wed Mar 09, 2011 1:43 pm
Reply with quote

It's possible to set a condition code using DFSORT in such circumstances. I doubt very much that you want to ABEND.

Garry.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Mar 09, 2011 2:15 pm
Reply with quote

Hi,

As Garry mentioned you could make DFSORT to set RC like below,

Code:
//JS020    EXEC PGM=ICETOOL                       
//TOOLMSG  DD SYSOUT=*                             
//DFSMSG   DD SYSOUT=*                             
//SORTIN   DD DISP=SHR,DSN=WELLS.SORTIN                 
//SYSOUT   DD SYSOUT=*                             
//TOOLIN   DD *                                   
    COUNT FROM(SORTIN) LOWER(1500) RC4             
/*                                                                                         
//SYSUDUMP DD SYSOUT=*                             
/*   


step returns RC of 4 if record count is less than 1500.

Hope it helps.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Mar 09, 2011 4:32 pm
Reply with quote

Hi,

here is a way to set an abend, you may need to adjust the position of "Y"
Code:
//STEP0001 EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DSN=input-file                                           
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                       
  DEBUG ABEND                                                         
  SORT FIELDS=COPY                                                     
  INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'Y'),OVERLAY=(081:SEQNUM,8,ZD))       
  OUTFIL INCLUDE=(81,8,ZD,EQ,1500),NULLOFL=RC16                       
/*                                                                     


Gerry
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Mar 09, 2011 10:46 pm
Reply with quote

Kumaresan.nk,

The following DFSORT JCL will abend when the number of 'y' in position are less than 5. A slight modification from gcicchet's post with INCLUDE COND to reduce the overhead of reading all records.

Code:

//STEP0100 EXEC PGM=SORT                     
//SYSOUT   DD SYSOUT=*                       
//SORTIN   DD *                               
A                                             
A                                             
Y                                             
A                                             
Y                                             
A                                             
Y                                             
A                                             
//SORTOUT  DD SYSOUT=*                       
//SYSIN    DD *                               
  DEBUG ABEND                                 
  SORT FIELDS=COPY                           
  INCLUDE COND=(1,1,CH,EQ,C'Y')               
  INREC BUILD=(SEQNUM,4,ZD)                   
  OUTFIL INCLUDE=(1,4,ZD,EQ,5),NULLOFL=RC16   
//*
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts ISAM and abend S03B JCL & VSAM 10
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top