View previous topic :: View next topic
|
Author |
Message |
sivasaras
New User
Joined: 29 Sep 2007 Posts: 93 Location: chenna/i-
|
|
|
|
Hi,
The job which is abending daily due to the file which is not having the trailer record or header record in the file.
Iam getting 46 different files like these but only 2 files which are getting abended with missing header records.
i need to fix this abend via job or through program.
my thinking is the file don't have trailer or header mark it as empty and process in the job with empty files.
kindly guide me how can i fix this issue through jcl.
Thanks
Siva |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
Meaningless and misleading title for a garbage post. After nearly five years you should know better.
Title tweaked. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
If a job is abending because there is no header or no trailer on a file, the best thing to do is find the bug which is causing that to happen and fix it. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Someone needs to correct the files before they are "sent" to your process.
There is no way this should have gone into production until the file creation was correct for all of the "senders".
Why do you believe this is either a sort or JCL problem. . . It is neither.
Why is there an abend? The code should be able to detect invalid files/data and deal with it. |
|
Back to top |
|
|
sivasaras
New User
Joined: 29 Sep 2007 Posts: 93 Location: chenna/i-
|
|
|
|
Here the problem is the data which is receiving in this file is through FTP.
if the ftp connection failed it is not loaded with trailer.
So when the job start running say tommorow it is getting abended. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You mean if the FTP fails you have a partial file, or that you run with an empty file?
If you need an "empty" file, you need something which is run specifically only when the transfer fails. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Then someone needs to stabilize your environment. We do several hundred ftp processes (both send and receive) every day and do not have ftp connecton failures. . . |
|
Back to top |
|
|
sivasaras
New User
Joined: 29 Sep 2007 Posts: 93 Location: chenna/i-
|
|
|
|
we will be receiving the partial file only and because of this the job got abended without processing the remaining files.
so i thought if a file has missing trailer or header record i will empty the records and process as a empty file for today run.
so next day the missed data wil be processed. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
So, whilst trying to get the FTP more stable, you need a job which only runs when the FTP fails, and which puts header/trailer indicating "empty" file.
What do your header and trailers look like? What are the sources of the data on the header trailer?
Which sort product do you use? |
|
Back to top |
|
|
sivasaras
New User
Joined: 29 Sep 2007 Posts: 93 Location: chenna/i-
|
|
|
|
The below is the sample format of the file.
HEADER20120717'Accout number file'
A34524678
TRAILER20120717 |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
What is the source of the date?
Is the text really mixed-case?
Not even a count on the trailer? |
|
Back to top |
|
|
sivasaras
New User
Joined: 29 Sep 2007 Posts: 93 Location: chenna/i-
|
|
|
|
Yes the text is mixed case only.
HEADER20120717'Accout number file'
A34524678
TRAILER2012071700003 |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
And the source of the date, at least? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
sivasaras wrote: |
my thinking is the file don't have trailer or header mark it as empty and process in the job with empty files. |
In other words if the file has the header/trialer, it's being process correctly in some-program,Yes, - why not modify that program to handle the absence of header/trailer? |
|
Back to top |
|
|
knickraj Warnings : 1 New User
Joined: 11 Jun 2007 Posts: 50 Location: Euro
|
|
|
|
Using icetool...May be as a fix you may add a new step in the abending jcl to detect missing header/trailer a step as below, it would return RC12 for missing
header/trailer and you may use this rc to handle your abend : skip the abending step or write missing header or trailer etc...
Code: |
// EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//INFILE DD *
HEADER
TRAILER
//TOOLIN DD *
COUNT FROM(INFILE) NOTEQUAL(2) USING(CTL1)
/*
//CTL1CNTL DD *
INCLUDE COND=(1,6,CH,EQ,C'HEADER',OR,1,7,CH,EQ,C'TRAILER') |
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
knickraj,
TS already knows when they have an incomplete file (FTP failure) so this is not necessary. |
|
Back to top |
|
|
knickraj Warnings : 1 New User
Joined: 11 Jun 2007 Posts: 50 Location: Euro
|
|
|
|
bill,
just assuming, if the sender of the file has not put header/ trailer ,FTP works OK, as code does not handle file without header/trailer. |
|
Back to top |
|
|
knickraj Warnings : 1 New User
Joined: 11 Jun 2007 Posts: 50 Location: Euro
|
|
|
|
also this one can be tried
Code: |
// EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
HEADER
DATA
DATA
TRAILER
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,
OMIT=(1,6,CH,EQ,C'HEADER',OR,1,7,CH,EQ,C'TRAILER'),
HEADER1=('H'),
TRAILER1=('T') |
|
|
Back to top |
|
|
Peter Nancollis
New User
Joined: 15 Mar 2011 Posts: 47 Location: UK
|
|
|
|
Sorry to be late on this - and maybe a bit dim but...
If the proggie expects a header and a trailer and if they arent there or are incorrect [rec counts , hash etc. ] it's 0A0D ..isnt that working as [well] designed ?
If either are missing or wrong surely it's courageous to continue?
Processing an empty file to keep the schedule running *may* be an acceptable option but isnt a wider view of the system necessary to say if this is valid reason to force jobs through?
For me if the designer was concerned enough to think there was a need for Header/Trailers ... there was probably also a need to not process incomplete files and/or a dependency on update sequence .... but without knowing my guess is as good/bad as everyone elses
[a good/complete ftp doesnt necessarily mean everything that should have been sent has been - ie the remote file building process may have failed or been forced - Hs & Ts do !] |
|
Back to top |
|
|
sivasaras
New User
Joined: 29 Sep 2007 Posts: 93 Location: chenna/i-
|
|
|
|
Hi,
Thanks for all the replies. |
|
Back to top |
|
|
|