Business rules macros

Hi,
Anybody used macros in business rules? If yes, can you please provide some info on pros and cons of marros in business rules
1. We are using global variables
2. Some implementing company proposing macros and in the macros all the common stuff like house keeping things, fix statements etc.
I have not seen any company putting house keeping things in macros.
Thank you
Venky

Anybody used macros in business rules?^^^I use macros all the time for commonly used snippets of code all the time.
1. We are using global variables ^^^Not a problem. Declare them at a global level, use them in the macro.
2. Some implementing company proposing macros and in the macros all the common stuff like house keeping things, fix statements etc.^^^I don't use them that way.
Typically, I write the code once in good old Calc Script Editor, then copy into HBR (the EAS editor for HBRs finally tabs correctly), then replace with global variables. Once I id common code across HBRs (or if I'm clever, and actually think ahead), I remove that code block and stick it into a macro.
Could you stick a FIX statement and other things into a macro? Sure, I do it all the time.
Do I use macros exclusively for FIXes and other housekeeping items? Only if they were being repeated again and again. I would wonder if that really made sense as those are the bits of code that tend to change over time as the app changes -- do you really want that to happen to all HBRs that use the macro? Maybe, maybe not.
Regards,
Cameron Lackpour

Similar Messages

  • Calc script, Business rule and business rule macro

    Hi John,
    Can we use calc script , BR sequence and a BR macro against different databases at a single go.
    In one calc script or BR sequence or BR macro itself can i calculate 2 databases

    If possible could you not start every post with my name, there are lots of others helping on this forum and they provide excellent answers
    Calc Scripts run against one database.
    Sequences can contain multiple business rules, in the launch variables you can set the database to run against for each rule (outside of the planning application though)
    Macros are called from a business rule and are run against the database the calling rule is being run against.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Business rules and calculation manager

    Hi ,
    Could anyone pls tell me the difference between the calculation manager and business rules?

    Calculation manager is a web component that is designed to manage business rules from a web interface. It is enabled to build calculations also using a graphic interface, although this mode is more suitable for simple calculations than for complex ones. Calculation manager allows you also to use complex templates that you can customize with prompts in order to adapt them to each rule without being force to change the code. Basically it is an evolution of the essbase business rules macro function. Once a business rule is created it has to be deployed in order to be used with planning applications. The deploy activity copies the rule on the database, both in the calculation manager tables in and the planning tables.
    Business rules are instead essbase artifacts. They aren't available any more from version 11.1.2.2 on.
    In versions older than the 11.1.2.2 you were forced to use calculation manager for epma applications, while essbase business rules were used in classic applications. In terms of calculations there is no difference between the two technologies, they behave exactly in the same way. There is only a small difference in the prompts syntax, {} in calculation manager and [] in essbase business rules.
    Although i find the calculation manager web editor quite slow and imprecise to use, I anyway advice to use it in order to make eventual release upgrades easier.

  • Migrate business rules (disaster recovery)

    I need a plan to be able to recover all my business rules/macros/sequences/projects/security in case of a disaster. Can some one suggest the best way to do this? I'll appreciate if some one can provide a step by step solution that can be automated.
    thanks
    Edited by: user507721 on Dec 2, 2010 1:14 PM

    9.3. That's what we do right now. But it involves manual intervention. Since I want it for DR, I wanted to automate the export so that I don't have to kick it off regularly and have an xml from production in case of any disaster. Is there a way to automate this process?

  • Error Validating Business Rule in Calculation Manager (@_AT) ?

    I have migrated an 11.1.1.3 business rule and two macros (templates) into Calculation Manager 11.1.2.2. When I validate the script I get the following error. Has anybody seen this before or have any guidance? The script syntax checks ok.
    "An error occurred in: Rule:FCO_3YrBud_DGAlloc Error:Error parsing formula for [FIX STATEMENT] (line 24): Expected [(] found [@_AT] after function name Rule FCO_3YrBud_DGAlloc "
    Line 24 is the first FIX statement in the script show below:
    SET UPDATECALC OFF; SET AGGMISSG OFF;
    %Template(name:="FCOm_TargetSection",application:="FCO",plantype:="FCO",dtps:=("parm1":=([["Three Year Budget"]]),"parm2":=([["DGAllocation"]]),"parm3":=([[{FCOrtpYears}]]),"parm4":=([[Mar]])))
    %Template(name:="FCOm_TargetAgg",application:="FCO",plantype:="FCO",dtps:=("parm1":=([["Three Year Budget"]]),"parm2":=([["DGAllocation"]]),"parm3":=([[{FCOrtpYears}]]),"parm4":=([[Mar]])))
    First template:
    SET UPDATECALC OFF; SET AGGMISSG OFF;
    FCOm_TargetSection
    parm1 = scenario
    parm2 = version
    parm3 = years
    parm4 = periods
    The purpose of this macro is to translate Target input to GBP and copy to Curr NA and aggreggated. Step1: Copy inputs to Total Section to I/P Total Section and No Project Step1: Copy inputs to Converted Currency - no need to translate as all inputs are in GBP Step2: Copy Input GBP values to Curr NA
    FIX(([["Three Year Budget"]]),([["DGAllocation"]]),([["FY15"]]),([[Mar]]),@IDESCENDANTS("BH - T"), "Curr NA", "Baseline","Entered Currency","A - 6111","A - 6112","A - 6113","A - 65","A - 66","A - 620905")
    DATACOPY "Total Section" TO "Input_Total Section";
    DATACOPY "Total Section" TO "No Project";
    ENDFIX
    FIX(([["Three Year Budget"]]),([["DGAllocation"]]),([["FY15"]]),([[Mar]]),@IDESCENDANTS("BH - T"), "Curr NA","Total Section", "Input_Total Section", "No Project","Baseline","A - 6111","A - 6112","A - 6113","A - 65","A - 66","A - 620905")
    DATACOPY "Entered Currency" TO "Converted Currency (GBP)";
    ENDFIX
    FIX(([["Three Year Budget"]]),([["DGAllocation"]]),([["FY15"]]),([[Mar]]),@IDESCENDANTS("BH - T"), "Total Section","Input_Total Section","No Project", "Baseline", "Entered Currency","Converted Currency (GBP)","A - 6111","A - 6112","A - 6113","A - 65","A - 66","A - 620905")
    DATACOPY "Curr NA" TO "Input GBP";
    ENDFIX
    Second template:
    FCOm_TargetAgg
    parm1 = scenario
    parm2 = version
    parm3 = years
    parm4 = periods
    The purpose of this macro is to  aggreggate Target data Step2: Aggregate data
    FIX(([["Three Year Budget"]]),([["DGAllocation"]]),([["FY15"]]),([[Mar]]),"Baseline","Entered Currency","Converted Currency (GBP)")
    CALC DIM("Account","BudgetHolder","Input Currency","SectionProjects");
    ENDFIX

    Actually
    I have just been re thinking about your post. My comments above may not be correct for your situation. The Syntax above is correct if you are talking about the code "within" the template itself (So if you open the template and look at the code). But if the code you posted in your messages was from the script window of the rule (When in script mode) then your problem is something different potentially.
    So the first thing is to make sure that in the template itself (template open) the DTPs are defined in the global range or member range as [Parm1],[Parm2] etc (Or fix, depending on how the template is shown) as I said in my first response above, the template only defines the DTP, not the members and should be enclosed in square brackets, like [Parm1}. That will make sure the DTP as defined in your template correctly. Then we need to look at how you are defining those DTPs in the rule itself. Normally this is a lot easier if your rule is in graphical view, as you just click on the template and your can enter the values. As you have your rule in Script mode you need to be very careful in how you define the DTP values. Each DTP 'type' has different syntax in script mode.
    On looking at your script again I can see another problem potentially. When defining the values in the DTP's, the value needs enclosing with double square brackets, like so  [["Three Year Budget"]]. In your script you also have parenthesis. Which isn't always correct. There are times having parenthesis and double brackets is correct, but that is only when your DTP is type "Members", and by default I think old business rule macros will be translated into templates with the DTP types of "Script"
    So if you also amend your business section where the templates are defined to as below; (as you can see, no parenthesis around the DTP values).
    SET UPDATECALC OFF; SET AGGMISSG OFF;
    %Template(name:="FCOm_TargetSection",application:="FCO",plantype:="FCO",dtps:=("parm1":=[["Three Year Budget"]],"parm2":=[["DGAllocation"]],"parm3":=[[{FCOrtpYears}]],"parm4":=[[Mar]]))
    %Template(name:="FCOm_TargetAgg",application:="FCO",plantype:="FCO",dtps:=("parm1":=[["Three Year Budget"]],"parm2":=[["DGAllocation"]],"parm3":=[[{FCOrtpYears}]],"parm4":=[[Mar]]))
    The end game should be that when you open your rule and view in script mode and then select script tab down the bottom your templates should look as below, as you will see, all that should be shown in the script are the values substituted from the template definition, key point is that there are no brackets or Parenthesis. The script should show "pure" script. ( I have highlighted and underlined how those 4 DTPs should translate in the script view)
    First template:
    SET UPDATECALC OFF; SET AGGMISSG OFF;
    FCOm_TargetSection
    parm1 = scenario
    parm2 = version
    parm3 = years
    parm4 = periods
    The purpose of this macro is to translate Target input to GBP and copy to Curr NA and aggregated. Step1: Copy inputs to Total Section to I/P Total Section and No Project Step1: Copy inputs to Converted Currency - no need to translate as all inputs are in GBP Step2: Copy Input GBP values to Curr NA
    FIX("Three Year Budget","DGAlocation",FY15,Mar,@IDESCENDANTS("BH - T"), "Curr NA", "Baseline","Entered Currency","A - 6111","A - 6112","A - 6113","A - 65","A - 66","A - 620905")
    DATACOPY "Total Section" TO "Input_Total Section";
    DATACOPY "Total Section" TO "No Project";
    ENDFIX
    FIX("Three Year Budget","DGAlocation",FY15,Mar,@IDESCENDANTS("BH - T"), "Curr NA","Total Section", "Input_Total Section", "No Project","Baseline","A - 6111","A - 6112","A - 6113","A - 65","A - 66","A - 620905")
    DATACOPY "Entered Currency" TO "Converted Currency (GBP)";
    ENDFIX
    FIX("Three Year Budget","DGAlocation",FY15,Mar,@IDESCENDANTS("BH - T"), "Total Section","Input_Total Section","No Project", "Baseline", "Entered Currency","Converted Currency (GBP)","A - 6111","A - 6112","A - 6113","A - 65","A - 66","A - 620905")
    DATACOPY "Curr NA" TO "Input GBP";
    ENDFIX
    Thanks
    Anthony

  • Unable to open/edit Business rules v9.3

    Hello,
    I am unable to open/edit existing business rules in v9.3 in the AAS console. I get an error message: Exception occured: Please check your log for details.
    Business rules have been working without issues for months. I checked the easserver.log and it is getting a java.lang.nullpointerexception when I try to open/edit rules. I have done all the normal checks/updates: restarted services, rebooted servers, checked provisioning, refreshed security from shared services, refreshed planning to essbase, logged into Planning first, etc.
    I believe the issue occured when a business rule was deleted which "may" have been included in a sequence. Since I cannot open any BRs or sequences I cannot validate that assumption.
    Another side note, I can create a BR and attached it to a location, but once I save it I am unable to open it. I have started looking thru the tables in the AAS RDB but it "seems" ok.
    Any help would be appreciated!

    Hi,
    I have not come across this sort of issue before, if you don't find a solution then as a final measure I would backup up the repository and export all the rules/macros/variables etc to xml.
    Then I would first redeploy the web application server and see if that helps, if not I would reconfigure the database and drop it and then import the xml back in.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How to Load Business Rule XML in 9.3.1

    Hello,
    I am using EAS 9.3.1. On the Business Rules component, I selected Export Business Rules, and it invited me to export all business rules, variables, macros, and projects into one xml file. Now I cannot figure out how to load that xml file. I am copying from a production environment to a development environment, because we moved the database of the development environment to another server. I have reconfigured the applications and databases. What do I have to do to load the xml file?
    Thank you,

    Thank you. I was getting the following error, and I thought it meant, I cannot expand the Business Rules icon because I did not have any business rules. If this something I configured incorrectly, or something the DBA missed?
    Error logging in to Business Rules. The repository has not been configured or you are not authorized to use Business Rules.
    Detail:Error creating DBConfig object. Please check if there are exceptions in the log file and if HBR is configured correctly.
    Detail:null

  • 9.3.3 Upgrade, null pointer exception when accessing business rules and mac

    Hello,
    We upgraded from 9.3.1 to 9.3.3. In the Essbase Administration Services Console, when I attempt to access business rules or macros from a client PC, we get a null pointer exception. The message does not tell us much, but I cannot find more.
    I can access business rules and macros using EAS Console from the server. Do I have a bad installation, or have I missed a step?
    Thank you,

    Hi,
    You might have to re-organize your application module hierarchy to place your common code.
    If your intension is to auto populate the primary key for your Entity Objects., I would suggest below common practice.
    1). Create a Base Entity Impl class for your project that extends oracle.jbo.server.EntityImpl
    2). Code your getDbSequence() method inside this base entity impl class
    3). Make sure that all your Entity Objects extend your base entity impl class
    4). Use EL expression to call this method for auto-generating primary key attribute of your Entity Object.
    e.g., adf.object.getDbSequence("sequenceName")
    Regards,
    Eshwar

  • Business Rules - Repository View

    Hi All,
    I am going through the Business Rules Option in the EAS Console. Regarding to this I have doubts on:
    1) I saw, Rules Link. What is this? Is this also a Business Rule?
    2) I saw Macros. What is this used for?
    3) Global Variables. I know, this will be the variable declaration area.
    4) Projects..
    Can you please explain me on what kind of scripts can be stored under each Links. Even the Script under Rule link is also a Business Ruel?
    Please suggest me to any documents for the same.
    Regards,
    Upendra Bestha....

    Hi,
    If you have a read of :- http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/html_hbradmin/frameset.htm?ch02.html
    It should answer all the questions you have asked.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Planning : migration security of business rules

    Hello,
    Unfortunetly the migrator for business rules (v. 9.2.0.3) don't migrate the security. Do somebody have a solution to migrate the securtiy with the business rules ? And, is there a solution to associate the BR with the forms automatically ?
    Thank you

    It's almost easier to treat the migration of rules as text objects.
    Basically cut/paste the rules, store in a repository as you would other source code a, cut/paste to target environment. This means the security on the rules in the target environment for existing rules is retained. Now for new rules you would have to provision the rules. The XML export does have a known issue with really large business rules (those about 485k or so when in text form) whereas the cut/paste method will always work. Now if you do have large rules, you can use Macros or Sequences to break up the size.
    Your process ends up being dictated by corporate policy and the roles assigned to various individuals.
    Regards,
    -John

  • Error in migrating business rules

    Hi,
    We are moving from Dev to QA. In order to migrate business rules, i exported all the rules,global variables and macros by unchecking the calc manager option. Now i replaced all the occurences of my old server name in the xml file with the new server name. Now when i try to open the business rule i get "java.lang.nullpointerexception". Is this any installation issue or i have dont migration wrongly? And i am not able to associate with the outline since i get this error.
    What could be the solution?
    Regards,
    Ragav.

    Have to clicked on the dependents while exporting the rules?
    and anyways you can copy and paste the rules from one server to another.
    Suggestion:
    Copy export a rule first, make proper changes and import that rule, rather then going for bulk.
    If ur on system 11 use LCM.

  • Migrate Business Rules from 9.x to 11.x

    I am trying to migrate business rules from 9.21 to V11.1.1.3
    I used to export the rules, then edit the XML for the correct server and location names, then import into the target server-all with 9.21
    Now when I try the same process, I get this error when importing into V11.1.13
    Detail:Error while importing object properties.
    Detail:com.hyperion.hbr.beans.UserObjAccessFilter.setUserGroupName(java.lang.String)
    I can use the migrate repository option just fine, but then I have to go in with a SQL script and update the location and server names in the relational tables. I prefer the export/import since I can do that without impacting users.
    Any ideas on how to import the rules and resolve this error?
    Thanks
    Jeff

    Hmm no luck with one rule that has no security assigned to it. and no luck with one project with no security.
    Here is the xml for 1 rule that won't import:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <HBRObjects>
    - <Rules>
    - <Rule>
    <property class="java.lang.String" method="setBody" value="ACED00057372001E636F6D2E6879706572696F6E2E6862722E636F72652E52756C65426F6479047B4D7ABDC064F60200065A000564697274795A000B697347726170686963616C4C0007636F6D6D656E747400124C6A6176612F6C616E672F537472696E673B4C000A636F6D706F6E656E747374002C4C636F6D2F6879706572696F6E2F6862722F67726170686963616C2F47726170686963616C566563746F723B4C000872756C655465787471007E00014C000473616C3071007E000178700000740000707402192F2A4553535F4C4F43414C4520456E676C6973685F556E697465645374617465732E4C6174696E314042696E6172792A2F0A534554204147474D49535347204F4E3B0A5345542055504441544543414C4320204F46463B0A0A46495820284275646765742C20223173742050617373222C20264375727242756459722C20404C45564D4252532822506572696F64222C2030292C4072656C61746976652822546F74616C20456D706C6F79656573222C30292C4052454C41544956452822546F74616C20436F6D70616E79222C3029290A0A2043414C432044494D2028224163636F756E7422293B0A0A22456D706C6F79656520546178657322203D2022456D706C6F79656520546178205261746520496E707574222D3E224E6F20456E74697479222D3E224E6F20456D706C6F79656522202A2022546F74616C2053616C617279223B0A0A22456D706C6F7965652042656E656669747322280A0A494620282246542F505422203D3D31290A0A22456D706C6F7965652042656E6566697473223D2242656E65666974205261746520496E707574222D3E224E6F20456E74697479222D3E224E6F20456D706C6F7965652220202A2022546F74616C2053616C617279223B0A454C53450A22456D706C6F7965652042656E6566697473223D234D495353494E473B0A454E4449460A290A454E444649580A0A43414C432044494D202822456D706C6F796565222C456E74697479293B0A0A0A71007E0004" />
    <property class="java.lang.String" method="setMetadataReferences" value="" />
    <property class="java.lang.String" method="setDefMetaDataRepo" value="Planning/balt-hypplan/CorpBud/Eeplan" />
    <property class="java.lang.String" method="setBodyAsCalcScript" value="/*ESS_LOCALE English_UnitedStates.Latin1@Binary*/ SET AGGMISSG ON; SET UPDATECALC OFF; FIX (Budget, "1st Pass", &CurrBudYr, @LEVMBRS("Period", 0),@relative("Total Employees",0),@RELATIVE("Total Company",0)) CALC DIM ("Account"); "Employee Taxes" = "Employee Tax Rate Input"->"No Entity"->"No Employee" * "Total Salary"; ENDFIX CALC DIM ("Employee",Entity);" />
    <property class="java.lang.String" method="setName" value="Corp-EE Benefits & Taxes Calc" />
    <property class="long" method="setLastModified" value="1211738336600" />
    <property class="java.lang.String" method="setVersion" value="" />
    <property class="int" method="setId" value="220" />
    <property class="java.lang.String" method="setDescription" value="" />
    <property class="java.lang.String" method="setOwner" value="native://DN=cn=911,ou=People,dc=css,dc=hyperion,dc=com?USER" />
    <property class="int" method="setObjectType" value="1" />
    <property class="boolean" method="setEditable" value="false" />
    <property class="boolean" method="setLocked" value="false" />
    <property class="java.lang.String" method="setLockedBy" value="0" />
    <property class="java.lang.String" method="setUpperName" value="CORP-EE BENEFITS & TAXES CALC" />
    <property class="java.lang.String" method="setModifiedBy" value="native://DN=cn=911,ou=People,dc=css,dc=hyperion,dc=com?USER" />
    <property class="java.lang.String" method="setOpenForEditingBy" value="0" />
    <property class="boolean" method="setOpenForEditing" value="false" />
    </Rule>
    </Rules>
    <Macros />
    <Variables />
    <Sequences />
    <Projects />
    <RuleMacroLinks />
    <RuleVariableLinks />
    <MacroMacroLinks />
    <MacroVariableLinks />
    <SequenceItemLinks />
    <SeqPrompts />
    <ProjectItemLinks />
    - <UserObjAccessFilters>
    - <UserObjAccessFilter>
    <property class="int" method="setObjectID" value="220" />
    <property class="int" method="setObjectTypeID" value="1" />
    <property class="int" method="setLocationID" value="9" />
    <property class="int" method="setTaskID" value="2" />
    <property class="java.lang.String" method="setUserGroupID" value="0" />
    <property class="int" method="setUserGroupTypeID" value="0" />
    <property class="boolean" method="setSearchNoLoc" value="false" />
    <property class="boolean" method="setSearchNoUser" value="false" />
    <property class="boolean" method="setSearchNoObj" value="false" />
    <property class="boolean" method="setSearchNoTask" value="false" />
    <property class="java.lang.String" method="setUserGroupName" value="" />
    </UserObjAccessFilter>
    </UserObjAccessFilters>
    - <Locations>
    - <Location>
    <property class="int" method="setCluster" value="0" />
    <property class="java.lang.String" method="setLocation" value="Planning/balt-hypplan/CorpBud/Eeplan" />
    <property class="int" method="setLocID" value="9" />
    <property class="java.lang.String" method="setUpperLocation" value="PLANNING/BALT-HYPPLAN/CORPBUD/EEPLAN" />
    </Location>
    </Locations>
    </HBRObjects>
    I see the setUserGroupName property class and it is empty..

  • Business Rule using Exclude

    I'm using Essbase 9.3.1, trying to make a business rule work with an exclusion. I can make the rule work with this:
    (@Level_0_Descendants("GROSS EXPENSES")) AND NOT ("1447")
    but I add more than one to the Exclude:
    (@Level_0_Descendants("GROSS EXPENSES")) AND NOT ("1447", "0008")
    The Business rule won't run, looking at the source code:
    Error Code: LAN002
    +Error Args: [Ljava.lang.Object;@43b884+
    ClassName: com.hyperion.hbr.excp.LanguageException
    Exception Encountered "," at line 1, column 148.
    Was expecting one of:
    +<RIGHTPARENTHESIS> ...+
    +"and" ...+
    +"or" ...+
    ClassName: java.lang.Exception
    Syntax error while parsing AFMIC ER&W 51667 - Geo Alloc - TEST.
    Anybody had luck with more than one exclusion?

    Well, I was able to replicate your issue in 11.1.1 -- I don't use the graphical editor very much so there may be something we're both doing incorrectly although I can't see what that issue might be. Maybe someone else can chime in.
    I wonder if it's a known issue -- it's so easy (and obvious) to select more than one member down into that excluded box.
    If it is a defect, it appears to be carried over to 11x.
    Per Glenn's comment, to get around this, you are going to need to do this as a non-graphical BR.
    If this is not the way you like to work, you might think about making the FIX..ENDFIX bits as two macros and then create yet another macro to contain the graphical code in between.
    I am not a fan of the graphical editor because of its generally poor performance and would just write the entire thing as an Enhanced BR.
    Regards,
    Cameron Lackpour

  • Changes at once to all Business rules

    Hi All,
    I am having a requirement where I need to do some changes in all my Business Rules at one time which is related to the script content. How can I achieve this task?? From where and all I need to fetch for the scripts information. I would appreciate your suggestions. I using Planning 9.3.1, windows env.

    Jockney also brings up a good point to use Macros where you have repetive code in your rules.
    If you are looking to run some type of script on all the rules and you have a few the VB code below can be used to export these to a text represenation.
    'Courtesy of John A. Booth
    'Save as export_rules.vbs
    'Replace SQLSERVERNAME AND AAS_CATALOG with their proper names for your environment
    'Currently writen to work with MS SQL Server
    'The id this executes as must have select access on the AAS_CATALOG
    'Large rules (> 40KB) will take some time to export. Small rules export very quickly.
    'CODE BEGINS
    Dim numRules
    Dim ID
    Dim length
    Dim index
    Dim headerSize
    Dim fileName
    Dim rule
    headerSize = 233
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set rs = CreateObject("ADODB.Recordset")
    Set cnSS = CreateObject("ADODB.Connection")
    Set shellObj = CreateObject( "WScript.Shell" )
    if (fs.FolderExists(shellObj.ExpandEnvironmentStrings("%USERPROFILE%") & "\Desktop\rules") = False) Then
    fs.CreateFolder (shellObj.ExpandEnvironmentStrings("%USERPROFILE%") & "\Desktop\rules")
    End If
    cnSS.Open "Provider=sqloledb;" & "Data Source=SQLSERVERNAME;" & "Initial Catalog=AAS_CATALOG;" & "Integrated Security=SSPI"
    strQuery = "Select max(id) from hbrrules"
    rs.Open strQuery, cnSS
    If (rs.EOF <> True) Then
    numRules = rs.fields(0)
    For ID = 1 To numRules
    rule = ""
    strQuery = "Select name from hbrrules where id=" & ID
    rs.Close
    rs.Open strQuery, cnSS
    If (rs.EOF <> True) Then
    fileName = rs.fields(0)
    rs.Close
    strQuery = "Select body from hbrrules where id=" & ID
    Set rulefile = fs.CreateTextFile(shellObj.ExpandEnvironmentStrings("%USERPROFILE%") & "\Desktop\rules\" & fileName & ".txt", True, True)
    rs.Open strQuery, cnSS
    If (rs.EOF <> True) Then
    length = rs.fields(0).ActualSize
    For count = 1 To length - headerSize - 5
    index = count + headerSize
    If Chr(AscB(MidB(rs.fields(0).Value, index, 1))) <> Chr(10) Then
    rule = rule & Chr(AscB(MidB(rs.fields(0).Value, index, 1)))
    Else
    rule = rule & VBNEWLINE
    End If
    Next
    rulefile.WriteLine(rule)
    rulefile.Close
    End If
    End If
    Next
    End If
    rs.Close
    'CODE ENDS

  • Calc another calc script from a calc script or business rule

    is there a way to call a common calc script segment from other calc scripts or business rules. I do not want to replicate common code in multiple business rules. This common code updates the Essbase database, so it would need to take Essbase members as parameters and be able issue calculation commands. I do not find this possible with custom macros or custom functions. Thanks - Davis ([email protected])

    I do not think you can call another calc script from within a calc script. An alternative would be to write a MaxL script that strings multiple calc scripts together.Good luck.

Maybe you are looking for