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
 

 

Create header/trailer for empty file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sivasaras

New User


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

PostPosted: Wed Jul 18, 2012 9:21 pm    Post subject: Create header/trailer for empty file
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: 1738
Location: Bloomington, IL

PostPosted: Wed Jul 18, 2012 9:24 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Wed Jul 18, 2012 9:27 pm    Post subject: Reply to: Need information about SORT
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

Site Director


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

PostPosted: Wed Jul 18, 2012 9:32 pm    Post subject:
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: 90
Location: chenna/i-

PostPosted: Wed Jul 18, 2012 9:32 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Wed Jul 18, 2012 9:41 pm    Post subject: Reply to: Need information about SORT
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

Site Director


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

PostPosted: Wed Jul 18, 2012 9:43 pm    Post subject:
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: 90
Location: chenna/i-

PostPosted: Wed Jul 18, 2012 9:54 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Wed Jul 18, 2012 9:57 pm    Post subject: Reply to: Need information about SORT
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: 90
Location: chenna/i-

PostPosted: Wed Jul 18, 2012 10:05 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Wed Jul 18, 2012 10:18 pm    Post subject: Reply to: Need information about SORT
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: 90
Location: chenna/i-

PostPosted: Wed Jul 18, 2012 10:23 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Wed Jul 18, 2012 10:36 pm    Post subject: Reply to: Need information about SORT
Reply with quote

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

Senior Member


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

PostPosted: Thu Jul 19, 2012 12:57 pm    Post subject: Re: Create header/trailer for empty file
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Thu Jul 19, 2012 7:56 pm    Post subject: Reply to: Create header/trailer for empty file
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    Post subject:
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    Post subject: Reply to: Create header/trailer for empty file
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    Post subject:
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: 90
Location: chenna/i-

PostPosted: Tue Jul 24, 2012 10:09 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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