ASCIIOUTPUT does not create output file

Post Reply
Rtel
Posts: 59
Joined: Tue Nov 13, 2018 10:15 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2013

ASCIIOUTPUT does not create output file

Post by Rtel »

Hello, its strange that the ASCIIOUTPUT does not create the output .cma file at all

The code is very simple ....
ASCIIOUTPUT('/folder1/folder2/test1.cma', '1', '2', '3');

Its a linux server and running TM1 10.2.2

(I want to extract a view and that's not working either ...so I tried a simple code as above and even that's not working)

Any idea what's going on here ?

Thanks

Rtel
tomok
MVP
Posts: 2831
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: ASCIIOUTPUT does not create output file

Post by tomok »

Rtel wrote: Fri Nov 20, 2020 6:17 pm Hello, its strange that the ASCIIOUTPUT does not create the output .cma file at all

The code is very simple ....
ASCIIOUTPUT('/folder1/folder2/test1.cma', '1', '2', '3');

Its a linux server and running TM1 10.2.2

(I want to extract a view and that's not working either ...so I tried a simple code as above and even that's not working)

Any idea what's going on here ?

Thanks

Rtel
Two things:

1) /folder1/folder2/ has to be a valid path and
2) The service account that the TM1 service runs under has to have security rights to create files in folder 1) above.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
Wim Gielis
MVP
Posts: 3113
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: ASCIIOUTPUT does not create output file

Post by Wim Gielis »

Try that code in the Prolog tab of the process.
If it's in the Metadata tab or Data tab and your views settings are not matching the view contents, it might be that no output is produced.
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Rtel
Posts: 59
Joined: Tue Nov 13, 2018 10:15 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2013

Re: ASCIIOUTPUT does not create output file

Post by Rtel »

Thanks Tomok,

1) the folder1 and folder 2 are valid path
2) I will check the service account access the folder on linux server

Thanks Gim

I ran the code in prolog and still the same issue

Thanks

Rtel
Rtel
Posts: 59
Joined: Tue Nov 13, 2018 10:15 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2013

Re: ASCIIOUTPUT does not create output file

Post by Rtel »

Sorry misspelled your name Wim
User avatar
Steve Rowe
Site Admin
Posts: 2415
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 does not create output file

Post by Steve Rowe »

Try it with just the following on the prolog

ASCIIOUTPUT('test1.cma', '1', '2', '3');

This will write a file to the data directory, this will should work as the service account of TM1 will have rights to it's own directory.

If it doesn't then there maybe a problem arising from your Linux build of TM1.

If it works then the problem will be rights or the naming of the path as others have said.
Technical Director
www.infocat.co.uk
Rtel
Posts: 59
Joined: Tue Nov 13, 2018 10:15 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2013

Re: ASCIIOUTPUT does not create output file

Post by Rtel »

Hello, thank you for your feedback. sorry for the delayed response.

The code runs fine in prolog and it created an output (test.CSV) file.
Prolog
ASCIIOUTPUT('/folder1/folder2/TestOutput1.csv', 'a', 'b', 'c');

But when I run the asciioutput in data section on the same path it does not create file at all.

Data section
ASCIIOUTPUT('/folder1/folder2/TestOutput4.csv', Dim1, Dim2, Dim3, NumberToString(value));

Data source is a cube view.

Please let me know if its right issue where and how can I confirm. Or what else can be going on here ?
Wim Gielis
MVP
Posts: 3113
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: ASCIIOUTPUT does not create output file

Post by Wim Gielis »

Are you really sure that your process enters the Metadata and Data tabs ? Did you check the view settings ?
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Emixam
Posts: 139
Joined: Tue May 21, 2019 3:33 pm
OLAP Product: TM1
Version: PA 2.0.x
Excel Version: 2016
Location: The Internet

Re: ASCIIOUTPUT does not create output file

Post by Emixam »

Rtel wrote: Wed Dec 23, 2020 6:06 pm But when I run the asciioutput in data section on the same path it does not create file at all.
It's most likely the metadata/data tabs that are not getting processed. If you put a random ProcessQuit() in the data tab, did your TI gets terminated with a ProcessQuit error ? If it doesn't, there is multiple threads on this forum explaining why you metadata/data tab are not getting processed.

If you are using a cube view as a source, then it means your view is empty. If you are creating the source view directly in your TI, make sure you have the right value for these 3 functions:

Code: Select all

ViewExtractSkipCalcsSet( sCubeName, sViewSource, 1);
ViewExtractSkipRuleValuesSet( sCubeName, sViewSource, 0);
ViewExtractSkipZeroesSet( sCubeName, sViewSource, 1);
**Edit: sorry, didn't saw Wim's answer
User avatar
gtonkin
MVP
Posts: 1198
Joined: Thu May 06, 2010 3:03 pm
OLAP Product: TM1
Version: Latest and greatest
Excel Version: Office 365 64-bit
Location: JHB, South Africa
Contact:

Re: ASCIIOUTPUT does not create output file

Post by gtonkin »

Wim Gielis wrote: Wed Dec 23, 2020 6:17 pm Are you really sure that your process enters the Metadata and Data tabs ? Did you check the view settings ?
I often put a ProcessQuit at the end of Prolog then right-click the View that was created and Extract as text Data to check what has actually been assigned to each dimension in terms of subsets/elements. Won;t work with temp views/subsets.

I you have checked and the dimensions look correctly configured, you could try open the view but remember that it will not be zero suppressed for viewing unless you add have added ViewSuppressZeroesSet for testing.

Do you have a combination of N: and C: levels and/or rule based values? Per Emixam, you may need to check your ViewExtractSkipCalcsSet and ViewExtractSkipRuleValuesSet
Rtel
Posts: 59
Joined: Tue Nov 13, 2018 10:15 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2013

Re: ASCIIOUTPUT does not create output file

Post by Rtel »

Thank you for all the responses,

I will check if Meta and data sections are processed at all or not.

Also the view is already manually created and is used as a data source. The data in the view is rule derived.

Thanks

Rtel
beek
Posts: 63
Joined: Wed Sep 14, 2011 3:10 am
OLAP Product: TM1
Version: PA 2.0
Excel Version: Office 365

Re: ASCIIOUTPUT does not create output file

Post by beek »

Hi there,
Just like to ride on the topic. I am facing a problem at my end to asciioutput a file from data tab. Data source is cubeview. I have checked the cubeview (even from TM1 architect), confirm that view is not blank. But nothing appears when I tried to asciioutput the data. If I put the asciioutput at the Prolog, it works. I tried to asciioutput another cubeview, and I managed to do see the outputfile. Is there any setting that can prevent me from asciioutput certain cubes?
Wim Gielis
MVP
Posts: 3113
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: ASCIIOUTPUT does not create output file

Post by Wim Gielis »

The problem will be the data source, unless you see that other code in the Data (or Metadata) tab gets executed. You do need to make sure at runtime the correct view is used, including settings for skipping consolidated cells/zeroes/rules-calculated cells. 95 out of 100 there is your problem.
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
beek
Posts: 63
Joined: Wed Sep 14, 2011 3:10 am
OLAP Product: TM1
Version: PA 2.0
Excel Version: Office 365

Re: ASCIIOUTPUT does not create output file

Post by beek »

Hi Wim,
Thanks for responding to my thread. Yes, I made sure that view is the correct view. I put below in the Prolog tab.
DataSourceType = 'VIEW';
DatasourceNameForServer= s_SourceCube;
DatasourceCubeview=s_SourceView;

At first I suspected it was my coding that is having problem, then I try it with another cube (another smaller cube with viewer dimensions). And I managed to export the data. I really run out of idea on what else could I have missed.
In my last experiment, I try not to use any script at all, just select any view that I can see from the architect and put asciioutput in the datatab, nothing generated.
Wim Gielis
MVP
Posts: 3113
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: ASCIIOUTPUT does not create output file

Post by Wim Gielis »

If you have a process without any code, what are the settings of the view that you use in the Data source ? Are certain cells skipped from the view ? When removing any consolidated cells / zeroes / rules-calculated cells, do you have at least 1 cell remaining ?

Do you have the variables marked as Other in the Variables tab ? What is the exact AsciiOutput statement in the Data tab ?

Do you look in the correct folder for the generated file ? Maybe it is created in the Data directory and you look elsewhere. Or on the server and you are looking in a local folder.
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
beek
Posts: 63
Joined: Wed Sep 14, 2011 3:10 am
OLAP Product: TM1
Version: PA 2.0
Excel Version: Office 365

Re: ASCIIOUTPUT does not create output file

Post by beek »

Here's what I tested. I select a view from cube A (consists of 17 dims) from the Data Source tab. At the Variables, I set all to Others

At the Prolog, I use code
asciioutput('\\analyst-app\libraries\Lib\TM1\Cost\aaa.txt','zzzTEsting');
MetaData, i use code
asciioutput('\\analyst-app\libraries\Lib\TM1\Cost\aaa.txt','bbbTEsting');
DAta, i use code
asciioutput('\\analyst-app\libraries\Lib\TM1\Cost\aaa.txt','cccTEsting');

When I open the aaa.txt from the directory above, I can see only 1 line generated zzzTEsting.

Then I change another cubeview, cube B (Consists of 3 dims) from the Data Source tab. I keep Derived Variables only when prompted, and at the VAriables, I set all to Others.
I did not change anything from prolog to Data. Run the process, and I can see 500KB file generated for aaa.txt, lines containing cccTEsting is generated in the file.

Note: Both cubeview I use are the cubeviews I can open from Architect and contained some data. Is there anything I could further check on?

Anyway, I will try to request for a server restart and see if it will magically solve the problem I'm facing here.
User avatar
Alan Kirk
Site Admin
Posts: 6606
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: ASCIIOUTPUT does not create output file

Post by Alan Kirk »

beek wrote: Mon Apr 12, 2021 1:01 am Here's what I tested. I select a view from cube A (consists of 17 dims) from the Data Source tab. At the Variables, I set all to Others

At the Prolog, I use code
asciioutput('\\analyst-app\libraries\Lib\TM1\Cost\aaa.txt','zzzTEsting');
MetaData, i use code
asciioutput('\\analyst-app\libraries\Lib\TM1\Cost\aaa.txt','bbbTEsting');
DAta, i use code
asciioutput('\\analyst-app\libraries\Lib\TM1\Cost\aaa.txt','cccTEsting');

When I open the aaa.txt from the directory above, I can see only 1 line generated zzzTEsting.
You can't write to the same filename from multiple tabs. Each tab generates its own files. IF you had data in your view (which you clearly don't from TI's perspective; I'll come back to that), then the Metadata aaa.txt file would overwrite the prolog aaa.txt tab, and would in turn be overwritten by the Data version of the aaa.txt file. The fact that that isn't happening, and that the content is only what is written in the Prolog tab, tells you that the Metadata and Data tabs are not executing. And the reason that they aren't is that there is no data to process.
beek wrote: Mon Apr 12, 2021 1:01 am Then I change another cubeview, cube B (Consists of 3 dims) from the Data Source tab. I keep Derived Variables only when prompted, and at the VAriables, I set all to Others.
I did not change anything from prolog to Data. Run the process, and I can see 500KB file generated for aaa.txt, lines containing cccTEsting is generated in the file.

Note: Both cubeview I use are the cubeviews I can open from Architect and contained some data. Is there anything I could further check on?
Interesting. Not relevant, but interesting.

Wim has already told you what the most likely cause is:
Wim Gielis wrote: Sat Apr 10, 2021 8:49 pmThe problem will be the data source, unless you see that other code in the Data (or Metadata) tab gets executed. You do need to make sure at runtime the correct view is used, including settings for skipping consolidated cells/zeroes/rules-calculated cells. 95 out of 100 there is your problem.
When you use a view as a data source, by default the consolidated elements are skipped. This is not the case in a cube view which you look at in Cube Viewer. If you have one or more consolidations and no N elements in even ONE of your dimensions, and the data source is skipping calculations (that is, consolidations), then the fact that cube viewer will happily show you the consolidated elements has no bearing on whether those elements will be used when the view is processed by TI as a data source. That will instead come down to your skip calculations setting.

This is why, unless you actually WANT consolidations to be exported (in which case you ensure that the Skip Calculated Values box is UNchecked OR you use the ViewExtractSkipCalcsSet function in the prolog), you need to create a view with at least SOME N level elements in each dimension.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
beek
Posts: 63
Joined: Wed Sep 14, 2011 3:10 am
OLAP Product: TM1
Version: PA 2.0
Excel Version: Office 365

Re: ASCIIOUTPUT does not create output file

Post by beek »

Alan Kirk wrote: Mon Apr 12, 2021 1:52 am When you use a view as a data source, by default the consolidated elements are skipped
This is something I missed out. The default behaviour of cubeview. I thought if I use the view which I can see from the architect in the TI, Data tab will be reading it too. Thank you for highlighting this. Yes, this solves my problem.
User avatar
gtonkin
MVP
Posts: 1198
Joined: Thu May 06, 2010 3:03 pm
OLAP Product: TM1
Version: Latest and greatest
Excel Version: Office 365 64-bit
Location: JHB, South Africa
Contact:

Re: ASCIIOUTPUT does not create output file

Post by gtonkin »

Another thing I like to do when I have a view I am not 100% certain of is to right-click, then Export as text Data.
This lets you confirm the sets/members on each dimension and if you run the export, you should end up with data in a file per the view.

Per the previous posts though, you will need to check all your ViewExtractSkip settings too.
Post Reply