Focal Point
[SOLVED] REg: issue with Flat file

This topic can be found at:
http://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1807023686

May 03, 2017, 06:58 AM
rboya
[SOLVED] REg: issue with Flat file
Hi,

I am trying write csv value to flatfile

First column in input csv is Name with length 20
First column in output flatfile is Name with length 20

But in output flatfile Name field is of length 60.
20 is multiplied with 3 i.e 60

For all the fields it is multiplied with 3.

Could you please help.I need to get only 20 length.

Thanks,
Rajesh

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8
Windows, All Outputs
May 03, 2017, 07:28 AM
MartinY
Please post your code (using code tag : last icon
</>
from message ribbon), it may help us to help you.


WF versions : Prod 8.2.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
May 03, 2017, 08:21 AM
BabakNYC
Rajesh:
Your problem description is unclear. Are you trying to create a fixed formatted flat file? What syntax are you using for your ON TABLE HOLD FORMAT xxxxx? HOLD syntax doesn't triple column formats, so there's something else going on. What you need to show us is the format of the columns you are reading and the code you are using to generate the HOLD file.


WebFOCUS 8206, Unix, Windows
May 03, 2017, 08:22 AM
dhagen
Your server's codepage is 65001. This is a multi-byte codepage. When you do a ON TABLE HOLD, it uses the default codepage to create the flat file. WF will multiply the character columns by 3 to ensure there is enough room to store the total potential bytes.

There is no way that I know of to change the code page for an ON TABLE HOLD. You can use Data Migrator and change the target to a single byte codepage (137, 1252 whatever). That will give you the results you are looking for.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
May 03, 2017, 08:31 AM
BabakNYC
Here's what I discovered in the documentation. But it doesn't seem to make a difference when I set it:

APP PROPERTY CODEPAGE

How to:

    Specify a Code Page for an Application

The APP PROPERTY appname CODEPAGE command identifies the codepage to be used for non-data files in the application directory.
Syntax: How to Specify a Code Page for an Application

APP PROPERTY app[/appa...] CODEPAGE number

where:

app[/appa...]

    Is an application name. Nested application names are supported.
number

    Is the code page number for non-data files in the application.


This message has been edited. Last edited by: BabakNYC,


WebFOCUS 8206, Unix, Windows
May 03, 2017, 09:07 AM
rboya
Thank you all.

dhagen:

As you suggested, I tried using codepage 137 and it WORKED!!!

Thank you,
Rajesh


WebFOCUS 8
Windows, All Outputs
May 03, 2017, 09:58 AM
dhagen
quote:
Originally posted by BabakNYC:
Here's what I discovered in the documentation. But it doesn't seem to make a difference when I set it:

APP PROPERTY CODEPAGE

How to:

    Specify a Code Page for an Application

The APP PROPERTY appname CODEPAGE command identifies the codepage to be used for non-data files in the application directory.
Syntax: How to Specify a Code Page for an Application

APP PROPERTY app[/appa...] CODEPAGE number

where:

app[/appa...]

    Is an application name. Nested application names are supported.
number

    Is the code page number for non-data files in the application.




I had heard that they were going to try to implement something like this, but I didn't know it was there yet. Nice catch.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott