|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
File output with headers in append mode |
« View previous topic :: View next topic » |
Author |
Message
|
kash3338 |
Posted: Thu Apr 02, 2015 7:32 am Post subject: File output with headers in append mode |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
Hi,
I am writing to a file using FIleoutput node and the mode of writing set as "Write directly to out file (append if file exists)". The file gets picked by a schedule job and everytime the file is picked, a new file is created and records are appended to it.
I need to set a File Header for the output file. how do i do it? It needs to be set only once per file and only when the file is created for first time. How can this be acheived using the file out node? I am running on IIB v9.0, AIX server. |
|
Back to top |
|
 |
nelson |
Posted: Thu Apr 02, 2015 9:46 am Post subject: Re: File output with headers in append mode |
|
|
 Partisan
Joined: 02 Oct 2012 Posts: 313
|
kash3338 wrote: |
Hi,
I am writing to a file using FIleoutput node and the mode of writing set as "Write directly to out file (append if file exists)". The file gets picked by a schedule job and everytime the file is picked, a new file is created and records are appended to it.
I need to set a File Header for the output file. how do i do it? It needs to be set only once per file and only when the file is created for first time. How can this be acheived using the file out node? I am running on IIB v9.0, AIX server. |
Who creates this new file for the first time? I'm thinking the way to achieve this is to send the header (the first incoming message of FileOutput node).
I'm a little confused... when the file is picked by a job, a new file is created and records are appended to it? if the header already exists, you shouldn't be worry to write a header again..
Please correct me if I misunderstood your problem.. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Apr 02, 2015 9:55 am Post subject: Re: File output with headers in append mode |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
nelson wrote: |
I'm a little confused... when the file is picked by a job, a new file is created and records are appended to it? if the header already exists, you shouldn't be worry to write a header again..
Please correct me if I misunderstood your problem.. |
If I'm reading this correctly, the file is built up by appended records from inbound MQ messages / web service calls / psychic force. On a schedule, the file with all the appended records to date is picked up and moved / deleted to prevent duplicates in whatever's processing the file. Once this happens, the next record being appended needs a header in the file first.
Is this an accurate description of the requirement?
If it is, I'd have the scheduled job not only pick up the file but create a new one, either by moving and renaming a blank template file with only a header in it or by actually writing it. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
nelson |
Posted: Thu Apr 02, 2015 10:10 am Post subject: Re: File output with headers in append mode |
|
|
 Partisan
Joined: 02 Oct 2012 Posts: 313
|
Vitor wrote: |
If it is, I'd have the scheduled job not only pick up the file but create a new one, either by moving and renaming a blank template file with only a header in it or by actually writing it. |
My fault, misunderstood the problem... In fact, if it is a continuous flow and not a batch process, Vitor advice looks pretty simple to implement. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|