SetOutputCharacterSet

Post Reply
holger_b
Posts: 131
Joined: Tue May 17, 2011 10:04 am
OLAP Product: TM1
Version: Planning Analytics 2.0
Excel Version: 2016
Location: Freiburg, Germany

SetOutputCharacterSet

Post by holger_b »

Hi all,

I am having difficulties with exporting special language characters to a flat file in a TI process. It is about hungarian characters, for example ő - no matter what I do, in the flat file I get a question mark. My best hope was this, but it made no difference:

setOutputCharacterSet (sOutfile, 'TM1CS_ISO_8859_2');

Any ideas?

Regards
Holger
User avatar
jim wood
Site Admin
Posts: 3958
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: SetOutputCharacterSet

Post by jim wood »

Have you tried TM1CS_ISO_8859_16?
Struggling through the quagmire of life to reach the other side of who knows where.
Shop at Amazon
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
Duncan P
MVP
Posts: 600
Joined: Wed Aug 17, 2011 1:19 pm
OLAP Product: TM1
Version: 9.5.2 10.1 10.2
Excel Version: 2003 2007
Location: York, UK

Re: SetOutputCharacterSet

Post by Duncan P »

Which are you using, ASCIIOutput or TextOutput?

[EDIT]
The other thing to consider is this from the TM1 Docs
This argument should be indentical to the FileName argument for the TextOutput function.
holger_b
Posts: 131
Joined: Tue May 17, 2011 10:04 am
OLAP Product: TM1
Version: Planning Analytics 2.0
Excel Version: 2016
Location: Freiburg, Germany

Re: SetOutputCharacterSet

Post by holger_b »

Sorry no difference, not with the codepage Jim proposed, nor using textoutput instead of asciioutput. And I made sure the filename variable is complete including path and extension...
Duncan P
MVP
Posts: 600
Joined: Wed Aug 17, 2011 1:19 pm
OLAP Product: TM1
Version: 9.5.2 10.1 10.2
Excel Version: 2003 2007
Location: York, UK

Re: SetOutputCharacterSet

Post by Duncan P »

Just to be clear ASCIIOutput only uses the ASCII character set - like it says on the tin. If you want anything other than US ASCII then use TextOutput.

Two option spring to mind.
  1. Use TM1CS_UTF8 (which I thought was the default) and which should provide a readable file
  2. Find out what your Windows code page is and use TM1CS_WCPnnnn where nnnn is your code page
.pk.
Posts: 5
Joined: Thu Mar 21, 2013 10:00 am
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2010

Re: SetOutputCharacterSet

Post by .pk. »

I always use TM1CS_UTF8, works like a charm with windows editors.
holger_b
Posts: 131
Joined: Tue May 17, 2011 10:04 am
OLAP Product: TM1
Version: Planning Analytics 2.0
Excel Version: 2016
Location: Freiburg, Germany

Re: SetOutputCharacterSet

Post by holger_b »

Finally it worked after I decided to move the setOutputCharacterSet function from the prolog to the data tab where the file is actually written. Apparently one must keep in mind that each tab writes a new file (or overwrites the one from the previous tab), so you need to have the code page definition there.

Thanks for your help!

Holger
fr4n3kj
Posts: 1
Joined: Fri May 22, 2020 8:47 am
OLAP Product: IBM Cognos Analytics
Version: 10.3.10700.60404
Excel Version: 2007

Re: SetOutputCharacterSet

Post by fr4n3kj »

holger_b wrote: Mon Mar 25, 2013 2:54 pm Finally it worked after I decided to move the setOutputCharacterSet function from the prolog to the data tab where the file is actually written. Apparently one must keep in mind that each tab writes a new file (or overwrites the one from the previous tab), so you need to have the code page definition there.

Thanks for your help!

Holger
Thanks for the solution! I had the same problem with setOutputCharacterSet and was trying to find what is wrong and which encoding should I use. In the end it was good encoding but bad placing.

It's interesting difference between setOutputCharacterSet and for example DatasourceASCIIDelimiter, which I didn't see earlier but which is kinda obvious. The first one is referring to "DataSource" and it can be applied once in the prolog and the second one is applied to output data (TextOutput) but only (as You pointed out) in one tab, because (from IBM):
The text file is opened when the first record is written, and is closed when the TurboIntegrator procedure (Prolog, Metadata, Data, or Epilog) containing the TextOutput function finishes processing.
Post Reply