Joined: 25 Apr 2007 Posts: 44 Location: chennai, India
Hi
I have a file of FB80, which will contain 3 different type of records. sampe of file is given below
HEADER
DATA
DATA
DATA
DATA
TRAILER00401012008
the requirement is i have to count the No. of data records and match it with the count in the trailer record, if they are not equal, i have to force a different return code. for Eg. in above sample there are 4 data records and in trailer also there value is 4 (positoin 8 - 11).
Joined: 25 Apr 2007 Posts: 44 Location: chennai, India
hi
After this post, i have tried myself and found a way to do this. just thought of sharing this with you all. But i am sure that this is a round about way for this requirement. there should be some easy way for this requirement.
Just curious... after having determined that the count is wrong,
is somebody going to fix the program/application which generates the erroneous input dataset
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
Either everything will stop until the PROCESS AUDIT COMMITTEE meets and decides what to do or someone will edit the file and change the count then rerun the job.
Joined: 25 Apr 2007 Posts: 44 Location: chennai, India
Hi Skolusu
i have tried this jcl, but it has given me RC=0. i have used the same jcl and the data which you have used. as per the input i have to get RC=4. i have posted the sysout messages below.
OUTFIL NULLOFL=RC4,
INCLUDE=(1,7,CH,EQ,C'TRAILER',AND,08,4,ZD,EQ,81,4,ZD)
WER276B SYSDIAG= 4059, 3891646, 3891646, 4608258
WER164B 8,944K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 3,125,192 BYTES USED
WER146B 20K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER237I OUTREC RECORD LENGTH = 84
WER110I SORTOUT : RECFM=FB ; LRECL= 84; BLKSIZE= 84
WER405I SORTOUT : DATA RECORDS OUT 0; TOTAL RECORDS OUT 0
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER416B BSAM WAS USED FOR SORTIN
WER416B OUTFIL WAS USED FOR SORTOUT
WER054I RCD IN 7, OUT 7
Joined: 25 Apr 2007 Posts: 44 Location: chennai, India
Hi enrico sorichetti
Here is the real situation. There is a job which runs for nearly an hour daily. the input file will contain more than 45 lakh records. if in case the job abends, (let us assume it has abended in record 123456) people will take a backup of input file, delete the contents from record 2 to 123456 and then rerun the job. few are forgetting one important thing, that accordingly they have to change the record count in trailer record.
The program is coded in such a way that, after all processing gets complete and when it reaches the trailer record, it checks for record count and if there is a mismatch, it forces an abend again.
we are trying to introduce this sort step, prior of the execution of program, so that this can be prevented, and if in case they miss to update the trailer record, it can be found immediately.
The process is flawed, anyway that' s Your shop, not mine
for what reason when recreating the input file they just don' t write
the copy with the proper parameters to provide a good trailing count...
You are using syncsort to check, why not use it to build the proper input to start with???
the procedure is prone to errors anyway, it relies on people skipping the right number of records
and furthermore for what reason the procedure keep abending,
wouldn' t it be more productive to setup the proper validation procedures to fix things before they happen ??
it' s always a bad practice to have operations fiddle around with application data
looks like there is a zero security approach there