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

Abend the job when trailer count is incorrect


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
esaccy
Currently Banned

New User


Joined: 19 Feb 2005
Posts: 22

PostPosted: Wed May 25, 2011 3:18 pm
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
TRAILER-ID X(8)
RECORD-COUNT X(15)
FILLER X(277)

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
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed May 25, 2011 3:30 pm
Reply with quote

Why can't you check the count where you are processing the file already? Seems odd to write bad data to a trailer and then abend in a different step because it is bad. Actually, it is more than odd.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


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

PostPosted: Wed May 25, 2011 3:45 pm
Reply with quote

Hello,
Quote:
Why can't you check the count where you are processing the file already?

once we had a similar scenario in which the counts on header were incorrect, the file was sent from another interfacing system.
Although it is a fault in the interfacing system end and was corrected, but still we needed a check at our system to make sure that the file was good.

@esaccy please show us some sample input records.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed May 25, 2011 3:51 pm
Reply with quote

Quote:
Hello,
Quote:
Why can't you check the count where you are processing the file already?

once we had a similar scenario in which the counts on header were incorrect, the file was sent from another interfacing system.
Although it is a fault in the interfacing system end and was corrected, but still we needed a check at our system to make sure that the file was good.

[...]


Fair point. Maybe I'm too blinkered this morning.

After what Frank said of you, you should update your profile maybe :-)

Also, if you want those guys who I know nothing about to go after that client of yours, don't let me know.
Back to top
View user's profile Send private message
Guest







PostPosted: Wed May 25, 2011 4:21 pm
Reply with quote

Hi,

Using this step you can set the RC of 12 if the trailer count is not matching:

Code:

//STEP010  EXEC PGM=ICETOOL                                         
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//IN       DD *                                                     
H                                                                   
A                                                                   
B                                                                   
5                                                                   
T000000003                                                           
/*                                                                   
//OUT1     DD DSN=intr.out.ABND,DISP=(NEW,CATLG,DELETE),           
//             RECFM=FB,DATACLAS=xxxx                                           
//TOOLIN   DD *                                                     
COPY FROM(IN) TO(OUT1) USING(CTL1)                                   
COUNT FROM(OUT1) EMPTY                                               
/*                                                                   
//CTL1CNTL DD *                                                     
 SORT FIELDS=COPY                                                   
 INREC IFTHEN=(WHEN=INIT,OVERLAY=(20:SEQNUM,9,ZD)),                 
       IFTHEN=(WHEN=(1,1,CH,EQ,C'T'),                               
       OVERLAY=(20:20,9,ZD,SUB,+2,ZD,LENGTH=9))                     
   OUTFILE FNAMES=OUT1,INCLUDE=(2,9,ZD,EQ,20,9,ZD,AND,1,1,CH,EQ,C'T')
/*                                                                   


You can modify the same according to your requirement.
Hope this helps.

Devil13
There is always a better solution.
Back to top
vasanthz

Global Moderator


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

PostPosted: Wed May 25, 2011 4:24 pm
Reply with quote

Quote:
Also, if you want those guys who I know nothing about to go after that client of yours, don't let me know.

It would be of immense help. Thanks Kill Bill AKA Colonel Jessep. icon_biggrin.gif
Back to top
View user's profile Send private message
esaccy
Currently Banned

New User


Joined: 19 Feb 2005
Posts: 22

PostPosted: Wed May 25, 2011 4:33 pm
Reply with quote

yes.

The file is being transmitted from bank sector side to the LPAR on insurance side and hence arises the need for checking the trailer record in insurance side

My i/p file is
Data Record Layout
Field Name DB2 Data Type & Length COBOL Data Type & Length Start Position End Position Length
AR-ID CHAR(22) X(22) 1 22 22
PRCS-DT DATE X(10) 23 32 10
EFF-DT DATE X(10) 33 42 10
END-DT DATE X(10) 43 52 10
PD-ID CHAR(13) X(13) 53 65 13
LST-TXN-DT DATE X(10) 66 75 10
CR-LN DECIMAL(13,2) S9(11)V99 76 82 7
HDYTD-NET-AMT-PRCH DECIMAL(13,2) S9(11)V99 83 89 7
LST-STMT-BAL DECIMAL(13,2) S9(11)V99 90 96 7
CR-LF-FL DECIMAL(1,0) S9 97 97 1
HD-PAY-HST CHAR(12) X(12) 98 109 12
FILLER 110 300 191
Total File Length 300
Trailer Record Layout
Field Name DB2 Data Type & Length COBOL Data Type & Length Start Position End Position Length
TRAILER-ID CHAR(8) X(8) 1 8 8
RECORD-COUNT CHAR(15) X(15) 9 23 15
FILLER CHAR X(277) 24 300 277
Total File Length 300
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed May 25, 2011 4:45 pm
Reply with quote

OK, sorry about that.

You want to check the count as quick as possible, OK.

Presumably you then su** this dataset into something which does updates. I'd strongly suggest you not forget to check the trailer count in there as well. There is no way to guarantee that your update job is reading the same file as the checker. So check in both places.

It would be nice if there was a file header with a business date on and a name for the file.

Again it would be nice if those were checked in the update job.

It would be nice if there were some control totals on the trailer.
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 May 25, 2011 7:44 pm
Reply with quote

I doubt you want the procedure to ABEND ! If you do, you better write some program to do that.

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

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu May 26, 2011 6:25 am
Reply with quote

Hi,

is there anyway of identifying the trailer record ?


Gerry
Back to top
View user's profile Send private message
esaccy
Currently Banned

New User


Joined: 19 Feb 2005
Posts: 22

PostPosted: Thu May 26, 2011 10:03 am
Reply with quote

There is no way of identifying the trailer record other than it is the last record

I am seeking the ICETOOL step itself for abend (am not sure about the feasibility.)
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu May 26, 2011 12:02 pm
Reply with quote

If you have something called "TRAILER-ID", why can't you identify the trailer except by it being the last record? OK, it is always nice (essential for me) to know that there are no records after the trailer, and only one trailer, but at the moment I'm just wondering why you can't identify it if you have an "ID".

Can you force ICETOOL to abend? I'd think so. Even if nothing is supplied for user-abends, just define as packed something you know will not be a valid packed format, and add something to it. Should make it go off BANG!
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu May 26, 2011 12:08 pm
Reply with quote

Hi,

see ibmmainframes.com/viewtopic.php?t=53749&highlight=debug+abend


Gerry
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 To get the count of rows for every 1 ... DB2 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts ISAM and abend S03B JCL & VSAM 10
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
Search our Forums:

Back to Top