Exploring TM1 - a Chartertech Company
Search
Close this search box.

AsciiOutput TM1 Function: Use and Syntax

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 to be exported
  • String2 is the second variable you want to be exported
  • StringN is the Nth variable you want to be 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:

AsciiOutput (vOutputFile, sDate, sDayOfMonth, sExportValue ); 

This 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.

A Header Record?

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.

  • This field is for validation purposes and should be left unchanged.

Post Sections

Related Posts

John Vaughan

John Vaughan

John is a CPA, MBA and has been a Performance Management consultant for over 25 years. He is the founder of ExploringTM1 and highly regarded for his experience combining financial management with corporate planning, reporting and analysis. He lives in Sydney with his wife, two of his three children, their cat, Freckles, a bunch of chooks and some fish. John is a sports nut, who played rugby until he was 40, started playing football at 54 and loves being outdoors.

Leave a Reply

Your email address will not be published. Required fields are marked *

Log In