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

Create header/trailer for empty file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sivasaras

New User


Joined: 29 Sep 2007
Posts: 93
Location: chenna/i-

PostPosted: Wed Jul 18, 2012 9:21 pm
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1787
Location: Bloomington, IL

PostPosted: Wed Jul 18, 2012 9:24 pm
Reply with quote

Meaningless and misleading title for a garbage post. After nearly five years you should know better.

Title tweaked.
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 Jul 18, 2012 9:27 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Wed Jul 18, 2012 9:32 pm
Reply with quote

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
View user's profile Send private message
sivasaras

New User


Joined: 29 Sep 2007
Posts: 93
Location: chenna/i-

PostPosted: Wed Jul 18, 2012 9:32 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Wed Jul 18, 2012 9:41 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Wed Jul 18, 2012 9:43 pm
Reply with quote

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
View user's profile Send private message
sivasaras

New User


Joined: 29 Sep 2007
Posts: 93
Location: chenna/i-

PostPosted: Wed Jul 18, 2012 9:54 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Wed Jul 18, 2012 9:57 pm
Reply with quote

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
View user's profile Send private message
sivasaras

New User


Joined: 29 Sep 2007
Posts: 93
Location: chenna/i-

PostPosted: Wed Jul 18, 2012 10:05 pm
Reply with quote

The below is the sample format of the file.

HEADER20120717'Accout number file'
A34524678
TRAILER20120717
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 Jul 18, 2012 10:18 pm
Reply with quote

What is the source of the date?

Is the text really mixed-case?

Not even a count on the trailer?
Back to top
View user's profile Send private message
sivasaras

New User


Joined: 29 Sep 2007
Posts: 93
Location: chenna/i-

PostPosted: Wed Jul 18, 2012 10:23 pm
Reply with quote

Yes the text is mixed case only.

HEADER20120717'Accout number file'
A34524678
TRAILER2012071700003
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 Jul 18, 2012 10:36 pm
Reply with quote

And the source of the date, at least?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6248
Location: Mumbai, India

PostPosted: Thu Jul 19, 2012 12:57 pm
Reply with quote

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
View user's profile Send private message
knickraj
Warnings : 1

New User


Joined: 11 Jun 2007
Posts: 50
Location: Euro

PostPosted: Thu Jul 19, 2012 7:45 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Thu Jul 19, 2012 7:56 pm
Reply with quote

knickraj,

TS already knows when they have an incomplete file (FTP failure) so this is not necessary.
Back to top
View user's profile Send private message
knickraj
Warnings : 1

New User


Joined: 11 Jun 2007
Posts: 50
Location: Euro

PostPosted: Thu Jul 19, 2012 8:50 pm
Reply with quote

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
View user's profile Send private message
knickraj
Warnings : 1

New User


Joined: 11 Jun 2007
Posts: 50
Location: Euro

PostPosted: Thu Jul 19, 2012 11:29 pm
Reply with quote

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
View user's profile Send private message
Peter Nancollis

New User


Joined: 15 Mar 2011
Posts: 47
Location: UK

PostPosted: Sat Jul 21, 2012 4:00 am
Reply with quote

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
View user's profile Send private message
sivasaras

New User


Joined: 29 Sep 2007
Posts: 93
Location: chenna/i-

PostPosted: Tue Jul 24, 2012 10:09 pm
Reply with quote

Hi,

Thanks for all the replies.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 4
No new posts SORT on detail record, then repeat he... DFSORT/ICETOOL 3
No new posts how to eliminate null indicator value... DB2 7
No new posts How can I add/create a new INIT(initi... TSO/ISPF 2
No new posts Reading Empty Dataset DFSORT/ICETOOL 5
Search our Forums:

Back to Top