Converting to SAS ODS Charting

SAS ODS Graphical Procedures are able to produce charts that are comparable to the charts produced by the Query and Reporting feature of
MICS
(Q&R).
mics142
SAS ODS Graphical Procedures are able to produce charts that are comparable to the charts produced by the Query and Reporting feature of
MICS
(Q&R).
Whether you are implementing graphical reporting for the first time using SAS ODS graphical procedures, or converting from
MICS
Q&R charting, we recommend starting with the
MICS
MICF distributed inquiries for samples. For information about identifying the MICF SAS ODS graphical inquiries, see Executing Cataloged Inquiries (MICF User Guide 2.4).
Three of the most commonly composed chart types are represented here.
Vertical Bar Chart
See MICF inquiry RMFODD, "CPC and LPAR Daily Shared CP Engine Dispatch"
Stacked Vertical Bar Chart
See MICF inquiry RMFODO, "Daily zIIP Engine Use+Demand by Srv Cls"
Pie Chart - RMFODQ
See MICF inquiry RMFODQ, "zOS Daily Top 10 Srvc Classes by SYSPLEX"
Each of these inquiries is described and documented in the Reports section of their respective product guide.
We recommend starting with the use of the CADEFAULT style template and style definitions. Once you have more experience with SAS ODS graphical procedures, you can either modify the default style template, or create your own. For more information, see section SAS ODS Inquiry Processing.
When you have created a MICF inquiry that creates a file with the variables you want to chart, follow these steps:
  1. If you plan to use the
    MICS
    CPCID facility to include the Central Processing Complex ID of your z/OS systems in a title or elsewhere within your chart output, use the Insert (I) line command to insert an Independent Source Statements step at the BEGINNING (top) of your MICF inquiry.
    The Independent Source Statements step can be reached from Data Manipulation, option 7; Advanced Data Manipulation, option 6, and Independent Source Statements,option 6, or simply entering 7;6;6 after the insert line command.
    Within this step, insert the following statement to access the CPCID associated with your z/OS systems:
    %CPCIDFMT ;
    For more information, see CPCID - Central Processing Complex ID (RMF 7.2.2).
    1. If you performed step 1 to use the Central Processing Complex ID, insert a
      MICS
      Data Derivation step in your MICF inquiry AFTER your
      MICS
      File Selection step. For example:
             Element Name  ===> CPCID               Label  ===> CPC ID        Element Type  ===> A        Value Length  ===> 26        Output Format ===> _______________        Element Derivation:          ===> CPCID    = ' ';                          %CPCID;
  2. Use the Insert (I) line command to insert an "External File Allocation" step to allocate the sharedprefix.MICS.USER.SOURCE library to the MICF inquiry. Specify the parameters as follows:
    DDNAME ===> CUSOURCE CA MICS Library ===> SHRUSORC
  3. Use the Insert (I) line command to insert an "Independent Source Statements" step at the END of your MICF inquiry. The Independent Source Statements step can be reached from Data Manipulation, option 7; Advanced Data Manipulation, option 6, and Independent Source Statements,option 6, or simply entering 7;6;6 after the insert line command.
    1. Set the "Generates PNG" option to Y in this step.
    2. Insert the following statement to include the macro variable definitions that control the appearance of the output.
            %INCLUDE CUSOURCE(ICFODSST);
      For more information about the ICFODSST member, see SAS ODS Inquiry Processing.
      Perform either step 3c or step 3d:
    3.  Copy the sharedprefix.MICS.SOURCE cccOxx (for example, RMFODA) member that matches your desired chart type, directly into the MICF Independent Source Statements step,
    4.  Copy the sharedprefix.MICS.SOURCE cccOxx member to a new member in sharedprefix.MICS.USER.SOURCE.
      Insert a %INCLUDE SAS statement in the Independent Source Statements step that refers to the member you created in sharedprefix.MICS.USER.SOURCE, to include and execute your SAS code. Use the libref (ddname) of CUSOURCE.
      For example,
             %INCLUDE CUSOURCE(your member);
    5. Insert the following statement to close the listing destination
            ODS LISTING CLOSE;
      For more information about the ODS LISTING statement, see SAS ODS Inquiry Processing.
  4. Modify the copied SAS code to use the data elements associated with your inquiry.
  5. Check your use of SAS Title statements. Generally, SAS Title statements are used with the SGPLOT procedure, while SAS Entrytitle statements are used in the SGRENDER procedure, to specify chart titles.
    If you are using PROC SGRENDER, and plan to add this inquiry to a MICF Reporting Job Stream, be sure to insert SAS Title statements without any arguments, to clear any titles defined for a previous inquiry. This ensures that when the inquiry executes within a MICF Reporting Job Stream, that titles are not applied to a subsequent chart in the HTML output.
    If using PROC SGRENDER, insert
          TITLE1; TITLE2; TITLE3; TITLE4;
    to clear any titles from a previous inquiry. For more information about the effect of the SAS Title statement, see SAS ODS Inquiry Processing.
    Note:
     This is only important if you plan to use the HTML output that consolidates all the PNG files into one HTML file when executed in a MICF Reporting Job Stream.
  6. Within your SAS code that contains the SAS ODS graphical procedures (SGPLOT or SGRENDER), insert the %ICFEDATA macro invocation to define the title to be passed to the web publishing process, as well as the name of the file that produced the chart. This is used by the Enhanced Web Publishing to override the title, and get the correct labels and formats of the keys.
    The macro is to be invoked BEFORE every ODS charting procedure (SGPLOT or SGRENDER), to provide additional information about what is being charted.
    The current parameters are:
    data
    Name of the dataset used to produce the charts.
    title
    The title (single line) used to display the name the charting procedure.
    For more information about the %ICFEDATA macro invocation, see SAS ODS Inquiry Processing.
  7. Test your MICF inquiry.
    When you are satisfied with the output of your MICF SAS ODS inquiry, you can add it to a MICF Reporting Job Stream to automate scheduling and execution. For more information, see 2.8.7 MICF Reporting Job Stream Considerations.