Hi Below code I have written in my prolog and when Iam not using parameter variable then it is taking a correct size backup fine i.e 360KB but when Iam using this parameter vatiable i.e model in below code then it is not taking correct size backup its showing as 1KB which is wrong.
Anyone has undergone with this type of scenario
Parameter variable name=model
### Saves all data from memory and sets up the variables
SaveDataAll();
sExec='\\bowtm1admtest1\C$\Program Files\7-Zip\7z.exe';
sBackupDir='\\bowtm1admtest1\E$\Data\TM1_Archives\';
sDataDir='\\bowtm1admtest1\E$\Data\model\';
### Defines the name to be used for the backup zip file
sFileName = model | TIMST(NOW(), '\Y\m\d \h.\i', 1) | '.zip';
### Defines the arguments to be used with the zip command
sArgs = ' a -tzip ';
sCommand = sExec | sArgs | '"' | sBackupDir | sFileName |'" "' | sDataDir | '"';
### Creates the zip
EXECUTECOMMAND (sCommand,0);
TM1_Archived Models
-
- Posts: 128
- Joined: Thu Dec 15, 2011 8:22 pm
- OLAP Product: TM1
- Version: 9.4
- Excel Version: 2003
Re: TM1_Archived Models
How to remove inverted quotes from parameter variable value inTM1,Is there any function?
I checked the value of parameter variable model contains model="OPS" but it should come as OPS folder...I think this is error.
I checked the value of parameter variable model contains model="OPS" but it should come as OPS folder...I think this is error.
- jim wood
- Site Admin
- Posts: 3961
- Joined: Wed May 14, 2008 1:51 pm
- OLAP Product: TM1
- Version: PA 2.0.7
- Excel Version: Office 365
- Location: 37 East 18th Street New York
- Contact:
Re: TM1_Archived Models
Moved to the correct forum. Why you posted this to the Cognos Planning forum is beyond me. No wonder you got no replies.
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
-
- Posts: 128
- Joined: Thu Dec 15, 2011 8:22 pm
- OLAP Product: TM1
- Version: 9.4
- Excel Version: 2003
Re: TM1_Archived Models
Sorry I didn't get you.Is this not a TM1 forum where I have post my problem.
This Errorcode which I have pasted is related to TM1 i.e IN TI process when I have pasted this code to run Then I was unable to archived my TM1 models.
This Errorcode which I have pasted is related to TM1 i.e IN TI process when I have pasted this code to run Then I was unable to archived my TM1 models.
- sachin
- Posts: 92
- Joined: Fri Jan 15, 2010 9:54 pm
- OLAP Product: Transformer,SSAS, EP, TM1
- Version: 7.3 2005 10.1 10.1.1
- Excel Version: 2013
- Contact:
Re: TM1_Archived Models
From what I understand, the param name in TI is "model" which takes value of OPS. If that is correct then, your definition of sDataDir is incorrect (also the font color choicedilip wrote:Hi Below code I have written in my prolog and when Iam not using parameter variable then it is taking a correct size backup fine i.e 360KB but when Iam using this parameter vatiable i.e model in below code then it is not taking correct size backup its showing as 1KB which is wrong.
sDataDir='\\bowtm1admtest1\E$\Data\model\';

sDataDir = '\\bowtm1admtest1\E$\Data\' | model | '\' ;
Check out my blog for some good information on TM1, SPSS
-
- Posts: 128
- Joined: Thu Dec 15, 2011 8:22 pm
- OLAP Product: TM1
- Version: 9.4
- Excel Version: 2003
Re: TM1_Archived Models
Awesome...code worked now...Thank you very much Sachin..
\' | model | '\'--here where I was making a mistake.I was using only model instead of '|model|';
The below code is working fine...if anyone want to archived model according to choice..Then below code will worked appropriate fine.In below code I have shown P0 is string parameter variable.
SaveDataAll();
#Datasourcenameforserver
#source locatio
#sExec = 'D:\prg\7-Zip\7z.exe';
sExec = 'C:\Program Files\7-Zip\7z.exe';
#target location
sBackupDir = 'C:\Program Files (x86)\ibm\cognos\tm1\samples\tm1\tm1_archive\';
#source folder
sDataDir ='C:\Program Files (x86)\ibm\cognos\tm1\samples\tm1\'| P0 |'\';
sFileName = P0| TIMST(NOW(), '\Y\m\d \h.\i', 1) | '.zip';
sArgs = ' a -tzip ';
sCommand = sExec | sArgs | '"' | sBackupDir | sFileName | '" "' | sDataDir | '"';
EXECUTECOMMAND(sCommand,0);
\' | model | '\'--here where I was making a mistake.I was using only model instead of '|model|';
The below code is working fine...if anyone want to archived model according to choice..Then below code will worked appropriate fine.In below code I have shown P0 is string parameter variable.
SaveDataAll();
#Datasourcenameforserver
#source locatio
#sExec = 'D:\prg\7-Zip\7z.exe';
sExec = 'C:\Program Files\7-Zip\7z.exe';
#target location
sBackupDir = 'C:\Program Files (x86)\ibm\cognos\tm1\samples\tm1\tm1_archive\';
#source folder
sDataDir ='C:\Program Files (x86)\ibm\cognos\tm1\samples\tm1\'| P0 |'\';
sFileName = P0| TIMST(NOW(), '\Y\m\d \h.\i', 1) | '.zip';
sArgs = ' a -tzip ';
sCommand = sExec | sArgs | '"' | sBackupDir | sFileName | '" "' | sDataDir | '"';
EXECUTECOMMAND(sCommand,0);