SetOutputCharacterSet

Post Reply
holger_b
Posts: 119
Joined: Tue May 17, 2011 10:04 am
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2016
Location: Freiburg, Germany

SetOutputCharacterSet

Post by holger_b » Wed Mar 20, 2013 3:59 pm

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: 3797
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: TM1 10.2.2
Excel Version: 2007
Location: 1639 Route 10, Suite 107, Parsippany, NJ, USA
Contact:

Re: SetOutputCharacterSet

Post by jim wood » Wed Mar 20, 2013 4:09 pm

Have you tried TM1CS_ISO_8859_16?
Struggling through the quagmire of life to reach the other side of who knows where.
Application Consulting Group (ACG) TM1 Consulting
OS: Windows 10 64-bit. TM1 Version: 10.2.2

Duncan P
MVP
Posts: 588
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 » Wed Mar 20, 2013 4:46 pm

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: 119
Joined: Tue May 17, 2011 10:04 am
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2016
Location: Freiburg, Germany

Re: SetOutputCharacterSet

Post by holger_b » Fri Mar 22, 2013 8:52 am

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: 588
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 » Fri Mar 22, 2013 9:17 am

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. » Fri Mar 22, 2013 9:27 am

I always use TM1CS_UTF8, works like a charm with windows editors.

holger_b
Posts: 119
Joined: Tue May 17, 2011 10:04 am
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2016
Location: Freiburg, Germany

Re: SetOutputCharacterSet

Post by holger_b » 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

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 » Thu Jul 16, 2020 10:44 am

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