Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

ABEND A JOB USING SORT.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: ABEND A JOB USING SORT.
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

Active Member


Joined: 08 May 2006
Posts: 995
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Mar 09, 2011 1:43 pm    Post subject:
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: 1504
Location: Chennai

PostPosted: Wed Mar 09, 2011 2:15 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Wed Mar 09, 2011 4:32 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us