Export ASCII delimited with some padded fields
Josh Reader
josh.reader at mercuryelectronics.com
Tue Jun 11 07:35:23 PDT 2019
Hi Nancy,
That is exactly what I ended up doing. The ISA segment needed the padding so I wrote that all out in one concatenated string. Then the rest of the segments I wrote each element out using xxx(1)=; xxx(2)=; xxx(3); etc. so I didn't have to manually add the field separators using concatenation.
Thanks,
Josh
-----Original Message-----
From: Filepro-list <filepro-list-bounces+josh.reader=mercuryelectronics.com at lists.celestial.com> On Behalf Of Nancy Palmquist via Filepro-list
Sent: Tuesday, June 11, 2019 10:28 AM
To: filepro-list at lists.celestial.com
Subject: Re: Export ASCII delimited with some padded fields
Josh,
The ANSI files can be difficult, but you will find that they want most of the lines to be as short as possible, with spaces removed as fill.
I think the first couple lines are exceptions.
We use ANSI files for the medical electronic claims, but the protocol and structure is used in many industries for exchanging orders, inventories and such.
You do have a record delimiter, the tilde ~.
export ascii xxx=file r=~ f=,
xxx(1)=wl; write xxx
wl=""
Then all your fields are concatenated into WL as you build each record.
wl=wl{"*"{field1{"*"{field2
Will work for ANSI.
The field delimiter is never inserted because you are only every writing one field, you are using wl and loading it with all the fields for one line on each pass.
I hope that helps.
Nancy
On 6/6/2019 2:20 PM, Josh Reader via Filepro-list wrote:
> Hi All,
>
> Is it possible to export to a delimited file and pad a few of the fields with spaces? The command I'm using is:
>
> export ascii file=(fn) f=*
>
> (Note the requirement is to run all data on one long line, hence no
> r=\n)
>
> I tried using named variables with a set length, using chr("32"), and setting an edit using {*} \20\ and nothing worked. It doesn't honor the spaces and butts the delimiter right up against the end of the data (or other delimiter). I'm doing this for an 856 ASN EDI document. The trading partner needs fields 3 and 5 to have 10 blank spaces and fields 7 and 9 to be a 15 characters (I only have 14 characters worth of data). Those two fields should have a space between the end of the data and the delimiter. The rest, however, should be delimited normally so I can't use fixed width.
>
> Here's a sample of what I'm trying to do:
> ISA*00* *00* *12*1111111111TEST *12*2222222222TEST *190528*1447*U*00401*000001036*0*P*>~
>
> Here's what it's doing:
> ISA*00**00**12*1111111111TEST*12*2222222222TEST*190528*1447*U*00401*00
> 0001036*0*P*>~
>
> Thanks,
> Josh
> -------------- next part -------------- An HTML attachment was
> scrubbed...
> URL:
> <http://mailman.celestial.com/pipermail/filepro-list/attachments/20190
> 606/5434228e/attachment.html>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
--
Nancy Palmquist MOS & filePro Training Available
Virtual Software Systems Web Based Training and Consulting
PHONE: (412) 835-9417 Web site: http://www.vss3.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.celestial.com/pipermail/filepro-list/attachments/20190611/06211ee5/attachment.html>
_______________________________________________
Filepro-list mailing list
Filepro-list at lists.celestial.com
Subscribe/Unsubscribe/Subscription Changes http://mailman.celestial.com/mailman/listinfo/filepro-list
More information about the Filepro-list
mailing list