Page 1 of 1
TM1_Archived Models
Posted: Fri Jul 17, 2015 7:19 am
by dilip
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);
Re: TM1_Archived Models
Posted: Fri Jul 17, 2015 8:27 am
by dilip
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.
Re: TM1_Archived Models
Posted: Fri Jul 17, 2015 11:57 am
by jim wood
Moved to the correct forum. Why you posted this to the Cognos Planning forum is beyond me. No wonder you got no replies.
Re: TM1_Archived Models
Posted: Fri Jul 17, 2015 1:05 pm
by dilip
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.
Re: TM1_Archived Models
Posted: Fri Jul 17, 2015 5:46 pm
by sachin
dilip 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\';
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 choice

). I believe it should be
sDataDir = '\\bowtm1admtest1\E$\Data\' | model | '\' ;
Re: TM1_Archived Models
Posted: Sat Jul 18, 2015 7:24 pm
by dilip
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);