[Fwd: Fixed Length Export with append (-X -A)]
GCC Consulting
gccconsulting at comcast.net
Mon Feb 19 10:36:45 PST 2007
> -----Original Message-----
> From:
> filepro-list-bounces+gccconsulting=comcast.net at lists.celestial
> .com
> [mailto:filepro-list-bounces+gccconsulting=comcast.net at lists.c
> elestial.com] On Behalf Of J. Ryan Kelley
> Sent: Monday, February 19, 2007 1:09 PM
> To: filepro-list at lists.celestial.com
> Subject: [Fwd: Fixed Length Export with append (-X -A)]
>
>
>
> -------- Original Message --------
> Subject: Fixed Length Export with append (-X -A)
> Date: Mon, 19 Feb 2007 10:05:32 -0500
> From: J. Ryan Kelley <ryan.kelley at trinitytransport.com>
> To: fplist <filepro-list-bounces at lists.celestial.com>
>
>
>
> Good Morning,
>
> I'm trying to generate an export file to automate ACH
> deposits with our bank. The process requires me to go
> through several dozen records, and generate a fixed length
> output. Everything seems to work well as I debug through the
> code and the file continuously gets longer without any
> issues. Then, at the very end of the file I need to send the
> totals for the transaction to ensure the file hasn't been
> corrupted. I do this in @done processing (since there is no
> output format so @wgt didn't make sense to use) by returning
> to my gosub that performs the export command and trying to
> export more fields. This always results in the complete
> overwriting of the file with simply the footer information.
> I've tried to use the -X and -A flags in unison to get this
> to work in several different fashions (-X -A, -A - X, -AX,
> -XA) and it seems that without fail the first argument is
> accepted while the second is ignored. So if i try something
> like -A -X the file is appended, but it is not exported in
> fixed width, while using -X -A will export the file in fixed
> width form but not append the data to the end of the file.
>
> I also tried to export to another file from the same
> processing table figuring that I could just cat the files to
> each other outside of processing, but filepro will not allow
> me to have multiple export commands to different filenames
> for some reason. There has to be something that I'm missing
> here to get both the Fixed width and the append flag to work
> properly, I'm running on version 5.0.13R4 on Solaris.
>
> my gosub looks like this :
>
> exp
> ~ If:
> Then: export ascii nacha = /ptmp/nachamain r=\n -X -A
> 24 ------- - - - - - - - - - - - -
> - - -
> ~ If:
> Then: return
>
Set up with a global dummy field or a one element array to hold you total
and either
To(9,.2)=fn+xx;nacha(nn)-to;write nacha; where fn is your field #
Or
Dim tot(9,.2)
::tot["1"]=tot["1"]+fn;nacha(nn)=tot["1"];write nacha
In this manner you are posting a running total and won't need any processing
at @done.
Richard Kreiss
GCC Consulting
More information about the Filepro-list
mailing list