Filepro-list Digest, Vol 185, Issue 4
Josh Reader
josh.reader at mercuryelectronics.com
Fri Jun 7 10:01:17 PDT 2019
Hi Kevin,
Using an export with delimiters worked for me as long as I put the ISA segment into one long concatenated field that I could control the spacing between elements and add delimiters where needed manually. I also could have probably used export -x for the ISA segment (since it's first), then open the same file with export -a and added the rest of the segments to it. Regardless I now have a 183 line processing table that generates a complete 856 EDI document (including the envelope).
Thanks,
Josh
-----Original Message-----
From: Filepro-list <filepro-list-bounces+josh.reader=mercuryelectronics.com at lists.celestial.com> On Behalf Of Kevin Brown via Filepro-list
Sent: Thursday, June 6, 2019 4:33 PM
To: filepro-list at lists.celestial.com
Subject: RE: Filepro-list Digest, Vol 185, Issue 4
Josh
Without directly answering your question:
The string you are attempting to generate is a fixed length of 106 characters separated by the '*' and terminating with the '~'
Each element of the segment is a predetermined length per the specs.
Since the entire file you are processing contains multiple lines all with varying lengths but all terminating with a '~' I process these by first:
Import ascii zremit=/...../..../zremit R=~ F=~
... is the directory info where the file to be processed resides
Set dummy length to 338 characters
Write this data to a blank file
20 plus years of processing these has determined that the max import size is 338 in length (that I have seen)
Each line is prefaced with a three character field called a header
(Ex: ISA)
The ISA Segment has predetermined specifications for each element separated by the '*'
Unfortunately, not all LINES (segments) are the same length. In order to extract the data you will need to process each segment individually. As Scott suggested THE ISA Segment is a FIXED LENGTH. Other segments can vary in length. Some data is mandatory and other data is optional.
Because each insurance company generates these files and are probably not fully versed in the specs as you would have expected, you will need to have quite the processing table in order to extract the data from each segment (or line).
I use the ISA segment to extract the security information to determine what insurance company (or clearinghouse) has generated the file.
the main prc. can then be flavored with specific issues that are encountered from that insurance.
If you are processing the 837 file or the 835 file your destination file should be looking exactly like the specs.
Have fun!!!
-----Original Message-----
From: Filepro-list
[mailto:filepro-list-bounces+kbrown=b-e-s-t.com at lists.celestial.com] On Behalf Of filepro-list-request at lists.celestial.com
Sent: Thursday, June 06, 2019 2:45 PM
To: filepro-list at lists.celestial.com
Subject: Filepro-list Digest, Vol 185, Issue 4
Send Filepro-list mailing list submissions to
filepro-list at lists.celestial.com
To subscribe or unsubscribe via the World Wide Web, visit
http://mailman.celestial.com/mailman/listinfo/filepro-list
or, via email, send a message with subject or body 'help' to
filepro-list-request at lists.celestial.com
You can reach the person managing the list at
filepro-list-owner at lists.celestial.com
When replying, please edit your Subject line so it is more specific than "Re: Contents of Filepro-list digest..."
Today's Topics:
1. Export ASCII delimited with some padded fields (Josh Reader)
2. RE: Export ASCII delimited with some padded fields
(Walter Vaughan Jr)
3. RE: Export ASCII delimited with some padded fields (Scott Walker)
4. RE: Export ASCII delimited with some padded fields
(Michael Schwartz (PC Support & Services))
5. RE: Export ASCII delimited with some padded fields
(Michael Schwartz (PC Support & Services))
----------------------------------------------------------------------
Message: 1
Date: Thu, 6 Jun 2019 18:20:50 +0000
From: Josh Reader <josh.reader at mercuryelectronics.com>
To: "filepro-list at lists.celestial.com"
<filepro-list at lists.celestial.com>
Subject: Export ASCII delimited with some padded fields
Message-ID:
<BN6PR11MB1844BB2D780F2CFE5C294DC596170 at BN6PR11MB1844.namprd11.prod.outlook.
com>
Content-Type: text/plain; charset="us-ascii"
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*00000103
6*0*P*>~
Thanks,
Josh
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mailman.celestial.com/pipermail/filepro-list/attachments/20190606/54
34228e/attachment.html>
------------------------------
Message: 2
Date: Thu, 6 Jun 2019 18:24:58 +0000
From: Walter Vaughan Jr <wvaughan at steelerubber.com>
To: "filepro-list at lists.celestial.com"
<filepro-list at lists.celestial.com>
Subject: RE: Export ASCII delimited with some padded fields
Message-ID:
<MN2PR16MB3007768D8089DBED7A6BA13BBE170 at MN2PR16MB3007.namprd16.prod.outlook.
com>
Content-Type: text/plain; charset="us-ascii"
You're going to have to show us what your concatenation looks like Are you using & or < or what to join the fields
-----Original Message-----
From: Filepro-list
<filepro-list-bounces+wvaughan=steelerubber.com at lists.celestial.com> On Behalf Of Josh Reader via Filepro-list
Sent: Thursday, June 6, 2019 2:21 PM
To: filepro-list at lists.celestial.com
Subject: Export ASCII delimited with some padded fields
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*00000103
6*0*P*>~
Thanks,
Josh
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mailman.celestial.com/pipermail/filepro-list/attachments/20190606/54
34228e/attachment.html>
_______________________________________________
Filepro-list mailing list
Filepro-list at lists.celestial.com
Subscribe/Unsubscribe/Subscription Changes http://mailman.celestial.com/mailman/listinfo/filepro-list
------------------------------
Message: 3
Date: Thu, 6 Jun 2019 14:33:00 -0400
From: "Scott Walker" <scottwalker at ramsystemscorp.com>
To: <filepro-list at lists.celestial.com>
Subject: RE: Export ASCII delimited with some padded fields
Message-ID: <017101d51c96$45bb1ba0$d13152e0$@ramsystemscorp.com>
Content-Type: text/plain; charset="us-ascii"
Seems like you really want to use fixed length fields?
Regards,
Scott
-----Original Message-----
From: Filepro-list
[mailto:filepro-list-bounces+scottwalker=ramsystemscorp.com at lists.celestial.
com] On Behalf Of Josh Reader via Filepro-list
Sent: Thursday, June 6, 2019 2:21 PM
To: filepro-list at lists.celestial.com
Subject: Export ASCII delimited with some padded fields
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*00000103
6*0*P*>~
Thanks,
Josh
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mailman.celestial.com/pipermail/filepro-list/attachments/20190606/54
34228e/attachment.html>
_______________________________________________
Filepro-list mailing list
Filepro-list at lists.celestial.com
Subscribe/Unsubscribe/Subscription Changes http://mailman.celestial.com/mailman/listinfo/filepro-list
------------------------------
Message: 4
Date: Thu, 6 Jun 2019 13:34:32 -0500
From: "Michael Schwartz (PC Support & Services)"
<filepromike at gmail.com>
To: <filepro-list at lists.celestial.com>
Subject: RE: Export ASCII delimited with some padded fields
Message-ID: <028e01d51c96$7c5d9e80$7518db80$@athenet.net>
Content-Type: text/plain; charset="us-ascii"
> 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*004
> 01*000001036*0*P*>~
>
> Thanks,
> Josh
Try playing with the "-X" option on the export command. The -X option maintains the length of the fields you are writing, including spaces.
If that doesn't work for you, you will have to use "writeline", which gives you complete control over what goes into the output file.
Mike Schwartz
------------------------------
Message: 5
Date: Thu, 6 Jun 2019 13:44:27 -0500
From: "Michael Schwartz (PC Support & Services)"
<filepromike at gmail.com>
To: <filepro-list at lists.celestial.com>
Subject: RE: Export ASCII delimited with some padded fields
Message-ID: <02a001d51c97$df39bc40$9dad34c0$@athenet.net>
Content-Type: text/plain; charset="us-ascii"
> Seems like you really want to use fixed length fields?
>
> Regards,
>
> Scott
>
>
> Is it possible to export to a delimited file and pad a few of the
> fields with spaces? The command I'm using is:
>
<snip>.
> 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*004
> 01*00000103
> 6*0*P*>~
>
> Thanks,
> Josh
Hi Scott:
I've run into this several times; mostly with insurance companies that have old computer systems. They need fixed length fields, but want an "odd"
delimiter between each field. I've asked different companies why they need this, but the olny answer I got back from all of them is, "That's how our computer systems were originally designed..."
Mike Schwartz
------------------------------
Subject: Digest Footer
_______________________________________________
Filepro-list mailing list
Filepro-list at lists.celestial.com
http://mailman.celestial.com/mailman/listinfo/filepro-list
------------------------------
End of Filepro-list Digest, Vol 185, Issue 4
********************************************
_______________________________________________
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