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 the job when trailer count is incorrect

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    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
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Wed May 25, 2011 3:30 pm    Post subject: Reply to: Abend the job when trailer count is incorrect
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: 1445
Location: Azeroth

PostPosted: Wed May 25, 2011 3:45 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Wed May 25, 2011 3:51 pm    Post subject:
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    Post subject:
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: 1445
Location: Azeroth

PostPosted: Wed May 25, 2011 4:24 pm    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Wed May 25, 2011 4:45 pm    Post subject: Reply to: Abend the job when trailer count is incorrect
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

Active Member


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

PostPosted: Wed May 25, 2011 7:44 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Thu May 26, 2011 6:25 am    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Thu May 26, 2011 12:02 pm    Post subject:
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: 1703
Location: Australia

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

Hi,

see http://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    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 IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts hot to get details when "EXEC CI... Andi1982 CICS 11 Tue Sep 20, 2016 5:01 pm


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