Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright, SAS Institute Inc. All rights reserved. SAS ® Activity-Based Management (ABM) EasyAPI A Framework Usage Scenario.

Similar presentations


Presentation on theme: "Copyright, SAS Institute Inc. All rights reserved. SAS ® Activity-Based Management (ABM) EasyAPI A Framework Usage Scenario."— Presentation transcript:

1 Copyright, SAS Institute Inc. All rights reserved. SAS ® Activity-Based Management (ABM) EasyAPI A Framework Usage Scenario

2 Problem: You want to automate SAS © Activity-Based Management (ABM) data updates using the Application Programming Interface (API). You do not want to do any programming work to use the API and you want each independent task to run synchronously (i.e. Calculate must not begin until Import is fully completed with no errors). Finally since the data updates may take hours, you don’t want to keep checking the status manually – so you would like to be notified via Email once the whole automation process is done. Solution: SAS ABM EasyAPI

3 Notice our fictitious Activity-Based Management Model (Solutions, Inc.) for current Month (January 2006), it contains $0 for all Activities. That’s because we haven’t updated the Model with Salary and Labor Hours data from our existing ERP system (i.e. SAP, Oracle).

4 Our Automation Game Plan is as follows: Export January Tables Run a SAS job to update the tables Reimport Calculate Export Report Data Generate Report using SAS Enterprise Guide Let’s execute the first task: Export January Tables Run a SAS job to update the tables Reimport Calculate Export Report Data Generate Report using SAS Enterprise Guide

5 Export January Tables We launch ABM Export Wizard. We tell it basically to export our Fictitious Model “Solutions, Inc.” and we’re interested in “January 2006” Tables. Export January Tables - Completed 0 Errors – that’s good. EasyAPI Automation Framework is based on the following common-sense principle: You cannot automate a process successfully if the same process failed to run manually.

6 Notice behind the scene SAS ABM automatically generated The XML file used to successfully Export our January tables. We will use this XML file as a template To export future month’s data. We rename the long file name to something simple: Export_Period1.xml Let’s open the XML to see what’s in it.

7 Notice Model= parameter contains the fictitious model We selected (“Solutions, Inc.”) The other parameter is Period= parameter. We want “January 2006” tables. So for future similar job run, we could simply modify Period= parameter (i.e. to “February 2006”) and our automation process is ready to go. Up to this point we haven’t automated anything. So let’s automate this Export step using EasyAPI.

8 It is surprisingly simple to automate the Export step. Notice the highlighted line on the simple EasyAPI text file template. We simply say: Export “ ” We’re done. Did we need to install software development kits on our Windows? No. Did we have to read code samples to learn how to invoke export correctly? No. Did we have to know Java or Visual Basic? No. The point is EasyAPI hides all that programming complexities and allows you to focus on your Automation process.

9 Notice The Export generated The SAS Datasets/Tables output.

10 Let’s execute the second task: Export January Tables Run a SAS job to update the tables Reimport Calculate Export Report Data Generate Report using SAS Enterprise Guide

11 Notice the highlighted line. We’re asking EasyAPI to execute an External SAS job that would update our tables. We simply say: Run “ ” Obviously it’s out of the scope of EasyAPI To discuss the SAS Batch job internal codes. The “Update_Period1.sas” file could simply contain Basic SQL/Datastep codes that would obtain latest Salary/Labor Hours from external ERP systems like SAP or Oracle for example. But here’s where EasyAPI adds value: It automatically synchronizes the SAS job. In other words, it ensures the previous Export is done Successfully first before the SAS table update job starts. EasyAPI allows you to use “Run” command to run other External processes – not limited to SAS Batch jobs only.

12 Notice the SAS job has obtained the latest “EnteredCost” (Salary Costs) And updates one of our January tables. Once all updates are done, we’re ready for the third task.

13 Let’s execute the third task: Export January Tables Run a SAS job to update the tables Reimport Calculate Export Report Data Generate Report using SAS Enterprise Guide

14 Reimport January Tables We launch ABM Import Wizard. We tell it basically to import our Fictitious Model “Solutions, Inc.” updates. Import January Tables - Completed 0 Errors – that’s good. Again this manual “one-time” validation is an integral Part of EasyAPI Automation Framework because: a) It generates a good XML template for us. b) It confirms the task, based on all parameters you specified during the Import Wizard, is indeed valid.

15 Notice behind the scene SAS ABM automatically generated The second XML file used to successfully Import our January tables. We will use this XML file as a template To import future month’s data. We rename the long file name to something simple: Import_Period1.xml Let’s open the XML to see what’s in it.

16 Notice Model= parameter contains the fictitious model We selected (“Solutions, Inc.”) The other parameter is Action= parameter. We want to “Update” (Not creating a whole new model). Notice this XML does not have Period= parameter. That’s good news. That means for future similar job run, we don’t have to modify this XML template at all. If we were to manually type all these XML parameters We would be prone to typos and other invalid parameter problems. So in EasyAPI Automation Framework we want the system To generate the XML files for us and we simply use them as our templates in the API calls. ABM Solution, like many other web-based Solutions, relies on XML to tell The server what to do. XML is an industry standard. Therefore EasyAPI Automation Framework Can be applied to other Solutions that adhere to this standard.

17 It is surprisingly simple to automate the Import step as well. Notice the highlighted line on the simple EasyAPI text file template. We simply say: Import “ ” We’re done. We greatly simplify the API calls and with no extra Programming work, we ensure this import task starts As soon as the previous task (SAS job update) is done with no errors.

18 Let’s execute the fourth task: Export January Tables Run a SAS job to update the tables Reimport Calculate Export Report Data Generate Report using SAS Enterprise Guide

19 Calculate January 2006 We launch ABM Calculate Window. We tell it basically to Calculate “All” Period. This should give us a Period-independent XML template – which would Work for similar future period calculations. Calculate January 2006 - Completed 0 Errors – that’s good. We got some warnings but these warnings are expected/informational. So what happens if we do get Errors? EasyAPI will stop the process and If it detects SMTP/Email Service is available, it will email us the error details/logs.

20 Notice behind the scene SAS ABM automatically generated The successful Calculate XML file for us. We will use this XML file as a template To calculate future month’s data. We rename the long file name to something simple: Calculate_Period1.xml Let’s open the XML to see what’s in it.

21 Notice ModelFullName= parameter contains the fictitious model We selected (“Solutions, Inc.”) The other parameter is PeriodId= parameter. Since We asked it to calculate “All” period, the special value key for That is 0 (zero). Without this System Generated XML, we would Probably have to research the API documentation to figure out that PeriodId=“0” Means it would Calculate all periods. In EasyAPI Framework, we basically leverage manual Steps that users are already familiar with, let the system capture these Steps in an XML file and then automate it.

22 We simply say: Calculate “ ” We’re done with Calculate.

23 Notice our fictitious Activity-Based Management Model (Solutions, Inc.) for current Month (January 2006) now contains Actual Dollar Amount for different Activity Costs. They were all $0 prior to Import/Calculate Tasks.

24 Let’s execute the fifth task: Export January Tables Run a SAS job to update the tables Reimport Calculate Export Report Data Generate Report using SAS Enterprise Guide

25 Export January Report Data We launch ABM Report Data Export Wizard. We tell it basically to export our Fictitious Model “Solutions, Inc.” and we’re interested in “January 2006” report data. Export January Report Data - Completed 0 Errors – that’s good. Now we have a Report Table that SAS Enterprise Guide can use to generate a nice HTML report for us.

26 Notice behind the scene SAS ABM automatically generated The XML file used to successfully export our January Report Table. We will use this XML file as a template to export future month’s report data. We rename the long file name to something simple: Export_Period1_Report.xml Let’s open the XML to see what’s in it.

27 Notice Period Names= parameter. We want “January 2006” tables. So for future similar job run, we could simply modify Period Names= parameter (i.e. to “February 2006”) and also modify the Period “Ids=“ parameter.

28 We simply say: Export Report “ ” We’re done with Export Report.

29 Notice The Export Report generated The Report Table that Reporting Application like SAS Enterprise Guide can use to generate a nice report for us.

30 Let’s execute the final task: Export January Tables Run a SAS job to update the tables Reimport Calculate Export Report Data Generate Report using SAS Enterprise Guide

31 Notice the final highlighted line. We’re asking EasyAPI to execute an External SAS Enterprise Guide (EG) project that would generate A nice HTML report for us. We simply say: Run “ ” Obviously it’s out of the scope of EasyAPI To discuss all the mouse-click steps in EG to Generate the report. In EG basically we specify the report/graph type we like, which table fields we want and once we’re happy with report output we save the project as “Generate_Period1_EG_Reports.egp” for example.

32 Notice EG has generated a nice HTML report for January 2006. Every month report consumers can simply go to their web bookmarks and get the most current report data.

33 Congratulations! We’ve established the EasyAPI Automation Framework for all our tasks. Now suppose end of February 2006 is coming soon. What do we have to do to make our EasyAPI automation ready for February 2006 updates? Answer: Just update the Export-XML files and specify the “Period=“ Parameters to “February 2006”. In our scenario, they are: Export_Period1.xml Export_Period1_Report.xml

34 Since it’s not end of February 2006 yet, we decide not to execute the automation right away. So EasyAPI can be scheduled to run Using the built-in Windows Scheduled Task Wizard. This Windows Accessory is already bundled in most Windows (even back since Windows 98). Here we want EasyAPI to execute always on the last Saturday of each month at 3AM. The idea is we want our report consumer to always have the latest Report at the beginning of each Month.

35 Once EasyAPI tasks are completed, it can notify us via Email. So as long as we get “SUCCESS” message, our tasks should be ok. If there were Errors, the Error details/logs would be emailed to us instead.

36 Notice EG has generated a nice HTML report for February 2006. Looks like the most expensive Activity For February is Marketing Products and Services. For January 2006 it was Strategizing Products and Services.

37 Let’s Summarize and Review Our Entire Process by looking at the: EasyAPI High-Level Process Flow Diagram

38

39 Summary Points and Closing Remarks: The complexity of instantiating API correctly, managing synchronous process and reporting problems/success status via email are all taken care of by EasyAPI Automation Framework. These facilities are often missing in a lot of API implementations. We just typically expose a number of API functions, throw in a few snippet codes and tell our users to go figure them out and piece them all together. The Framework does not attempt to do every single thing we can do with a plethora of API libraries. It goes by the Pareto Principle - taking care of 80% (majority) of usage needs and provide a simple framework that users can leverage on with little or no programming backgrounds. It relies on Windows Scripting Host technology which is already built-in in most Windows OS - so there's no extra programming software to install/configure. It can also be easily scheduled to execute periodically using the built-in Windows Scheduled Task Wizard. As far as learning curves, EasyAPI contains no new Graphical User Interface to learn. Its UI is a simple Text file template. EasyAPI tasks are written in plain English (export, import, calculate). Localizing these commands can also be easily done. For example we can map "calculate" to be synonymous with "calculez" in French. In a sense the Framework is unique in that it uses “human” language – rather than relying on “computer/programming” language to leverage the API’s. Users can focus on the Automation/ETL process flow rather than worrying about the programming aspects of the Application “Programming” Interface (API). ABM Solution, like many other web-based Solutions, relies on XML to tell the server what to do. XML is an industry standard. Therefore EasyAPI Automation Framework, which relies on XML API parameters, can be applied to other Solutions/Applications that adhere to this standard.

40 Copyright, SAS Institute Inc. All rights reserved. Thank You


Download ppt "Copyright, SAS Institute Inc. All rights reserved. SAS ® Activity-Based Management (ABM) EasyAPI A Framework Usage Scenario."

Similar presentations


Ads by Google