ASCIIOutput in TI

Post Reply
par3
Posts: 82
Joined: Tue Sep 09, 2008 7:05 am

ASCIIOutput in TI

Post by par3 »

Hi All,

While trying to update a dimension in TI I started using the ASCIIOutput function to see where my TI went wrong. I am asking it to output via the ASCIIOutput function, a few variables. When however I look at the output it gives me the wrong variables. Ex: I am asking for variable "A" and in the output file it gives me variable "B".

Is this a TI phenomenon or what am I doing wrong. My metadata procedures where i use variables also does not want to work. It seems as if TI "shifts" the variables up and down.

The source file is a .dat file with "|" as separator.

Does anyone have any ideas as to why this happens?

Thanx!
User avatar
Steve Rowe
Site Admin
Posts: 2416
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: ASCIIOutput in TI

Post by Steve Rowe »

You might want to post your script, this would be very unsual behaviour for TI though.

The most likely situation is that ASCII output is working, this would mean that you have found your bug! Some where your variable asignment goes wrong or perhaps the columns in yoour data source are in different order to what you are expecting?

HTH
Technical Director
www.infocat.co.uk
par3
Posts: 82
Joined: Tue Sep 09, 2008 7:05 am

Re: ASCIIOutput in TI

Post by par3 »

Here is the MetaData procedure

IF (DIMIX('Item',Item) = 0);
IF( DIMIX('Item',Dept) = 0);
IF (Dept @<> '0055');
DIMENSIONELEMENTINSERT('Item','FOODS',Dept,'c');
ASCIIOutput(ti_test2.txt',Item,Import_Local,Trans_shipment, dept, sub_dept,catg,sub_catg);
Endif;
# DimensionElementComponentAdd('Item',Dept,Item, 1);
Endif;
endif;

This is a list of variables:

RecordType Numeric 2 Ignore
DistributionCentre Numeric 003896 Ignore
Item String 00026194 Other
Descr String WOOL CONE NAVY 56 Other
Pack_size Numeric 000024 Other
Color_Size String NAVY 56 Ignore
Import_Local String 1 Other
Trans_shipment String N Other
DateDeleted String Ignore
Dept String 0055 Other
Sub_Dept String 0015 Other
Catg String 0001 Other
Sub_Catg String 0010 Other
Supplier String 566347 Other
Case_Unit Numeric 0024 Other
Case_Lenght Numeric 000061.5 Other
Case_Width Numeric 000048.0 Other
Case_Height Numeric 000034.5 Other
Case_Cube Numeric 000000.102 Other
Case_Weight Numeric 0000007.00 Other
Store_Ti Numeric 0005 Other
Stero_Hi Numeric 0003 Other
+++++++++++++++++++
This is the ouptut the Asccii file produces:


"00764607"|"26/02/2000"|"0055"|"0090"|"0001"|""|"0024"

The first column is correct. The second one is a value of a variable that is ignored in the variables. And from there everything is wrong.
User avatar
Steve Rowe
Site Admin
Posts: 2416
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: ASCIIOutput in TI

Post by Steve Rowe »

Seems like the variable assignment is going wrong on the variables tab.
Does the issue happen on every row or just some?
Is it possible that there is a "|" where there shouldn't be in the source file?

Try openining in excel (if you can) and re saving as a comma delimited and re running. You might want to post your release number as well so that someone on the same release can confirm the behaviour.

Cheers,
Technical Director
www.infocat.co.uk
par3
Posts: 82
Joined: Tue Sep 09, 2008 7:05 am

Re: ASCIIOutput in TI

Post by par3 »

I have noticed that this happens only for some of the rows. Here is 'n snippet of the latest Asccii file:

"01945614"|"1"|"N"|"0083"|"0082"|"0051"|"0007"
"01249255"|"1"|"N"|"0083"|"0021"|"0001"|"0001"
"01253801"|"1"|"N"|"0083"|"0082"|"0034"|"0001"
"01254996"|"1"|"N"|"0083"|"0018"|"0030"|"0040"
"00735894"|"26/02/2000"|"0055"|"0001"|"0005"|""|"0012"
"00735667"|""|""|""|""|""|""
"00735856"|"26/02/2000"|"0055"|"0001"|"0005"|""|"0036"
"00735887"|""|""|""|""|""|""
"00741297"|"26/02/2000"|"0055"|"0001"|"0015"|""|"0012"
"01268463"|"1"|"N"|"0083"|"0021"|"0002"|"0003"
"00748898"|"26/02/2000"|"0055"|"0004"|"0025"|""|"0144"
"00762764"|""|""|""|""|""|""
"01363296"|"1"|"N"|"0083"|"0018"|"0069"|"0001"

As you can see it happens only with some of the rows. Any idea what my be wrong?
User avatar
Steve Rowe
Site Admin
Posts: 2416
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: ASCIIOutput in TI

Post by Steve Rowe »

Clearly TI doesn't like the rows with the date in them. Should they be included in the file at all? I'd try and get the date vale converted to a serial in the process that is exporting the flat file in the first place. I guess it's possible that TI is treating | and / as the same thing when splitting the columns up?

Anyway not sure, TI clearly doesn't like your file so unless you can upgrade away from the version you are on and hope that fixes the issue your only real option is to change the sorce file.

Cheers
Technical Director
www.infocat.co.uk
User avatar
Steve Vincent
Site Admin
Posts: 1054
Joined: Mon May 12, 2008 8:33 am
OLAP Product: TM1
Version: 10.2.2 FP1
Excel Version: 2010
Location: UK

Re: ASCIIOutput in TI

Post by Steve Vincent »

Lesson i learnt a long time ago, avoid "reserved" characters in any file you import with TI. | (pipe) is the reserved character for concatenate in TI and i suspect that's what's causing you issues. I've also had problems with elements with a comma in them, as well as & too. I strongly suggest you replace the pipe with a more common seperator that isn't reserved in TI (comma or colon should work fine) and then try running the TI again.
If this were a dictatorship, it would be a heck of a lot easier, just so long as I'm the dictator.
Production: Planning Analytics 64 bit 2.0.5, Windows 2016 Server. Excel 2016, IE11 for t'internet
par3
Posts: 82
Joined: Tue Sep 09, 2008 7:05 am

Re: ASCIIOutput in TI

Post by par3 »

Hey Guys,

Thanks for the ideas. You guys would not guess what the problem was!

The "Quote Char" in the the Data Source tab was set to " and the load file contained that same character within some of the fields. Once I removed the " from the "Quote Char" tab everything worked.

Watch out for it in the future, took me days to figure out!

Cheers!
User avatar
Steve Vincent
Site Admin
Posts: 1054
Joined: Mon May 12, 2008 8:33 am
OLAP Product: TM1
Version: 10.2.2 FP1
Excel Version: 2010
Location: UK

Re: ASCIIOutput in TI

Post by Steve Vincent »

oh i would believe it, which is why i go freaking ballistic when someone tries to use those types of characters in an element. Rule #1 - to save your own sanity, never EVER allow people to use anything other than alphanumeric characters in your TI models. They might work, they might not, but why cause yourself a problem when its so easily avoided? :lol:
If this were a dictatorship, it would be a heck of a lot easier, just so long as I'm the dictator.
Production: Planning Analytics 64 bit 2.0.5, Windows 2016 Server. Excel 2016, IE11 for t'internet
Post Reply