Content_Cut_Icon Twitter_Brands_Icon

A Developer’s guide: Avoiding File Lock conflicts in TI with AsciiOutput

Mode_Comment_Icon_white0
Alarm_Icon_1_white3 min
Book_Open_Solid_Icon
Executive Summary Key Takeaway in 30 Seconds

What is ASCIIOutputOpen In IBM Planning Analytics (TM1), TurboIntegrator (TI) processes are essential for automating data operations. One of the most useful functions in TI scripting is ASCIIOutputOpen, which allows you to open a file for writing ASCII data. Whether you need to ...

What is ASCIIOutputOpen

In IBM Planning Analytics (TM1), TurboIntegrator (TI) processes are essential for automating data operations. One of the most useful functions in TI scripting is ASCIIOutputOpen, which allows you to open a file for writing ASCII data. Whether you need to create a new file or append data to an existing one, this function provides the flexibility to control file access and modifications efficiently.

 

Key Features of ASCIIOutputOpen

  • Append or Overwrite: Choose whether to overwrite an existing file or add new data to the end.  

  • Shared Read Access: Enable other processes or users to read the file while it’s being written.  

  • Supports Multiple File Types: Works seamlessly with .csv and .txt files, making it ideal for various data export needs.  

Syntax Breakdown 

The basic syntax for ASCIIOutputOpen is:  


ASCIIOutputOpen(FileName, OpeningMode);

Parameters Explained 

  1. FileName  

    • The full path and filename (including extension) where data will be written.  

    • Example: "C:\Data\Report.csv"  

  2. OpeningMode  

    • A numeric code that determines how the file is accessed.  

Mode

Description

Behaviour

0

Overwrite without shared read access

Creates or overwrites the file; no other process can read simultaneously.

1

Append mode without shared read access

Adds data to the end of the existing file; no sharing.

2

Overwrite, shared read access enabled

Overwrites if the file exists; allows other processes to read concurrently.

3

Append, shared read access enabled

Adds data to the end; allows other processes to read the file simultaneously.

 

Related Functions 

For more granular control, you can also use:  

  • FILE_OPEN_APPEND() – Opens a file in append mode.

  • FILE_OPEN_SHARED() – Opens a file with shared read access.

Combining these functions can provide finer control over file operations. 

Practical Examples

Example 1: Overwriting a File with Shared Read Access  

If you want to generate a new CSV report (overwriting any existing version) while allowing others to read it:  

ASCIIOutputOpen("C:\\Reports\\SalesData.csv", 2);

  

Example 2: Appending Data with Shared Access  

If you need to add new records to an existing file without locking it:  

ASCIIOutputOpen("C:\\Reports\\SalesData.csv", 3);

Conclusion 

ASCIIOutputOpen is a powerful function in TurboIntegrator that helps manage file exports efficiently. By understanding its different modes, you can ensure seamless data operations—whether you're generating reports, logging data, or integrating with external systems.  

Pro Tip: Always verify file paths and permissions before running TI processes to avoid errors!  

Have you used ASCIIOutputOpen in your projects? Share your experiences in the comments! 🚀  

Baburao G
Written by

Baburao G

Subject-matter specialist at Octane Solutions, helping Australian enterprise finance teams optimize planning, analytics, and automation.

Leave a comment

Got a question? Shoot!

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Get more articles like this delivered to your inbox