Have you ever wanted an easy way to output data from TM1 so you could then either reload it back into TM1 or load it into your ERP system or load it to an external database for example? Well you can. The TM1 function ASCIIOUTPUT allows you to do exactly that.
Syntax of ASCIIOutput
The syntax is ASCIIOutput (FileName, String1, String2, …StringN); where
- FileName is the path and name of the file you want to create
- String1 is the first variable you want exported
- String2 is the second variable you want exported
- StringN is the Nth variable you want exported
Note: all output values must be strings, not values and the AsciiOutput must be on either the Metadata or Data tabs!
Usage
Set the variable vOutputFile to be ‘c:\test.txt’ and we’ll assume that sDate, sDayOfMonth, nExportValue contain values. We have a problem though as nExportValue is numeric and we cannot export a number to a text file. So we will convert it to sExportValue using NumberToString (nExportValue).
Thus the command is is AsciiOutput (vOutputFile, sDate, sDayOfMonth, sExportValue ); which will create the file ‘test.txt’ in the root of the “c” drive and then have the contents of the variables sDate, sDayOfMonth and the string converted value in sExportValue inserted the end of the row of data.
If you need to create a header record with column names in it, please see this post that will explain how to do it.
ASCIIOutput can be used in TM1 Turbo Integrator Processes only.
By NumberToString TM1 Process: Use and Syntax - Exploring TM1 08-Sep-14 - 07:07
[…] variable sNumber. This can be really useful when testing a TI script as it can be combined with an AsciiOutput to export variables or data to a text file for […]
By Exporting Data from TM1 to an External Database - Exploring TM1 18-Jun-15 - 07:27
[…] AsciiOutput TM1 Function: Use and Syntax […]
By How to Create Headers in AsciiOutput - Exploring TM1 04-Dec-15 - 06:41
[…] AsciiOutput TM1 Function: Use and Syntax […]
By ViewExtractSkipRuleValuesSet - Exploring TM1 21-Dec-15 - 10:19
[…] AsciiOutput TM1 Function: Use and Syntax […]
By ViewColumnSuppressZeroesSet - Exploring TM1 21-Dec-15 - 10:57
[…] AsciiOutput TM1 Function: Use and Syntax […]
By ViewExtractSkipCalcsSet TM1 Function: Syntax and Use - Exploring TM1 01-Apr-16 - 13:36
[…] AsciiOutput TM1 Function: Use and Syntax […]
By ViewExtractSkipRuleValuesSet TM1 Function: Syntax and Use - Exploring TM1 01-Apr-16 - 13:43
[…] AsciiOutput TM1 Function: Use and Syntax […]