export fixed length file

Dennis Malen dmalen at malen.com
Wed Nov 9 14:09:01 PST 2005


When doing an export on a fixed length ascii file I found that when using 
two export identifiers (not sure of the terminology) that the use of a 
second export identifier caused the values to be pushed left even though the 
respective fields were defined as certain lengths.

The following should give you an idea of what I mean:

 6 ne ""                                                          ~
 met(1)=a&b&c&d&e&f&g&h&i&j&k&l&m&na&o&p&q&r&s&t&u&v&w&x&ya&z     ~
   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
 6 ne ""
 met(2)=aa&bb&cc&dd&ee&ff&gg&hh&ii&jj&kk&ll&ma&nn&oo&chr("10");write met
   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -

Above, I had to use met(1) and met(2). This caused only z(30) and aa(27) to 
be corrupted concerning the lack of its ability to maintain the defined 
length of the respective fields. In order to fix the problem I had to do the 
following which was to create two dummy fields that held the value of each 
line and then send it out as met(1) only. I have not included the processing 
showing the dummy fields defined as that was not causing the problem.

 6 ne ""                                                           ~
 xx=a&b&c&d&e&f&g&h&i&j&k&l&m&na&o&p&q&r&s&t&u&v&w&x&ya&z          ~
   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
 6 ne ""
 yy=aa&bb&cc&dd&ee&ff&gg&hh&ii&jj&kk&ll&ma&nn&oo&chr("10")
   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
 6 ne ""                                                           ~
 met(1)=xx&yy;write met                                            ~

The above fixed the problem.

Some of you may not be aware that this approach causes a problem and some of 
you may have a better fix.

Regards,

Dennis Malen
516.479.5912




More information about the Filepro-list mailing list