Help using Base SAS procedures

Emailing Via SAS

Reply
N/A
Posts: 0

Emailing Via SAS

Hi all,

the below code exports a data set for each of the specified users to a central location after the code is run.

I want to find if I can email each of the data sets to the specific users instead of exporting or email after the export is completed.

is this possible, if so whats the best way to do this, I'm only new to SAS and have been using for about 2 months, I use enterprise guide.

any adivse is much appreciated.

code is as below,

%macro AP(period);
data
MRTMR1_&period. MRTMR2_&period. MRTMR3_&period. MRTMR4_&period. MRTMR5_&period. MRTMR6_&period. /*MRTMR7_&period. MRTMR8_&period. MRTMR9_&period. MRTMR10_&period.*/
MRTLR1_&period. MRTLR2_&period. MRTLR3_&period. MRTLR4_&period. MRTLR5_&period. MRTLR6_&period. MRTLR7_&period. MRTLR8_&period. /*MRTLR9_&period. MRTLR10_&period.*/
MRTHR1_&period. MRTHR2_&period. MRTHR3_&period. /*MRTHR4_&period. MRTHR5_&period. MRTHR6_&period. MRTHR7_&period. MRTHR8_&period. MRTHR9_&period. MRTHR10_&period.*/
MRTVH1_&period. MRTVH2_&period. MRTVH3_&period. MRTVH4_&period. MRTVH5_&period. /*MRTVH6_&period. MRTVH7_&period. MRTVH8_&period. MRTVH9_&period. MRTVH10_&period.
MRTFP1_&period. MRTBRK_&period. MRTSBS_&period. MRTSBC_&period. MRTMIL_&period. MRTFP2_&period. MRTBRS_&period. MRTBPR_&period. MRTFIR_&period.
MRTBPA_&period. MRTUNS_&period. MRTIAM_&period. MRTPRV_&period. MRTOOS_&period.*/ MRTCHL_&period.(Keep= product_type New_Accounts_&period. Third_Party_Code CVVL
Status customer First_Name Surname Account DPD bal&period next_action_Date Last_Action_Date Router_Description Date_of_Default State Arrears);
set p667721.MRT_DM&period.;
IF THIRD_PARTY_CODE='MRTLR1' THEN OUTPUT MRTLR1_&period.;
ELSE IF THIRD_PARTY_CODE='MRTLR2' THEN OUTPUT MRTLR2_&period.;
ELSE IF THIRD_PARTY_CODE='MRTLR3' THEN OUTPUT MRTLR3_&period.;
ELSE IF THIRD_PARTY_CODE='MRTLR4' THEN OUTPUT MRTLR4_&period.;
ELSE IF THIRD_PARTY_CODE='MRTLR5' THEN OUTPUT MRTLR5_&period.;
ELSE IF THIRD_PARTY_CODE='MRTLR6' THEN OUTPUT MRTLR6_&period.;
ELSE IF THIRD_PARTY_CODE='MRTLR7' THEN OUTPUT MRTLR7_&period.;
ELSE IF THIRD_PARTY_CODE='MRTLR8' THEN OUTPUT MRTLR8_&period.;
ELSE IF THIRD_PARTY_CODE='MRTMR1' THEN OUTPUT MRTMR1_&period.;
ELSE IF THIRD_PARTY_CODE='MRTMR2' THEN OUTPUT MRTMR2_&period.;
ELSE IF THIRD_PARTY_CODE='MRTMR3' THEN OUTPUT MRTMR3_&period.;
ELSE IF THIRD_PARTY_CODE='MRTMR4' THEN OUTPUT MRTMR4_&period.;
ELSE IF THIRD_PARTY_CODE='MRTMR5' THEN OUTPUT MRTMR5_&period.;
ELSE IF THIRD_PARTY_CODE='MRTMR6' THEN OUTPUT MRTMR6_&period.;
ELSE IF THIRD_PARTY_CODE='MRTHR1' THEN OUTPUT MRTHR1_&period.;
ELSE IF THIRD_PARTY_CODE='MRTHR2' THEN OUTPUT MRTHR2_&period.;
ELSE IF THIRD_PARTY_CODE='MRTHR3' THEN OUTPUT MRTHR3_&period.;
ELSE IF THIRD_PARTY_CODE='MRTVH1' THEN OUTPUT MRTVH1_&period.;
ELSE IF THIRD_PARTY_CODE='MRTVH2' THEN OUTPUT MRTVH2_&period.;
ELSE IF THIRD_PARTY_CODE='MRTVH3' THEN OUTPUT MRTVH3_&period.;
ELSE IF THIRD_PARTY_CODE='MRTVH4' THEN OUTPUT MRTVH4_&period.;
ELSE IF THIRD_PARTY_CODE='MRTVH5' THEN OUTPUT MRTVH5_&period.;
ELSE IF THIRD_PARTY_CODE='MRTCHL' THEN OUTPUT MRTCHL_&period.;


run;

%macro AP1(Datasetname);
Proc export data=&Datasetname.
OUTFILE="\\10.111.0.132\Shared\Collections\Portfolio Management\Secured Collections\MRT Reporting Conversion WIP\Report Output\&DATASETNAME..csv"
DBMS=csv
Replace;
run;
%mend;
%AP1(MRTCHL_&period.);
%AP1(MRTVH1_&period.);
%AP1(MRTVH2_&period.);
%AP1(MRTVH3_&period.);
%AP1(MRTVH4_&period.);
%AP1(MRTVH5_&period.);
%AP1(MRTHR1_&period.);
%AP1(MRTHR2_&period.);
%AP1(MRTHR3_&period.);
%AP1(MRTMR1_&period.);
%AP1(MRTMR2_&period.);
%AP1(MRTMR3_&period.);
%AP1(MRTMR4_&period.);
%AP1(MRTMR5_&period.);
%AP1(MRTLR1_&period.);
%AP1(MRTLR2_&period.);
%AP1(MRTLR3_&period.);
%AP1(MRTLR4_&period.);
%AP1(MRTLR5_&period.);
%AP1(MRTLR6_&period.);
%AP1(MRTLR7_&period.);
%AP1(MRTLR8_&period.);
%AP1(MRTMR6_&period.);
%mend;
%AP(&Mon.);
Super Contributor
Super Contributor
Posts: 3,174

Re: Emailing Via SAS

Posted in reply to deleted_user
Search the archives or the SAS support website for info about using the FILENAME EMAIL engine to send an EMAIL with an attachment. Depending on your OS platform, you may also need to supply the EMAILHOST= (and possibly other related parameters) CONFIG parameter.

Scott Barry
SBBWorks, Inc.
N/A
Posts: 0

Re: Emailing Via SAS

thanks Scott, will look in to this one. cheers
Ask a Question
Discussion stats
  • 2 replies
  • 133 views
  • 0 likes
  • 2 in conversation