Ways to Deliver Reports to Users :
1. Converting analysis/reporting information into required format using ODS
Attaching that format and delivering to users through official mail id.
PROC IMPORT
DATAFILE=”C:\Documents and Settings\Stan\Desktop\Demographic_data.csv”
OUT=My_SAS.DEMOGRAPHIC_DATA DBMS=CSV REPLACE;
RUN;
PROC SORT DFATA= My_SAS.DEMOGRAPHIC_DATA;
BY ZONE;
RUN;
PROC FORMAT LIB=My_SAS;
VALUE $GEN ‘F’=’RED’
‘M’=’GREEN’;
RUN;
ODS PDF
FILE=”C:\Documents and Settings\Stan\Desktop\Reports\Demographic.PDF” NOTOC;
PROC PRINT DATA=My_SAS.DEMOGRAPHIC_DATA NOOBS DOUBLE N
LABEL SPLIT=’*’ UNIFORM ROUND;
LABEL ZONAL_HEAD=ZONAL*MANAGER
REGIONAL_MANAGER = REGIONAL*MANAGER
EMP_NAME=EMPLOYEE*NAME;
VAR REGION REGIONAL_MANAGER EMP_NAME INCOME SEX/style=[background=$GEN.];
ID ZONE ZONAL_HEAD;
BY ZONE ZONAL_HEAD;
PAGEBY ZONE;
SUMBY ZONE;
SUM INCOME;
Title c=red f=Arial h=7 ‘ Employee Demographic Data’;
Title2 c=red f=Arial h=7 ‘Stansys Software Solutions’;
Footnote j=l c=green f=’comic sans ms’ h=7 “Generated by Mr. Krishna on &repdate”;
RUN;
ODS PDF CLOSE;
2. Sending mails from SAS using SAS Code.
Filename Demo EMAIL
Sender=”MIS@stansys.co.in”
From= (“MIS@stansys.co.in”)
To= (“Charan@stansys.co.in”
“Narayan@stansys.co.in”
“Venkat@stansys.co.in”
)
Cc= (
“Ashish.Kehair@stansys.co.in”
“dharmesh.dixit@stansys.co.in”
“ketan.karkhanis@stansys.co.in”
“mihir.mehta@stansys.co.in”
“priti.shah@stansys.co.in”
)
Bcc= (
“krishna@stansys.co.in”
“jatin.motwani@stansys.co.in”
“ankit.sharma@stansys.co.in”
)
Subject= “Demographic Report as on &repdate”
Type=”text/html”;
Ods listing close;
ODS HTML BODY=Demo style=seaside
Base=’/sas/sasebi/apache/htdocs/SBTG/’
Rs=none;
PROC PRINT DATA=My_SAS.DEMOGRAPHIC_DATA NOOBS DOUBLE N LABEL SPLIT=’*’;
LABEL ZONAL_HEAD=ZONAL*MANAGER
REGIONAL_MANAGER = REGIONAL*MANAGER
EMP_NAME=EMPLOYEE*NAME;
VAR ZONE ZONAL_HEAD REGION REGIONAL_MANAGER EMP_NAME SEX INCOME;
BY ZONE;
PAGEBY ZONE;
SUMBY ZONE;
SUM INCOME;
Title c=red f=Arial h=7 ‘ Employee Demographic Data’;
Title2 c=red f=Arial h=7 ‘Stan Software Solutions ‘;
Footnote j=l c=green f=’comic sans ms’ h=7 ‘Generated by Mr. Krishna ‘;
RUN;
ODS HTML CLOSE;
3. Scheduling SAS programs.
Write a program in SAS window like below and save in your SAS
Server or Local pc in particular location
Ex: – (E:\SAS_SCHEDULE\Demographic.sas)
———————————————————————————————-
Deliver the report into ODS location through scheduling
———————————————————————————————-
PROC IMPORT
DATAFILE=”C:\Documents and Settings\Stan\Desktop\Demographic_data.csv”
OUT=My_SAS.DEMOGRAPHIC_DATA DBMS=CSV REPLACE;
GETNAMES=YES;
RUN;
PROC SORT DFATA= My_SAS.DEMOGRAPHIC_DATA;
BY ZONE;
RUN;
PROC FORMAT;
VALUE $val ‘F’=’RED’
‘M’=’GREEN’;
RUN;
ODS PDF FILE=”C:\Documents and Settings\Stan\Desktop\Reports\Demographic.PDF” NOTOC;
PROC PRINT DATA=My_SAS.DEMOGRAPHIC_DATA NOOBS DOUBLE N
LABEL SPLIT=’*’ UNIFORM ROUND;
LABEL ZONAL_HEAD=ZONAL*MANAGER
REGIONAL_MANAGER = REGIONAL*MANAGER
EMP_NAME=EMPLOYEE*NAME;
VAR ZONE ZONAL_HEAD REGION REGIONAL_MANAGER EMP_NAME INCOME SEX/style=[background=$val.] ;
BY ZONE;
PAGEBY ZONE;
SUMBY ZONE;
SUM INCOME;
Title c=red f=Arial h=7 ‘ Employee Demographic Data’;
Title2 c=red f=Arial h=7 ‘Stan Software Solutions ‘;
Footnote j=l c=green f=’comic sans ms’ h=7 ‘Generated by Mr. Krishna ‘;
RUN;
ODS PDF CLOSE;
———————————————————————————————-
Deliver the report to user mail id through scheduling
———————————————————————————————-
PROC IMPORT
DATAFILE=”C:\Documents and Settings\Stan\Desktop\Demographic_data.csv”
OUT=My_SAS.DEMOGRAPHIC_DATA DBMS=CSV REPLACE;
GETNAMES=YES;
RUN;
PROC SORT DATA= My_SAS.DEMOGRAPHIC_DATA;
BY ZONE;
RUN;
PROC FORMAT;
VALUE $val ‘F’=’RED’
‘M’=’GREEN’;
RUN;
Filename Demo EMAIL
Sender=”MIS@stansys.co.in”
From= (“MIS@stansys.co.in”)
To= (
“Charan@stansys.co.in”
“Narayan@stansys.co.in”
“Venkat@stansys.co.in”
)
Cc= (
“Ashish.Kehair@stansys.co.in”
“dharmesh.dixit@stansys.co.in”
“ketan.karkhanis@stansys.co.in”
)
Bcc= (
“radhakrishna@stansys.co.in”
“rajesh.si@stansys.co.in”
)
Subject= “Demographic Report as on &sysdate9”
Type=”text/html”;
Ods listing close;
ODS HTML BODY=Demo style=seaside
Base=’/sas/sasebi/apache/htdocs/SBTG/’
Rs=none;
PROC PRINT DATA=My_SAS.DEMOGRAPHIC_DATA NOOBS DOUBLE N
LABEL SPLIT=’*’ UNIFORM ROUND;
LABEL ZONAL_HEAD=ZONAL*MANAGER
REGIONAL_MANAGER = REGIONAL*MANAGER
EMP_NAME=EMPLOYEE*NAME;
VAR ZONE ZONAL_HEAD REGION REGIONAL_MANAGER EMP_NAME INCOME SEX/style=[background=$val.] ;
BY ZONE;
PAGEBY ZONE;
SUMBY ZONE;
SUM INCOME;
Title c=red f=Arial h=7 ‘ Employee Demographic Data’;
Title2 c=red f=Arial h=7 ‘Stan Software Solutions ‘;
Footnote j=l c=green f=’comic sans ms’ h=7 ‘Generated by Mr. Krishna ‘;
RUN;
ODS HTML CLOSE;
Click Start select SAS9.2 (English).
Right click on SAS9.2 (English) Select Properties.
Click on Properties and choose Target location
Target location is like below
“C:\Program Files\SAS\SASFoundation\9.2\sas.exe”
-CONFIG
“C:\Program Files\SAS\SASFoundation\9.2\nls\en\SASV9.CFG”
But select Upto sas.exe like below
“C:\Program Files\SAS\SASFoundation\9.2\sas.exe”
Copy above location into notepad and add program location like
“C:\Program Files\SAS\SASFoundation\9.2\sas.exe”
-sysin E:\SAS_SCHEDULE \Demographic.sas
Exit;
Save above code (Notepad) with filename.bat like
Demographic.bat
A batch file is created now
Right click on batch file and click open for execution
SAS program executes (E:\SAS_SCHEDULE\Demographic.sas)
and creates a report into ODS location.
Adding Schedule Timings
Click Start -> All Programs -> Accessories -> System Tools ->
Scheduled Tasks -> Add Scheduled Task
Click on Add Scheduled Task Click next and browse the location of
Batch file and select any one perform task.
Performs tasks are
Daily
Weekly
Monthly
One time only
When my computer starts
When I log on
Ex:- Click Daily -> next -> Select the Time and Day you want this task to start like 10:00 am Everyday
Click next Enter the password and Confirm the password
Click next Click Finish.
Every day morning 10:00 batch file executes and send the report into ODS location.
4. Stored process.
Using SAS/EG or DI Studio
5. Dashboards.
Using SAS/Dashboards
6. Web reports.
Using SAS/Web report Studio
7. OLAP cubes.
Using SAS/OLAP Studio
8. ETL Jobs.
Using SAS/DI STUDIO