on 07-27-2015 11:41 AM
Hello All,
We are trying to create a 'Clear' DM Package that avoids the User making any manual selections and is therefore low risk. Therefore, the user wants to have a Script logic created where in all the Dimensions are hardcoded to ALL except for a few which should have a Prompt in the Data Manager.
Following are the steps which I have created for this purpose.
1. Script Logic with below code
*XDIM_MEMBERSET TIME = %TIME_DIM%
*XDIM_MEMBERSET VERSION = %CATEGORY_DIM%
*XDIM_MEMBERSET ASSET = <ALL>
*XDIM_MEMBERSET COSTCENTER = <ALL>
*XDIM_MEMBERSET COSTELEMENT = <ALL>
*XDIM_MEMBERSET DATASRC = <ALL>
*XDIM_MEMBERSET PLANNED_ASSET = <ALL>
*XDIM_MEMBERSET LOCATION = %ENTITY_DIM%
*XDIM_MEMBERSET M_P = <ALL>
*XDIM_MEMBERSET RptCurrency = <ALL>
2. DM Package customization as below; (The above script not part of the below code)
PROMPT(SELECTINPUT,,,,"%ENTITY_DIM%,%CATEGORY_DIM%,%TIME_DIM%")
PROMPT(RADIOBUTTON,%CHECKLCK%,"Do you want to check Work Status when clearing?",1,{"Yes, delete comments with work status settings","No, do not delete comments with work status settings"},{"1","0"})
INFO(%SELECTION_KEYDATE%,)
TASK(/CPMB/CLEAR_CUBE,CHECKLCK,%CHECKLCK%)
TASK(/CPMB/CLEAR_CUBE,SELECTION,%SELECTION%)
TASK(/CPMB/CLEAR_CUBE,DUMPLOADMODE,3)
TASK(/CPMB/CLEAR_CUBE,KEYDATE,%SELECTION_KEYDATE%)
I am not calling the script from the above Data Manager package "Advance script" since the code assumes <ALL> i guess. If that is the case, should I create a Script for this purpose? If yes, can you please let me know if I should call the script in the Data Manager Package. Also, please let me know if the Script logic code in step 1 is correct since I only defined the scope.
Step 1 : Made a manual posting
Step 2: executed the Package with below selections
Step 3: Report check after the package run
The requirement is to call the script for performing the "CLEAR". Therefore, pls let me know if the script in step 1 should be part of Data Manager advanced script?
Also, would like to know if I do not include the step 1 in the Data Manger and execute as well, it is performing the same. Can I perform the same actions as performed now.
But final requirement by user is to have this called via script.
Thanks in advance,
Venkat
P.P.S. And for standard clear package (without script logic, using CLEAR process chain) - ALL for dimension is equivalent for nothing:
PROMPT(SELECTINPUT,,,,"%ENTITY_DIM%,%CATEGORY_DIM%,%TIME_DIM%")
is enough to provide user with LOCATION, TIME and VERSION selection. Other dimensions will have nothing - equivalent to ALL.
Vadim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, thanks Vadim. So can I conclude by only copying the "CLEAR" DM Package and customize the "ADVANCE SCRIPT" code as below with out creating a "Script Logic"? or pls. let me know if I have to make any other changes.
PROMPT(SELECTINPUT,,,,"%ENTITY_DIM%,%CATEGORY_DIM%,%TIME_DIM%")
PROMPT(RADIOBUTTON,%CHECKLCK%,"Do you want to check Work Status when clearing?",1,{"Yes, delete comments with work status settings","No, do not delete comments with work status settings"},{"1","0"})
INFO(%SELECTION_KEYDATE%,)
TASK(/CPMB/CLEAR_CUBE,CHECKLCK,%CHECKLCK%)
TASK(/CPMB/CLEAR_CUBE,SELECTION,%SELECTION%)
TASK(/CPMB/CLEAR_CUBE,DUMPLOADMODE,3)
TASK(/CPMB/CLEAR_CUBE,KEYDATE,%SELECTION_KEYDATE%)
Thanks in advance,
Best Regards,
Venkat
Script logic is not necessary for the requirements you have!
Customization for the advances DM script will be:
Original:
PROMPT(SELECT,%SELECTION%,,"Select the members to CLEAR",%DIMS%,0)
PROMPT(RADIOBUTTON,%ENABLETASK%,"Do you want to clear comments associated with the data region?",1,{"Yes","No"},{"1","0"})
PROMPT(RADIOBUTTON,%CHECKLCK%,"Do you want to check Work Status when clearing?",1,{"Yes, delete comments with work status settings","No, do not delete comments with work status settings"},{"1","0"})
PROMPT(RADIOBUTTON,%CHECKJOUR%,"Exit the package if journal data encountered (no change will be committed)?",0,{"Yes","No"},{"1","0"})
INFO(%SELECTION_KEYDATE%,)
TASK(/CPMB/CLEAR_CUBE,CHECKLCK,%CHECKLCK%)
TASK(/CPMB/CLEAR_CUBE,SELECTION,%SELECTION%)
TASK(/CPMB/CLEAR_CUBE,DUMPLOADMODE,3)
TASK(/CPMB/CLEAR_CUBE,KEYDATE,%SELECTION_KEYDATE%)
TASK(/CPMB/CLEAR_COMMENTS_FOR_CLEAR,SELECTION,%SELECTION%)
TASK(/CPMB/CLEAR_COMMENTS_FOR_CLEAR,ENABLETASK,%ENABLETASK%)
TASK(/CPMB/CLEAR_COMMENTS_FOR_CLEAR,CHECKLCK,%CHECKLCK%)
TASK(/CPMB/CLEAR_COMMENTS_FOR_CLEAR,CHECKJOUR,%CHECKJOUR%)
Custom:
PROMPT(SELECTINPUT,%SELECTION%,,"Select the desired data range:","%ENTITY_DIM%,%CATEGORY_DIM%,%TIME_DIM%")
PROMPT(RADIOBUTTON,%CHECKLCK%,"Do you want to check Work Status when clearing?",1,{"Yes, delete comments with work status settings","No, do not delete comments with work status settings"},{"1","0"})
INFO(%SELECTION_KEYDATE%,)
TASK(/CPMB/CLEAR_CUBE,CHECKLCK,%CHECKLCK%)
TASK(/CPMB/CLEAR_CUBE,SELECTION,%SELECTION%)
TASK(/CPMB/CLEAR_CUBE,DUMPLOADMODE,3)
TASK(/CPMB/CLEAR_CUBE,KEYDATE,%SELECTION_KEYDATE%)
TASK(/CPMB/CLEAR_COMMENTS_FOR_CLEAR,SELECTION,%SELECTION%)
TASK(/CPMB/CLEAR_COMMENTS_FOR_CLEAR,ENABLETASK,1)
TASK(/CPMB/CLEAR_COMMENTS_FOR_CLEAR,CHECKLCK,%CHECKLCK%)
TASK(/CPMB/CLEAR_COMMENTS_FOR_CLEAR,CHECKJOUR,0)
Vadim
P.S. Even if you need to fix some dimensions to some specific members you still can customize advanced DM script...
Script logic is required if you need to have some complex user input. For example if you want to ask user to provide TIME members in the FROM - TO way...
And in script logic it's better to use *RUNALLOCATION *FACTOR=0... - faster!
Vadim
Easy:
TASK(/CPMB/CLEAR_CUBE,SELECTION,%SELECTION%DIMENSION:M_P|M|)
TASK(/CPMB/CLEAR_COMMENTS_FOR_CLEAR,SELECTION,%SELECTION%DIMENSION:M_P|M|)
Or you can define variable using info:
INFO(%HARDCODEDDIM1%,DIMENSION:M_P|M|)
and then:
TASK(/CPMB/CLEAR_CUBE,SELECTION,%SELECTION%%HARDCODEDDIM1%)
TASK(/CPMB/CLEAR_COMMENTS_FOR_CLEAR,SELECTION,%SELECTION%%HARDCODEDDIM1%)
Vadim
Vadim,
Can you pls. test from your end as well once? When i tried with the below code, it is deleting both "M" as well as "P".
Please see my final code below
PROMPT(SELECTINPUT,,,,"%ENTITY_DIM%,%CATEGORY_DIM%,%TIME_DIM%")
PROMPT(RADIOBUTTON,%CHECKLCK%,"Do you want to check Work Status when clearing?",1,{"Yes, delete comments with work status settings","No, do not delete comments with work status settings"},{"1","0"})
INFO(%SELECTION_KEYDATE%,)
INFO(%HARDCODEDDIM1%,DIMENSION:M_P|M|)
TASK(/CPMB/CLEAR_CUBE,CHECKLCK,%CHECKLCK%)
TASK(/CPMB/CLEAR_CUBE,SELECTION,%SELECTION%)
TASK(/CPMB/CLEAR_CUBE,DUMPLOADMODE,3)
TASK(/CPMB/CLEAR_CUBE,KEYDATE,%SELECTION_KEYDATE%)
TASK(/CPMB/CLEAR_CUBE,SELECTION,%SELECTION%%HARDCODEDDIM1%)
My Testing includes;
1. POstings on both M and P
2. My DM selections for CLEAR
3. Report after CLEAR package run
Thanks in advance,
Regards,
Venkat
This is the code which I included and tested.
PROMPT(SELECTINPUT,,,,"%ENTITY_DIM%,%CATEGORY_DIM%,%TIME_DIM%")
PROMPT(RADIOBUTTON,%CHECKLCK%,"Do you want to check Work Status when clearing?",1,{"Yes, delete comments with work status settings","No, do not delete comments with work status settings"},{"1","0"})
INFO(%SELECTION_KEYDATE%,)
INFO(%HARDCODEDDIM1%,DIMENSION:M_P|M|)
TASK(/CPMB/CLEAR_CUBE,CHECKLCK,%CHECKLCK%)
TASK(/CPMB/CLEAR_CUBE,SELECTION,%SELECTION%)
TASK(/CPMB/CLEAR_CUBE,DUMPLOADMODE,3)
TASK(/CPMB/CLEAR_CUBE,KEYDATE,%SELECTION_KEYDATE%)
TASK(/CPMB/CLEAR_CUBE,SELECTION,%SELECTION%%HARDCODEDDIM1%)
TASK(/CPMB/CLEAR_COMMENTS_FOR_CLEAR,SELECTION,%SELECTION%%HARDCODEDDIM1%)
Do you see your mistake - only one line is corrected:
This one - is not corrected:
TASK(/CPMB/CLEAR_CUBE,SELECTION,%SELECTION%)
Have to be:
TASK(/CPMB/CLEAR_CUBE,SELECTION,%SELECTION%%HARDCODEDDIM1%)
Other lines missing:
TASK(/CPMB/CLEAR_COMMENTS_FOR_CLEAR,ENABLETASK,1)
TASK(/CPMB/CLEAR_COMMENTS_FOR_CLEAR,CHECKLCK,%CHECKLCK%)
TASK(/CPMB/CLEAR_COMMENTS_FOR_CLEAR,CHECKJOUR,0)
Vadim
Please see the screen shot below
Details of the Log below:
/CPMB/MODIFY completed in 0 seconds
/CPMB/CLEAR_COMMENTS_FOR_CLEAR completed in 0 seconds
/CPMB/CLEAR_CUBE completed in 1 seconds
/CPMB/CLEAR completed in 0 seconds
[Selection]
--------------------------------------------------------------
SELECTION = /PYRAMID/MOH_DEP/PRIVATEPUBLICATIONS/09154255/TempFiles/FROM.TMP@@@SAVE@@@@@@EXPAND@@@|DIMENSION:LOCATION|8905|DIMENSION:TIME|2014.OCT|DIMENSION:VERSION|AOP2
CHECKLCK = Yes
[Message]
--------------------------------------------------------------
Task name CLEAR CUBE DATA:
Submit count: 2
Reject count: 0
model: MOH_DEP. Package status: SUCCESS
Test exactly this code:
PROMPT(SELECTINPUT,%SELECTION%,,"Select the desired data range:","%ENTITY_DIM%,%CATEGORY_DIM%,%TIME_DIM%")
PROMPT(RADIOBUTTON,%CHECKLCK%,"Do you want to check Work Status when clearing?",1,{"Yes, delete comments with work status settings","No, do not delete comments with work status settings"},{"1","0"})
INFO(%SELECTION_KEYDATE%,)
INFO(%HARDCODEDDIM1%,|DIMENSION:M_P|M|)
TASK(/CPMB/CLEAR_CUBE,CHECKLCK,%CHECKLCK%)
TASK(/CPMB/CLEAR_CUBE,SELECTION,%SELECTION%%HARDCODEDDIM1%)
TASK(/CPMB/CLEAR_CUBE,DUMPLOADMODE,3)
TASK(/CPMB/CLEAR_CUBE,KEYDATE,%SELECTION_KEYDATE%)
TASK(/CPMB/CLEAR_COMMENTS_FOR_CLEAR,SELECTION,%SELECTION%%HARDCODEDDIM1%)
TASK(/CPMB/CLEAR_COMMENTS_FOR_CLEAR,ENABLETASK,1)
TASK(/CPMB/CLEAR_COMMENTS_FOR_CLEAR,CHECKLCK,%CHECKLCK%)
TASK(/CPMB/CLEAR_COMMENTS_FOR_CLEAR,CHECKJOUR,0)
I have slightly changed the line:
INFO(%HARDCODEDDIM1%,|DIMENSION:M_P|M|) - "|" added in front of variable.
Vadim
P.S. And your Advanced DM script is absolutely not related to the script logic...
Please, clearly specify you requirements:
What do you want to be entered by user and what has to be fixed in the code! For ALL dimensions in the cube!
Vadim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vadim,
The requirement is the user wants to have a Script called when for "CLEARING" the data when we execute the "CLEAR" Package. Currently, we are selecting all the fields when we execute the "CLEAR" package. Th reason is to restrict other users is to restricting them from changing all the other Dimension members except for 3 Dimensions "Location", "Category and "Time" which has to be selected by the users. For e.g, I have records in the data model.
Location Category Time Asset CostCenter Cost Element Currency Signedata
India AOP1 2015.JAN 1 NO_CC NO_CE INR 1000
India AOP1 2015.JAN 5 12345 12345 INR 4000
India AOP2 2015.JAN 2 NO_CC NO_CE INR 5000
Ireland AOP1 2015.JAN 2 NO_CC NO_CE EUR 2000
Users, when they execute the DM Package "CLEAR", they should be able to change "Location", "Category" and "Time" and the rest of the Dimensions should be "ALL"members based on the Prompts selections.
Fields to be entered by the Users are;
Location - India
Category - AOP1
Time - 2015.JAN
The first 2 records from the above example should be cleared and rest has to remain.
I hope i have answered your question, If not, pls. let me know.
Regards,
Venkat
Hi Venkat,
But in your script logic I can see only scope declaration statements - no data to be written! Have you missed a part of script?
Vadim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
16 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.