View previous topic :: View next topic
|
Author |
Message |
esaccy Currently Banned New User
Joined: 19 Feb 2005 Posts: 22
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Guest
|
|
|
|
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
|
|
|
|
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. |
|
Back to top |
|
|
esaccy Currently Banned New User
Joined: 19 Feb 2005 Posts: 22
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
I doubt you want the procedure to ABEND ! If you do, you better write some program to do that.
Garry. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
is there anyway of identifying the trailer record ?
Gerry |
|
Back to top |
|
|
esaccy Currently Banned New User
Joined: 19 Feb 2005 Posts: 22
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
Back to top |
|
|
|