Fixed length file & leading spaces
Bill Vermillion
fp at wjv.com
Wed Nov 17 19:27:05 PST 2004
press any key to reboot -oops- Dennis Malen said on Wed, Nov 17 16:55
> Ken,
>
> Your the best. That's all I needed.
> As usual I respond to the list once a problem has been solved
> in order to share my findings so others may learn.
> The Problem:
> A fixed length file is created without the use of -x because
> we are trying to use -a. All the fields created are exported
> perfectly, except for the first field which has leading spaces.
> In that case the field moves left causing the file to be out of
> sync for the receiver of the file who is expecting a certain
> length.
> Resolution:
> If the first field that you are exporting contains leading spaces, the entire line will move left. The field must be left justified in order for the export to work so that the leading spaces are to the right of the information as opposed to the left. The integrity of the number of required spaces will then remain intact.
> Ken suggested: A(10)=""{xx to left justify.
> Simple resolution which I should have thought of.
I've never had export problems but I have had import problems.
It was data generated in a Unisys MF - and the front end was Lynx -
which I beleive is a 4GL interface that generates Cobol.
When they would export a text field as the last field of a record,
the record stopped being 'fixed length' as the last field
was only as long as the text.
So in that case I just told the MF group to just generated a dummy
field at the end with the format of 99999 [I think five nines
were used to indicate a numeric field, even if the field was not
that long] Then I had fixed length.
Data would move back and forth from the MF into FP on a monthly
basis for the HR department - so they could track all sorts
of things with their own reports. They loved FP for that as
they could gen a new report in about as much time as it took them
to create it but to get one from the IT department it first had to
be submitted in paper and then could 3 to 5 days to get printed.
Bill
--
Bill Vermillion - bv @ wjv . com
More information about the Filepro-list
mailing list