Hi All,
Im downloading a file from a Server location and then attaching the file in SAS Email code. Is there any solution for attaching file directly from server ie: giving server path in attachment. when i try to give server path it says physical file doesn't exist.
currently below code is working.
options mprint symbolgen;
/*report name*/
%let report_ext =AMSHPP.EC654350.EASTOPEN;
/*paths*/
%let serverfl = /var/data/devel/serial/freight/znative/private/mbg/mbg_batch/main;
%let sas_local_path = /opt/production/znative_sas/SAS_CODES/tmp/MBG_SAS/Email_Files;
**output file --lst file;
filename mylst sftp "&serverfl/&report_ext" host="10.193.18.29" USER='dp1201770';
filename saslst "&sas_local_path/&report_ext";
data _null_;
infile mylst;
file saslst;
input;
put _infile_;
run;
filename outbox email
TO=(abc@gmail.com)
FROM=('abinitio2linux_emailer@gmail.com')
ATTACH=("%sysfunc(pathname(saslst))") /*how can i give the server path here*/
SUBJECT='Requests stuck in a non-final Status';
data _null_;
file outbox;
PUT 'The file is generated with pending data in the attachment';
run;
data _null_;
rc=fdelete('saslst');
run;
Hi,
The ATTACH= option to the EMAIL filename statement is documented as
specifies the physical name of the file or files to be attached to the message
This implies that it has to be a locally accessible file. So your current approach of copying the file seems to be proper. Wish I had better news.
Hope this helps,
- Jan.
Hi,
The ATTACH= option to the EMAIL filename statement is documented as
specifies the physical name of the file or files to be attached to the message
This implies that it has to be a locally accessible file. So your current approach of copying the file seems to be proper. Wish I had better news.
Hope this helps,
- Jan.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.