Pages

ASCII and Text TurboIntegrator Functions in Cognos TM1


ASCII and Text TurboIntegrator Functions:
These functions pertain to ASCII and Text.

ASCIIDelete:
This is a TM1 TurboIntegrator function, valid only in TurboIntegrator processes.
This function deletes an ASCII file.

Syntax:
ASCIIDelete(FileName);

Arguments:
ArgumentDescription
FileNameThe name of the ASCII file you want to delete. If a full parth is not specified, TM1 searches for the file in the server data directory.

Example:
ASCIIDelete('C:\exported_data\2002Q1Results.cma');
This example deletes the ASCII file named 2002Q1Results.cma from the C:\exported_data directory.

ASCIIOutput:
This is a TM1 TurboIntegrator function, valid only in TurboIntegrator processes.
This function writes a comma-delimited record to an ASCII file.
The ASCII file is opened when the first record is written, and is closed when the TurboIntegrator procedure (Prolog, Metadata, Data, or Epilog) containing the ASCIIIOutput function finishes processing.

Important: If you use the ASCIIOutput function to write to the same file in multiple procedures (tabs) of a TurboIntegrator process, the file will be overwritten each time it is opened for a new procedure.

Syntax:
ASCIIOutput(FileName, String 1, String 2, ...String n);

Arguments:
ArgumentDescription
FileNameA full path to the ASCII file to which you want to write the record. Path must include a file extension.
String1...StringnA string that corresponds to each field you want to create in the ASCII file. This argument can be a string or a TurboIntegrator variable for a string.

Example:
ASCIIOutput('NewCube.cma', V1, V2, V3, V4, V5 );
This example writes a record to the NewCube.cma ASCII file. Each field in the record corresponds to a variable assigned by TurboIntegrator to a column in your data source.

SetInputCharacterSet:
This is a TM1 TurboIntegrator function, valid only in TurboIntegrator processes.
When a TurboIntegrator process reads an external file as input, it needs to know the character set in which that external file was written. If the file contains a valid byte-order-mark, TM1 functions will correctly convert the file to UTF-8 if required.

For formats lacking a valid byte-order-mark, the characters must be converted from some other encoding to UTF-8. The SetInputCharacterSet function lets you specify the character set used in a TurboIntegrator data source. If the proper converters are present on the machine hosting the TM1 server, the input file will be converted to the Unicode character set required by TM1.

Syntax:
SetInputCharacterSet (CharacterSet);

Arguments:
ArgumentDescription
CharacterSetThe character encoding in the input file to be used by the TurboIntegrator process.
If the CharacterSet argument is not a known character type, the type defaults to the system locale.

Example:
SetInputCharacterSet('TM1CS_ISO_8859_11');
This example specifies that the input character set for the TurboIntegrator data source is ISO-8859-11 Latin/Thai.

SetOutputCharacterSet:
This is a TM1 TurboIntegrator function, valid only in TurboIntegrator processes.
The SetOutputCharacterSet function lets you specify the character set to be used when writing to a text file with the TextOutput function.
SetOutputCharacterSet should immediately precede TextOutput in a TurboIntegrator process.

Syntax:
SetOutputCharacterSet( FileName, CharacterSet );

Arguments:
ArgumentDescription
FileNameA full path to the text file for which you want to specify a character set. The path must include a file extension.
This argument should be indentical to the FileName argument for the TextOutput function.
CharacterSetThe character encoding to use when writing to the output file.


TextOutput:
This is a TM1 TurboIntegrator function, valid only in TurboIntegrator processes.
This function writes a comma-delimited record to a text file. By default TextOutput writes characters in the locale character set of the TM1 server machine. To create a file in a different character set, call the function SetOutputCharacterSetbefore calling TextOutput.
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.

Important: If you use the TextOutput function to write to the same file in multiple procedures (tabs) of a TurboIntegrator process, the file will be overwritten each time it is opened for a new procedure.

Syntax:
TextOutput(FileName, String 1, String 2, ...String n);

Arguments:
ArgumentDescription
FileNameA full path to the ASCII file to which you want to write the record. Path must include a file extension.
String1...StringnA string that corresponds to each field you want to create in the ASCII file. This argument can be a string or a TurboIntegrator variable for a string.

Example:
TextOutput('NewCube.cma', V1, V2, V3, V4, V5 );
This example writes a record to the NewCube.cma file. Each field in the record corresponds to a variable assigned by TurboIntegrator to a column in your data source.

0 comments:

© 2010 Datawarehousing Support | Home | Disclaimer | Privacy Policy