Question: DSCI 5 1 9 8 . Use a macro DO loop to repeat Part 2 of the program five times. The first time through the
DSCI
Use a macro DO loop to repeat Part of the program five times. The first time through the loop, the program should generate the PDF report for the top supplier. The report should be modified as follows:
a The prefix for each PDF file name should be the supplier rank number, through The name of each PDF file should be the value of SupplierName with all spaces replaced with underscores. Use the REPLACESPACE custom macro function.
After the ODS GRAPHICS statement, add a DO macro statement with an index variable i that starts at and ends at
At the end of the program, before the END statement this closes the IF THENDO block add another END statement.
After the MACRO statement, add a LOCAL statement to ensure that i is written to and read from the local symbol table.
In the ODS PDF statement, delete the hardcoded supplier name, EclipseInc keep the pdf extension and replace it with an expression that does the following:
a calls the replacespace macro
b includes the value of the macro variable i followed by an underscore as the file name prefix.
c uses an indirect macro variable reference as the parameter for the replacespace macro. The indirect reference should substitute the value of the Name Nameand so on macro variable.
b The first title should be the rank of the supplier and then the SupplierName value, followed by the full country name for that particular supplier for example, Orders for # Eclipse Inc, United States
After the ODS statement, add a LET statement to create a macro variable named CC that will be the twoletter CountryCode for the supplier being analyzed in the loop. For example, when i the value of CC is the CountryCode assigned to the Country macro variable. This requires an indirect macro variable reference. This macro variable is used later to insert the country name in the title.
In the TITLE statement, use the i macro variable to substitute the rank number of the supplier.
Use an indirect macro variable reference to substitute the macro variable value for Name Name and so on
Use an indirect macro variable reference to substitute the full country name. Remember that the macro variable CountryCC where CC is the twoletter CountryCode for the supplier, stores the country name. Use the CC macro variable created earlier as part of the indirect reference.
c The second title should be one of the following, depending on the value of the ot parameter: Retail Sales Only, Catalog Sales Only, or Internet Sales Only. To create the second title, use IFTHEN, and END statements to provide unique TITLE statements depending on the value of the ot parameter.
d For the bar chart PROC SGPLOT step the data should be subset to include one supplier at a time. Modify the WHERE statement to use an indirect macro variable reference to substitute the SupplierID value.
e For the report PROC SQL step a footnote should be added below the report that includes the date and time that the report was created. The data should also be subset to include only the top supplier.
Add a FOOTNOTE statement before the last PROC SQL step.
Use SYSFUNC to execute the TODAY function and format it with an appropriate date format.
Use SYSFUNC again to execute the TIME function and format it with an appropriate time format.
Test the SupplierReport macro program with parameter values of and null. Make sure that when is provided, the error message is written to the log and no output is generated. Test that error messages are also generated if a null value is provided.
Save the supplierreport.sas macro program in the Exam folder.
Answer the Following Business Questions:
Answer the following business questions using the reports created by the macro program.
Which company is the # supplier for internet sales only OrderType
What was the top product group for the top supplier for catalog sales only OrderType
Which country is the # supplier for retail sales only OrderType
Submit all your work in DLDSCI
Introduction
Orion Star company maintains detailed tables about the products that they offer, the orders placed by customers, and the suppliers for
each product. A SAS program has been written to prepare the data to summarize profit for each supplier. The first portion of the program
identifies the top suppliers. The second part of the program must be edited to generate a summary report for a particular supplier.
Information about the selected supplier, including the ID name, and country, must be manually replaced in the program.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
