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 

Abend the job when trailer count is incorrect

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


Joined: 26 May 2011
Posts: 7
Topics: 4

PostPosted: Tue May 31, 2011 2:59 am    Post subject: Abend the job when trailer count is incorrect Reply with quote

Hi
My job is having 3 steps.


My input file is of FB type and (LRECL=300)having detail records and trailer record

Trailer record is like this
Code:

TRAILER-ID X(7)
RECORD-COUNT X(15)
FILLER X(278)

In the first step,
i want to abend the job if the RECORD-COUNT in trailer record is not correct(i.e not matching to the total no of detail records)
Note:- RECORD-COUNT is the number of detail records only(not the trailer record)

Please help me how to achieve this Using ICETOOL ?
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue May 31, 2011 5:40 am    Post subject: Reply with quote

are you sure you want to abend the job?

will not a non-zero return-code function?

abends (real abends, not miss-used terminology)
take up a lot of resources,
that could otherwise be dedicated to processing.
_________________
Dick Brenholtz
American living in Varel, Germany
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: Tue May 31, 2011 10:39 am    Post subject: Reply with quote

esaccy,

Use the following DFSORT JCL which will give you the desired results. I assumed that the count on the trailer record includes the trailer record itself. If not then change the inrec statement to INREC OVERLAY=(301:SEQNUM,15,ZD,START=0)

Code:

//STEP0100 EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD *                                               
A                                                             
B                                                             
C                                                             
D                                                             
TRAILER              6                                       
//SORTOUT  DD SYSOUT=*                                       
//SYSIN    DD *                                               
  OPTION COPY                                                 
  DEBUG ABEND                                                 
  INREC OVERLAY=(301:SEQNUM,15,ZD)                           
  OUTFIL NULLOFL=RC16,                                       
  INCLUDE=(1,7,CH,EQ,C'TRAILER',AND,(8,15,UFF,EQ,301,15,UFF))
//*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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