Page 1 of 1

ASCIIOUTPUT does not create output file

Posted: Fri Nov 20, 2020 6:17 pm
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

Re: ASCIIOUTPUT does not create output file

Posted: Fri Nov 20, 2020 6:45 pm
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.

Re: ASCIIOUTPUT does not create output file

Posted: Fri Nov 20, 2020 6:59 pm
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.

Re: ASCIIOUTPUT does not create output file

Posted: Fri Nov 20, 2020 7:36 pm
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

Re: ASCIIOUTPUT does not create output file

Posted: Fri Nov 20, 2020 7:37 pm
by Rtel
Sorry misspelled your name Wim

Re: ASCIIOUTPUT does not create output file

Posted: Mon Nov 23, 2020 10:48 am
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.

Re: ASCIIOUTPUT does not create output file

Posted: Wed Dec 23, 2020 6:06 pm
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 ?

Re: ASCIIOUTPUT does not create output file

Posted: Wed Dec 23, 2020 6:17 pm
by Wim Gielis
Are you really sure that your process enters the Metadata and Data tabs ? Did you check the view settings ?

Re: ASCIIOUTPUT does not create output file

Posted: Wed Dec 23, 2020 6:25 pm
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

Re: ASCIIOUTPUT does not create output file

Posted: Wed Dec 23, 2020 7:01 pm
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

Re: ASCIIOUTPUT does not create output file

Posted: Mon Jan 04, 2021 3:18 am
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

Re: ASCIIOUTPUT does not create output file

Posted: Sat Apr 10, 2021 8:45 pm
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?

Re: ASCIIOUTPUT does not create output file

Posted: Sat Apr 10, 2021 8:49 pm
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.

Re: ASCIIOUTPUT does not create output file

Posted: Sat Apr 10, 2021 9:00 pm
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.

Re: ASCIIOUTPUT does not create output file

Posted: Sat Apr 10, 2021 9:42 pm
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.

Re: ASCIIOUTPUT does not create output file

Posted: Mon Apr 12, 2021 1:01 am
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.

Re: ASCIIOUTPUT does not create output file

Posted: Mon Apr 12, 2021 1:52 am
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.

Re: ASCIIOUTPUT does not create output file

Posted: Mon Apr 12, 2021 2:12 am
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.

Re: ASCIIOUTPUT does not create output file

Posted: Mon Apr 12, 2021 12:01 pm
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.